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:
pelgraine
2026-07-16 19:00:38 +10:00
parent 6192e31d91
commit a436beb9d1
3 changed files with 9 additions and 3 deletions
+4 -1
View File
@@ -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,
+1 -1
View File
@@ -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,