diff options
author | Dave Hylands <dhylands@gmail.com> | 2014-08-24 12:21:12 -0700 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-08-25 12:22:11 +0100 |
commit | 9480138f0c917b2400991066e94636f7d8076a4c (patch) | |
tree | d934be3cfd588ec510988371d0d8c891b48db6d3 /stmhal/modpyb.c | |
parent | 7310fd469a4dfdd38fda242f138f5671c2f82b61 (diff) | |
download | micropython-9480138f0c917b2400991066e94636f7d8076a4c.tar.gz micropython-9480138f0c917b2400991066e94636f7d8076a4c.zip |
Add save/restore_irq
Factored irq functions into a separate file.
Diffstat (limited to 'stmhal/modpyb.c')
-rw-r--r-- | stmhal/modpyb.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c index a075cf2c32..de7eac4024 100644 --- a/stmhal/modpyb.c +++ b/stmhal/modpyb.c @@ -36,6 +36,7 @@ #include "obj.h" #include "gc.h" #include "gccollect.h" +#include "irq.h" #include "systick.h" #include "pyexec.h" #include "led.h" @@ -216,32 +217,6 @@ STATIC mp_obj_t pyb_udelay(mp_obj_t usec_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_udelay_obj, pyb_udelay); -/// \function wfi() -/// Wait for an interrupt. -/// This executies a `wfi` instruction which reduces power consumption -/// of the MCU until an interrupt occurs, at which point execution continues. -STATIC mp_obj_t pyb_wfi(void) { - __WFI(); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_0(pyb_wfi_obj, pyb_wfi); - -/// \function disable_irq() -/// Disable interrupt requests. -STATIC mp_obj_t pyb_disable_irq(void) { - __disable_irq(); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_0(pyb_disable_irq_obj, pyb_disable_irq); - -/// \function enable_irq() -/// Enable interrupt requests. -STATIC mp_obj_t pyb_enable_irq(void) { - __enable_irq(); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_0(pyb_enable_irq_obj, pyb_enable_irq); - #if 0 STATIC void SYSCLKConfig_STOP(void) { /* After wake-up from STOP reconfigure the system clock */ |