From 9ac4be8b759bb2cedeb999ce5e87d983261beded Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Thu, 8 Apr 2021 20:07:24 +0200 Subject: TwiMaster is now based on the NRFX TWI driver, as it handles more edge cases and workarounds for errors on the bus. Reset the TWI bus after the soft-reset of the motion sensor to workaround issues on the TWI bus. --- src/drivers/Bma421.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/drivers/Bma421.h') diff --git a/src/drivers/Bma421.h b/src/drivers/Bma421.h index d36d1db5..da021cbf 100644 --- a/src/drivers/Bma421.h +++ b/src/drivers/Bma421.h @@ -18,6 +18,9 @@ namespace Pinetime { Bma421(Bma421&&) = delete; Bma421& operator=(Bma421&&) = delete; + /// The chip freezes the TWI bus after the softreset operation. Softreset is separated from the + /// Init() method to allow the caller to uninit and then reinit the TWI device after the softreset. + void SoftReset(); void Init(); Values Process(); void ResetStepCounter(); @@ -34,6 +37,7 @@ namespace Pinetime { uint8_t deviceAddress = 0x18; struct bma4_dev bma; bool isOk = false; + bool isResetOk = false; }; } } \ No newline at end of file -- cgit v1.2.3-70-g09d2