Handle return code from BMA driver, and set a flag is the initialization fails. This allows to boot InfiniTime even if the device cannot initialize.
This commit is contained in:
@@ -240,9 +240,13 @@ bool WatchFaceDigital::Refresh() {
|
||||
}
|
||||
|
||||
stepCount = motionController.NbSteps();
|
||||
if(stepCount.IsUpdated()) {
|
||||
motionSensorOk = motionController.IsSensorOk();
|
||||
if(stepCount.IsUpdated() || motionSensorOk.IsUpdated()) {
|
||||
char stepBuffer[5];
|
||||
sprintf(stepBuffer, "%lu", stepCount.Get());
|
||||
if(motionSensorOk.Get())
|
||||
sprintf(stepBuffer, "%lu", stepCount.Get());
|
||||
else
|
||||
sprintf(stepBuffer, "---", stepCount.Get());
|
||||
lv_label_set_text(stepValue, stepBuffer);
|
||||
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, -2);
|
||||
lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0);
|
||||
|
@@ -50,6 +50,7 @@ namespace Pinetime {
|
||||
DirtyValue<int> batteryPercentRemaining {};
|
||||
DirtyValue<bool> bleState {};
|
||||
DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime{};
|
||||
DirtyValue<bool> motionSensorOk {};
|
||||
DirtyValue<uint32_t> stepCount {};
|
||||
DirtyValue<uint8_t> heartbeat {};
|
||||
DirtyValue<bool> heartbeatRunning {};
|
||||
|
Reference in New Issue
Block a user