Fix the CI build issue

pull/12425/head
Rajkumar Kanagaraj 2020-03-25 15:44:54 +00:00 committed by Kevin Bracey
parent c71c980ccd
commit a10dafdda8
3 changed files with 12 additions and 2 deletions

View File

@ -18,6 +18,7 @@
#define MBED_LOWPOWERCLOCK_H
#include <chrono>
#if DEVICE_LPTICKER
#include "hal/lp_ticker_api.h"
namespace mbed {
@ -63,4 +64,5 @@ public:
/** @}*/
}
#endif /* DEVICE_LPTICKER */
#endif /* MBED_LOWPOWERCLOCK_H */

View File

@ -44,7 +44,9 @@ Timeout::Timeout() : TimeoutBase(get_us_ticker_data(), true)
* (In C++17 could avoid the need for this by making the members inline).
*/
const bool HighResClock::is_steady;
#if DEVICE_LPTICKER
const bool LowPowerClock::is_steady;
#endif
const bool RealTimeClock::is_steady;
#if DEVICE_LPTICKER

View File

@ -85,7 +85,10 @@ inline namespace chrono_literals {
constexpr chrono::deciseconds operator "" _ds(unsigned long long x)
{
chrono::deciseconds::rep val = static_cast<chrono::deciseconds::rep>(x);
assert(val >= 0 && static_cast<unsigned long long>(val) == x);
if (val < 0) {
assert(false);
}
assert(static_cast<unsigned long long>(val) == x);
return chrono::deciseconds(val);
}
@ -103,7 +106,10 @@ constexpr chrono::deciseconds operator "" _ds(unsigned long long x)
constexpr chrono::centiseconds operator "" _cs(unsigned long long x)
{
chrono::centiseconds::rep val = static_cast<chrono::centiseconds::rep>(x);
assert(val >= 0 && static_cast<unsigned long long>(val) == x);
if (val < 0) {
assert(false);
}
assert(static_cast<unsigned long long>(val) == x);
return chrono::centiseconds(val);
}