maxgerhardt / platform-raspberrypi

Raspberry Pi: development platform for PlatformIO
Apache License 2.0
94 stars 46 forks source link

error: 'alarm_pool_get_default' was not declared in this scope; #45

Closed rondlh closed 2 months ago

rondlh commented 7 months ago

I'm playing around with the alarm_pools on a Pico, but the command "alarm_pool_get_default()" seems to be missing.

main.cpp

#include <Arduino.h>
alarm_pool_t* HAL_timer_pool_0;
alarm_pool_t* HAL_timer_pool_1;
alarm_pool_t* HAL_timer_pool_2;
alarm_pool_t* HAL_timer_pool_3;

setup() {
  HAL_timer_pool_0 = alarm_pool_create(0, 6);
  HAL_timer_pool_1 = alarm_pool_create(1, 6);
  HAL_timer_pool_2 = alarm_pool_create(2, 6);
  HAL_timer_pool_3 = alarm_pool_get_default();
}

loop() {
}

platformio.ini

[env]
platform = raspberrypi
framework = arduino
[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico

Any solutions?

maxgerhardt commented 2 months ago

You don't set the special flags or the right board defnition to use the Arduino-Pico core, so you'll be using th ArduinoCore-mbed. Which wouldn't need my fork of the raspberrypi platform at all.

So if it compiles in Arduino-Pico, just use board = rpipico instead, or see https://arduino-pico.readthedocs.io/en/latest/platformio.html#examples