Commit 7a6489aa authored by Damien George's avatar Damien George

cc3200: Eliminate dependency on stm32's irq.h.

Signed-off-by: default avatarDamien George <damien@micropython.org>
parent 49fa3ce6
......@@ -32,8 +32,11 @@
//
// Note on IRQ state: you should not need to know the specific
// value of the state variable, but rather just pass the return
// value from disable_irq back to enable_irq. If you really need
// to know the machine-specific values, see irq.h.
// value from disable_irq back to enable_irq.
// these states correspond to values from query_irq, enable_irq and disable_irq
#define IRQ_STATE_DISABLED (0x00000001)
#define IRQ_STATE_ENABLED (0x00000000)
#ifndef __disable_irq
#define __disable_irq() __asm__ volatile ("cpsid i");
......@@ -79,6 +82,11 @@ static inline void __set_BASEPRI(uint32_t value) {
__asm volatile ("msr basepri, %0" : : "r" (value) : "memory");
}
__attribute__(( always_inline ))
static inline uint32_t query_irq(void) {
return __get_PRIMASK();
}
__attribute__(( always_inline ))
static inline void enable_irq(mp_uint_t state) {
__set_PRIMASK(state);
......
......@@ -49,7 +49,6 @@
#include "telnet.h"
#include "pybuart.h"
#include "utils.h"
#include "irq.h"
#ifdef USE_FREERTOS
#include "FreeRTOS.h"
......
......@@ -32,7 +32,6 @@
#include "py/mphal.h"
#include "mptask.h"
#include "task.h"
#include "irq.h"
#if MICROPY_PY_THREAD
......
......@@ -37,7 +37,6 @@
#include "debug.h"
#include "serverstask.h"
#include "genhdr/mpversion.h"
#include "irq.h"
/******************************************************************************
DEFINE PRIVATE CONSTANTS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment