AP_HAL_ChibiOS: add cork()/push() check

This commit is contained in:
Andy Piper 2024-11-13 13:30:29 +00:00 committed by Andrew Tridgell
parent 4b0fa15278
commit 277386e6e2
1 changed files with 6 additions and 0 deletions

View File

@ -1329,6 +1329,9 @@ bool RCOutput::get_output_mode_banner(char banner_msg[], uint8_t banner_msg_len)
*/ */
void RCOutput::cork(void) void RCOutput::cork(void)
{ {
if (corked) {
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
}
corked = true; corked = true;
#if HAL_WITH_IO_MCU #if HAL_WITH_IO_MCU
if (iomcu_enabled) { if (iomcu_enabled) {
@ -1342,6 +1345,9 @@ void RCOutput::cork(void)
*/ */
void RCOutput::push(void) void RCOutput::push(void)
{ {
if (!corked) {
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
}
corked = false; corked = false;
push_local(); push_local();
#if HAL_WITH_IO_MCU #if HAL_WITH_IO_MCU