Skip to content

Commit 7a6489a

Browse files
committed
cc3200: Eliminate dependency on stm32's irq.h.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 49fa3ce commit 7a6489a

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

ports/cc3200/hal/cc3200_asm.h

+10-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@
3232
//
3333
// Note on IRQ state: you should not need to know the specific
3434
// value of the state variable, but rather just pass the return
35-
// value from disable_irq back to enable_irq. If you really need
36-
// to know the machine-specific values, see irq.h.
35+
// value from disable_irq back to enable_irq.
36+
37+
// these states correspond to values from query_irq, enable_irq and disable_irq
38+
#define IRQ_STATE_DISABLED (0x00000001)
39+
#define IRQ_STATE_ENABLED (0x00000000)
3740

3841
#ifndef __disable_irq
3942
#define __disable_irq() __asm__ volatile ("cpsid i");
@@ -79,6 +82,11 @@ static inline void __set_BASEPRI(uint32_t value) {
7982
__asm volatile ("msr basepri, %0" : : "r" (value) : "memory");
8083
}
8184

85+
__attribute__(( always_inline ))
86+
static inline uint32_t query_irq(void) {
87+
return __get_PRIMASK();
88+
}
89+
8290
__attribute__(( always_inline ))
8391
static inline void enable_irq(mp_uint_t state) {
8492
__set_PRIMASK(state);

ports/cc3200/hal/cc3200_hal.c

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#include "telnet.h"
5050
#include "pybuart.h"
5151
#include "utils.h"
52-
#include "irq.h"
5352

5453
#ifdef USE_FREERTOS
5554
#include "FreeRTOS.h"

ports/cc3200/mpthreadport.c

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "py/mphal.h"
3333
#include "mptask.h"
3434
#include "task.h"
35-
#include "irq.h"
3635

3736
#if MICROPY_PY_THREAD
3837

ports/cc3200/telnet/telnet.c

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include "debug.h"
3838
#include "serverstask.h"
3939
#include "genhdr/mpversion.h"
40-
#include "irq.h"
4140

4241
/******************************************************************************
4342
DEFINE PRIVATE CONSTANTS

0 commit comments

Comments
 (0)