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(); +