0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

Know it's working by not unmasking interrupts

This commit is contained in:
bricky149 2023-10-28 19:42:26 +01:00
parent 5ba5a887a5
commit 071b0eee8c

8
main.c
View File

@ -242,10 +242,14 @@ void Main(void)
while (1)
{
if (!g_next_time_slice && !g_next_time_slice_500ms)
// Mask interrupts
__asm volatile ("cpsid i");
if (!g_next_time_slice)
// Idle condition, hint the MCU to sleep
// CMSIS suggests GCC reorders memory and is undesired
// CMSIS suggests GCC reorders memory and is undesirable
__asm volatile ("wfi":::"memory");
// Unmask interrupts
__asm volatile ("cpsie i");
APP_process();