Skip to content

Commit a10dafd

Browse files
rajkan01kjbracey
authored andcommitted
Fix the CI build issue
1 parent c71c980 commit a10dafd

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

drivers/LowPowerClock.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define MBED_LOWPOWERCLOCK_H
1919

2020
#include <chrono>
21+
#if DEVICE_LPTICKER
2122
#include "hal/lp_ticker_api.h"
2223

2324
namespace mbed {
@@ -63,4 +64,5 @@ class LowPowerClock {
6364
/** @}*/
6465

6566
}
67+
#endif /* DEVICE_LPTICKER */
6668
#endif /* MBED_LOWPOWERCLOCK_H */

drivers/source/Timeout.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Timeout::Timeout() : TimeoutBase(get_us_ticker_data(), true)
4444
* (In C++17 could avoid the need for this by making the members inline).
4545
*/
4646
const bool HighResClock::is_steady;
47+
#if DEVICE_LPTICKER
4748
const bool LowPowerClock::is_steady;
49+
#endif
4850
const bool RealTimeClock::is_steady;
4951

5052
#if DEVICE_LPTICKER

platform/mbed_chrono.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ inline namespace chrono_literals {
8585
constexpr chrono::deciseconds operator "" _ds(unsigned long long x)
8686
{
8787
chrono::deciseconds::rep val = static_cast<chrono::deciseconds::rep>(x);
88-
assert(val >= 0 && static_cast<unsigned long long>(val) == x);
88+
if (val < 0) {
89+
assert(false);
90+
}
91+
assert(static_cast<unsigned long long>(val) == x);
8992
return chrono::deciseconds(val);
9093
}
9194

@@ -103,7 +106,10 @@ constexpr chrono::deciseconds operator "" _ds(unsigned long long x)
103106
constexpr chrono::centiseconds operator "" _cs(unsigned long long x)
104107
{
105108
chrono::centiseconds::rep val = static_cast<chrono::centiseconds::rep>(x);
106-
assert(val >= 0 && static_cast<unsigned long long>(val) == x);
109+
if (val < 0) {
110+
assert(false);
111+
}
112+
assert(static_cast<unsigned long long>(val) == x);
107113
return chrono::centiseconds(val);
108114
}
109115

0 commit comments

Comments
 (0)