HAL_AVR: catch atomic nesting errors
This commit is contained in:
parent
e57834d763
commit
1342a82ba7
@ -199,6 +199,10 @@ void AVRScheduler::begin_atomic() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AVRScheduler::end_atomic() {
|
void AVRScheduler::end_atomic() {
|
||||||
|
if (_nested_atomic_ctr == 0) {
|
||||||
|
hal.uartA->println_P(PSTR("ATOMIC NESTING ERROR"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
_nested_atomic_ctr--;
|
_nested_atomic_ctr--;
|
||||||
if (_nested_atomic_ctr == 0) {
|
if (_nested_atomic_ctr == 0) {
|
||||||
sei();
|
sei();
|
||||||
|
Loading…
Reference in New Issue
Block a user