mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
ports: Move definitions of ATOMIC_SECTION macros to mphalport.h.
Also move MICROPY_PY_PENDSV_ENTER/REENTER/EXIT to mphalport.h, for ports where these are not already there. This helps separate the hardware implementation of these macros from the MicroPython configuration (eg for renesas-ra and stm32, the IRQ static inline helper functions can now be moved to irq.h). Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -30,6 +30,10 @@
|
||||
#include "hal/utils.h"
|
||||
#include "hal/systick.h"
|
||||
|
||||
// assembly functions to handle critical sections, interrupt
|
||||
// disabling/enabling and sleep mode enter/exit
|
||||
#include "cc3200_asm.h"
|
||||
|
||||
/******************************************************************************
|
||||
DEFINE CONSTANTS
|
||||
******************************************************************************/
|
||||
@@ -55,6 +59,9 @@
|
||||
" isb \n"); \
|
||||
}
|
||||
|
||||
#define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq()
|
||||
#define MICROPY_END_ATOMIC_SECTION(state) enable_irq(state)
|
||||
|
||||
/******************************************************************************
|
||||
DECLARE PUBLIC FUNCTIONS
|
||||
******************************************************************************/
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "py/mpconfig.h"
|
||||
#include "py/mphal.h"
|
||||
#include "py/obj.h"
|
||||
#include "py/runtime.h"
|
||||
#include "py/mperrno.h"
|
||||
|
||||
@@ -161,14 +161,8 @@ typedef int32_t mp_int_t; // must be pointer size
|
||||
typedef unsigned int mp_uint_t; // must be pointer size
|
||||
typedef long mp_off_t;
|
||||
|
||||
#define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq()
|
||||
#define MICROPY_END_ATOMIC_SECTION(state) enable_irq(state)
|
||||
#define MICROPY_EVENT_POLL_HOOK __WFI();
|
||||
|
||||
// assembly functions to handle critical sections, interrupt
|
||||
// disabling/enabling and sleep mode enter/exit
|
||||
#include "cc3200_asm.h"
|
||||
|
||||
// We need to provide a declaration/definition of alloca()
|
||||
#include <alloca.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user