mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 22:31:25 +03:00
sleep option
This commit is contained in:
parent
059436fdf1
commit
daa3d298cd
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
18
main.c
18
main.c
@ -242,14 +242,16 @@ void Main(void)
|
||||
|
||||
while (1)
|
||||
{
|
||||
// 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 undesirable
|
||||
__asm volatile ("wfi":::"memory");
|
||||
// Unmask interrupts
|
||||
__asm volatile ("cpsie i");
|
||||
#if 0
|
||||
// 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 undesirable
|
||||
__asm volatile ("wfi":::"memory");
|
||||
// Unmask interrupts
|
||||
__asm volatile ("cpsie i");
|
||||
#endif
|
||||
|
||||
APP_process();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user