mirror of
https://github.com/pelgraine/Meck.git
synced 2026-07-28 20:32:47 +02:00
T-Watch S3: fixed tilt raise bug.
Applied the same memw barrier + identical comment to twatchs3plusboard.cpp, hardening the Plus against the same latent race it was previously surviving only by luck
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
|
||||
volatile bool TWatchS3Board::_tilt_flag = false;
|
||||
|
||||
void IRAM_ATTR TWatchS3Board::onTiltISR() { _tilt_flag = true; }
|
||||
// memw forces the _tilt_flag store to retire to SRAM before this ISR
|
||||
// returns. Without it, tiltFired() in the main loop can read a stale
|
||||
// value and raise-to-wake is missed. Do not remove.
|
||||
void IRAM_ATTR TWatchS3Board::onTiltISR() { _tilt_flag = true; asm volatile("memw" ::: "memory"); }
|
||||
|
||||
// ---- Wrapper-free BMA423 step counter (raw I2C) ----------------------------
|
||||
// SensorLib's SensorBMA423 step-counter methods do not compile in this build,
|
||||
|
||||
@@ -80,4 +80,4 @@ public:
|
||||
const char* getManufacturerName() const override {
|
||||
return "LilyGo T-Watch S3";
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -5,7 +5,10 @@
|
||||
|
||||
volatile bool TWatchS3PlusBoard::_tilt_flag = false;
|
||||
|
||||
void IRAM_ATTR TWatchS3PlusBoard::onTiltISR() { _tilt_flag = true; }
|
||||
// memw forces the _tilt_flag store to retire to SRAM before this ISR
|
||||
// returns. Without it, tiltFired() in the main loop can read a stale
|
||||
// value and raise-to-wake is missed. Do not remove.
|
||||
void IRAM_ATTR TWatchS3PlusBoard::onTiltISR() { _tilt_flag = true; asm volatile("memw" ::: "memory"); }
|
||||
|
||||
// ---- Wrapper-free BMA423 step counter (raw I2C) ----------------------------
|
||||
// SensorLib's SensorBMA423 step-counter methods do not compile in this build,
|
||||
|
||||
Reference in New Issue
Block a user