mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 07:28:29 -04:00
AP_Radio: prevent crash if cc2500 device not found
This commit is contained in:
parent
9f53ae1ea4
commit
907728e323
@ -155,7 +155,7 @@ public:
|
|||||||
bool Reset(void);
|
bool Reset(void);
|
||||||
|
|
||||||
bool lock_bus(void) {
|
bool lock_bus(void) {
|
||||||
return dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER);
|
return dev && dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER);
|
||||||
}
|
}
|
||||||
void unlock_bus(void) {
|
void unlock_bus(void) {
|
||||||
dev->get_semaphore()->give();
|
dev->get_semaphore()->give();
|
||||||
|
Loading…
Reference in New Issue
Block a user