Skip to content

Commit 08386a6

Browse files
Copilotdorkmo
andcommitted
Fix build error: use fully qualified namespaces for ThisThread and chrono
Co-authored-by: dorkmo <[email protected]>
1 parent 37d844c commit 08386a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

TankAlarm-112025-Client-BluesOpta/TankAlarm-112025-Client-BluesOpta.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <BlockDevice.h>
4747
#include <mbed.h>
4848
using namespace mbed;
49+
using namespace std::chrono; // For chrono types (e.g., milliseconds)
4950
using namespace std::chrono_literals; // For chrono duration literals (e.g., 100ms)
5051
#define FILESYSTEM_AVAILABLE
5152
#define WATCHDOG_AVAILABLE
@@ -673,7 +674,7 @@ void loop() {
673674
// Sleep to reduce power consumption between loop iterations
674675
// Use Mbed OS thread sleep for power efficiency - allows CPU to enter low-power states during sleep periods
675676
#if defined(ARDUINO_OPTA) || defined(ARDUINO_ARCH_MBED)
676-
ThisThread::sleep_for(100ms); // Thread sleep for 100ms - enables power saving
677+
mbed::ThisThread::sleep_for(std::chrono::milliseconds(100)); // Thread sleep for 100ms - enables power saving
677678
#else
678679
delay(100); // Fallback for non-Mbed platforms
679680
#endif

0 commit comments

Comments
 (0)