From 8a035590cd469d148f155cc041f2d23d43100a64 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 19 Aug 2022 11:56:22 +1000 Subject: [PATCH] AP_FlashIface: fix examples --- .../examples/jedec_test/jedec_test.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libraries/AP_FlashIface/examples/jedec_test/jedec_test.cpp b/libraries/AP_FlashIface/examples/jedec_test/jedec_test.cpp index bb7e6544c4..ae0723b399 100644 --- a/libraries/AP_FlashIface/examples/jedec_test/jedec_test.cpp +++ b/libraries/AP_FlashIface/examples/jedec_test/jedec_test.cpp @@ -1,4 +1,20 @@ #include + +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX + +const AP_HAL::HAL& hal = AP_HAL::get_HAL(); +void setup() { } + +void loop() +{ + // the library simply panics if a JEDEC device can't be found. We + // can't really recover from that. + hal.console->printf("No JEDEC on linux\n"); + hal.scheduler->delay(1000); +} + +#else + #include #include #include @@ -184,4 +200,7 @@ void loop() hal.scheduler->delay(1000); } +#endif + AP_HAL_MAIN(); +