MCU specific sleep feature is now defined in MCU specific file.

This commit is contained in:
NIIBE Yutaka
2017-11-17 11:43:05 +09:00
parent 66b4eb3058
commit 44054415c8
9 changed files with 156 additions and 120 deletions

23
mcu/chx-mkl27z.c Normal file
View File

@@ -0,0 +1,23 @@
extern int chx_allow_sleep;
void
chx_sleep_mode (int enable_sleep)
{
(void)enable_sleep;
}
void __attribute__((naked))
chx_idle (void)
{
int sleep_enabled;
for (;;)
{
asm ("ldr %0, %1" : "=r" (sleep_enabled): "m" (chx_allow_sleep));
if (sleep_enabled)
{
asm volatile ("wfi" : : : "memory");
/* NOTE: it never comes here. Don't add lines after this. */
}
}
}