AP_HAL_PX4: added IRQ save/restore to hal.scheduler
these are used by RPM driver
This commit is contained in:
parent
51c40a013b
commit
9942934f0d
@ -457,4 +457,23 @@ void PX4Scheduler::system_initialized()
|
|||||||
_initialized = true;
|
_initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
disable interrupts and return a context that can be used to
|
||||||
|
restore the interrupt state. This can be used to protect
|
||||||
|
critical regions
|
||||||
|
*/
|
||||||
|
void *PX4Scheduler::disable_interrupts_save(void)
|
||||||
|
{
|
||||||
|
return (void *)(uintptr_t)irqsave();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
restore interrupt state from disable_interrupts_save()
|
||||||
|
*/
|
||||||
|
void PX4Scheduler::restore_interrupts(void *state)
|
||||||
|
{
|
||||||
|
irqrestore((irqstate_t)(uintptr_t)state);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -64,6 +64,18 @@ public:
|
|||||||
|
|
||||||
void create_uavcan_thread() override;
|
void create_uavcan_thread() override;
|
||||||
|
|
||||||
|
/*
|
||||||
|
disable interrupts and return a context that can be used to
|
||||||
|
restore the interrupt state. This can be used to protect
|
||||||
|
critical regions
|
||||||
|
*/
|
||||||
|
void *disable_interrupts_save(void) override;
|
||||||
|
|
||||||
|
/*
|
||||||
|
restore interrupt state from disable_interrupts_save()
|
||||||
|
*/
|
||||||
|
void restore_interrupts(void *) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _initialized;
|
bool _initialized;
|
||||||
volatile bool _hal_initialized;
|
volatile bool _hal_initialized;
|
||||||
|
Loading…
Reference in New Issue
Block a user