AP_Notify: example: do not instantiate AP_BoardLED unless the board supports it

This commit is contained in:
Peter Barker 2024-07-09 20:39:20 +10:00 committed by Peter Barker
parent 71332dd039
commit f4f79905cc
1 changed files with 4 additions and 0 deletions

View File

@ -12,15 +12,19 @@ void loop();
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
#if AP_NOTIFY_GPIO_LED_3_ENABLED
// create board led object
AP_BoardLED board_led;
#endif
void setup()
{
hal.console->printf("AP_Notify library test\n");
#if AP_NOTIFY_GPIO_LED_3_ENABLED
// initialise the board leds
board_led.init();
#endif
// turn on initialising notification
AP_Notify::flags.initialising = true;