|
|
@ -23,10 +23,10 @@ void MotionController::Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps)
|
|
|
|
this->z = z;
|
|
|
|
this->z = z;
|
|
|
|
|
|
|
|
|
|
|
|
int32_t deltaSteps = nbSteps - this->nbSteps;
|
|
|
|
int32_t deltaSteps = nbSteps - this->nbSteps;
|
|
|
|
this->nbSteps = nbSteps;
|
|
|
|
|
|
|
|
if (deltaSteps > 0) {
|
|
|
|
if (deltaSteps > 0) {
|
|
|
|
currentTripSteps += deltaSteps;
|
|
|
|
currentTripSteps += deltaSteps;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this->nbSteps = nbSteps;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MotionController::Should_RaiseWake(bool isSleeping) {
|
|
|
|
bool MotionController::Should_RaiseWake(bool isSleeping) {
|
|
|
@ -61,10 +61,6 @@ bool MotionController::ShouldShakeWake(uint16_t thresh) {
|
|
|
|
return accumulatedSpeed > thresh;
|
|
|
|
return accumulatedSpeed > thresh;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MotionController::IsSensorOk(bool isOk) {
|
|
|
|
|
|
|
|
isSensorOk = isOk;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MotionController::Init(Pinetime::Drivers::Bma421::DeviceTypes types) {
|
|
|
|
void MotionController::Init(Pinetime::Drivers::Bma421::DeviceTypes types) {
|
|
|
|
switch (types) {
|
|
|
|
switch (types) {
|
|
|
|
case Drivers::Bma421::DeviceTypes::BMA421:
|
|
|
|
case Drivers::Bma421::DeviceTypes::BMA421:
|
|
|
@ -78,7 +74,3 @@ void MotionController::Init(Pinetime::Drivers::Bma421::DeviceTypes types) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MotionController::SetService(Pinetime::Controllers::MotionService* service) {
|
|
|
|
|
|
|
|
this->service = service;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|