AP_IOMCU: fixed crash with BRD_IO_ENABLE=0

This commit is contained in:
Andrew Tridgell 2018-01-13 13:33:28 +11:00
parent 2978649cd4
commit 320ada2002

View File

@ -444,7 +444,9 @@ void AP_IOMCU::print_debug(void)
// trigger an ioevent // trigger an ioevent
void AP_IOMCU::trigger_event(uint8_t event) void AP_IOMCU::trigger_event(uint8_t event)
{ {
chEvtSignal(thread_ctx, EVENT_MASK(event)); if (thread_ctx != nullptr) {
chEvtSignal(thread_ctx, EVENT_MASK(event));
}
} }
// get state of safety switch // get state of safety switch