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

View File

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