Hi all,
I have a strange compilation issue against the earlephilhower
core I can’t quite figure out…
Based on my first post: Status of "baremetal" Pico SDK as a PlatformIO framework I have gone on to create an initial version of a PlatformIO library targeting the native Raspberry Pico SDK (v1.4
) via a fork of the Wizio-Pico
baremetal
platform: GitHub - Tactory/Postman: Raspberry Pi Pico OS Task Manager
This builds in PIO and runs as expected on the Pico.
I am now continuing development of this Library in an implementation before finally publishing it, using this post: Arduino Library creation - #4 by maxgerhardt from @maxgerhardt including it in the implementation project via a Git submodule as suggested.
Compiling the implementation project, using the earlephilhower
core fails on a specific Pico SDK type absolute_time_t
that is defined in packages/framework-arduinopico/pico-sdk/src/common/pico_base/include/pico/types.h
The errors are:
error: could not convert '0' from 'int' to 'absolute_time_t'
24 | absolute_time_t timeout = 0;
| ^
| |
| int
error: no match for 'operator>' (operand types are 'absolute_time_t' and 'int')
116 | if(worker->timeout > 0){
| ~~~~~~~~~~~~~~~ ^ ~
| | |
| | int
| absolute_time_t
error: no match for 'operator=' (operand types are 'absolute_time_t' and 'int64_t' {aka 'long long int'})
117 | worker_timeout = absolute_time_diff_us(get_absolute_time(), worker->timeout);
Looking closer at pico/types.h
this is defined:
#ifdef NDEBUG
typedef uint64_t absolute_time_t;
#else
typedef struct {
uint64_t _private_us_since_boot;
} absolute_time_t;
#endif
When I build in the wizio-pico
framework NDEBUG
is defined, however building in the earlephilhower
core NDEBUG
is not defined. Remove the define below and this no longer compiles:
#define NDEBUG 1
#include <Arduino.h>
void setup() {
absolute_time_t timeout = 0;
}
void loop() {}
Is the earlephilhower
core compiling the Pico SDK with debug
enabled?
Explicitly adding build_flags = -DNDEBUG
to the implementation platform.ini
solves the issue