You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
362 B
19 lines
362 B
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
|
|
uint8_t g_port_exit_critical_count;
|
|
|
|
void sys_critical_enter(void) {
|
|
if (g_port_exit_critical_count == 0) {
|
|
__disable_irq();
|
|
}
|
|
g_port_exit_critical_count++;
|
|
}
|
|
void sys_critical_exit(void) {
|
|
g_port_exit_critical_count--;
|
|
if (g_port_exit_critical_count == 0) {
|
|
__enable_irq();
|
|
}
|
|
}
|