Introduce an alias for the step counter's type

This commit is contained in:
Sándor Rátkai 2024-09-08 01:41:41 +02:00 committed by Hunman
parent 997e4cee8c
commit d030982902
2 changed files with 8 additions and 6 deletions

View file

@ -35,7 +35,7 @@ namespace {
}
}
void MotionController::Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps) {
void MotionController::Update(int16_t x, int16_t y, int16_t z, MotionController::step_t nbSteps) {
if (this->nbSteps != nbSteps && service != nullptr) {
service->OnNewStepCountValue(nbSteps);
}

View file

@ -18,7 +18,9 @@ namespace Pinetime {
BMA425,
};
void Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps);
using step_t = uint32_t;
void Update(int16_t x, int16_t y, int16_t z, step_t nbSteps);
int16_t X() const {
return xHistory[0];
@ -32,7 +34,7 @@ namespace Pinetime {
return zHistory[0];
}
uint32_t NbSteps() const {
step_t NbSteps() const {
return nbSteps;
}
@ -40,7 +42,7 @@ namespace Pinetime {
currentTripSteps = 0;
}
uint32_t GetTripSteps() const {
step_t GetTripSteps() const {
return currentTripSteps;
}
@ -67,8 +69,8 @@ namespace Pinetime {
}
private:
uint32_t nbSteps = 0;
uint32_t currentTripSteps = 0;
step_t nbSteps = 0;
step_t currentTripSteps = 0;
TickType_t lastTime = 0;
TickType_t time = 0;