Reset the step count every day at midnight.

This commit is contained in:
Jean-François Milants
2021-04-02 17:33:49 +02:00
parent 52a90288fd
commit 1d7576de64
7 changed files with 45 additions and 8 deletions

View File

@@ -105,3 +105,7 @@ Bma421::Values Bma421::Process() {
bool Bma421::IsOk() const {
return isOk;
}
void Bma421::ResetStepCounter() {
bma423_reset_step_counter(&bma);
}

View File

@@ -19,8 +19,8 @@ namespace Pinetime {
Bma421& operator=(Bma421&&) = delete;
void Init();
void Reset();
Values Process();
void ResetStepCounter();
void Read(uint8_t registerAddress, uint8_t *buffer, size_t size);
void Write(uint8_t registerAddress, const uint8_t *data, size_t size);
@@ -28,6 +28,8 @@ namespace Pinetime {
bool IsOk() const;
private:
void Reset();
TwiMaster& twiMaster;
uint8_t deviceAddress = 0x18;
struct bma4_dev bma;