|
2 | 2 | #include "os/os_cputime.h" |
3 | 3 | using namespace Pinetime::Controllers; |
4 | 4 |
|
5 | | -void MotionController::Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps) { |
| 5 | +void MotionController::Update(uint32_t nbSteps, int16_t x, int16_t y, int16_t z, |
| 6 | + int16_t* samples, uint16_t samples_length) { |
6 | 7 | if (this->nbSteps != nbSteps && service != nullptr) { |
7 | 8 | service->OnNewStepCountValue(nbSteps); |
8 | 9 | } |
9 | 10 |
|
10 | 11 | if (service != nullptr && (this->x != x || this->y != y || this->z != z)) { |
11 | | - service->OnNewMotionValues(x, y, z); |
| 12 | + service->OnNewMotionValues(samples, samples_length); |
12 | 13 | } |
13 | 14 |
|
14 | 15 | this->x = x; |
@@ -69,18 +70,8 @@ int32_t MotionController::currentShakeSpeed() { |
69 | 70 | void MotionController::IsSensorOk(bool isOk) { |
70 | 71 | isSensorOk = isOk; |
71 | 72 | } |
72 | | -void MotionController::Init(Pinetime::Drivers::Bma421::DeviceTypes types) { |
73 | | - switch (types) { |
74 | | - case Drivers::Bma421::DeviceTypes::BMA421: |
75 | | - this->deviceType = DeviceTypes::BMA421; |
76 | | - break; |
77 | | - case Drivers::Bma421::DeviceTypes::BMA425: |
78 | | - this->deviceType = DeviceTypes::BMA425; |
79 | | - break; |
80 | | - default: |
81 | | - this->deviceType = DeviceTypes::Unknown; |
82 | | - break; |
83 | | - } |
| 73 | +void MotionController::Init(Pinetime::Drivers::AccelerationDeviceTypes types) { |
| 74 | + this->deviceType = types; |
84 | 75 | } |
85 | 76 | void MotionController::SetService(Pinetime::Controllers::MotionService* service) { |
86 | 77 | this->service = service; |
|
0 commit comments