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.
15 lines
326 B
15 lines
326 B
#include "main.h"
|
|
static uint8_t g_port_exit_critical_count;
|
|
|
|
void chip_critical_enter(void) {
|
|
if (g_port_exit_critical_count == 0) {
|
|
__disable_irq();
|
|
}
|
|
g_port_exit_critical_count++;
|
|
}
|
|
void chip_critical_exit(void) {
|
|
g_port_exit_critical_count--;
|
|
if (g_port_exit_critical_count == 0) {
|
|
__enable_irq();
|
|
}
|
|
}
|