Small fixes (#260)

* pico_stdio_usb: be more explicit about includes, fix warning (#257)

* pico_base: NDEBUG backwards for absolute_time_t (#255)

* pico_util: missing extern C in queue.h (#249)

* build: remove -march which was masking -mcpu, now SVC available (#253)
This commit is contained in:
Graham Sanderson
2021-03-17 13:05:48 -05:00
committed by GitHub
parent d36b1ca8ae
commit fe3408b286
6 changed files with 21 additions and 9 deletions

View File

@ -25,7 +25,7 @@ typedef unsigned int uint;
\see update_us_since_boot()
\ingroup timestamp
*/
#ifndef NDEBUG
#ifdef NDEBUG
typedef uint64_t absolute_time_t;
#else
typedef struct {
@ -40,7 +40,7 @@ typedef struct {
* \ingroup timestamp
*/
static inline uint64_t to_us_since_boot(absolute_time_t t) {
#ifndef NDEBUG
#ifdef NDEBUG
return t;
#else
return t._private_us_since_boot;
@ -55,7 +55,7 @@ static inline uint64_t to_us_since_boot(absolute_time_t t) {
* \ingroup timestamp
*/
static inline void update_us_since_boot(absolute_time_t *t, uint64_t us_since_boot) {
#ifndef NDEBUG
#ifdef NDEBUG
*t = us_since_boot;
#else
assert(us_since_boot <= INT64_MAX);
@ -63,7 +63,7 @@ static inline void update_us_since_boot(absolute_time_t *t, uint64_t us_since_bo
#endif
}
#ifndef NDEBUG
#ifdef NDEBUG
#define ABSOLUTE_TIME_INITIALIZED_VAR(name, value) name = value
#else
#define ABSOLUTE_TIME_INITIALIZED_VAR(name, value) name = {value}