Skip to content

Commit

Permalink
Remove hardware dependence in portmacros.h
Browse files Browse the repository at this point in the history
The IAR MSP430X port `#include "msp430.h"` which pulls all the hardware
register definitions into anything which `#include "FreeRTOS.h"`.  This
removes that hardware dependency "leak" by removing the header file
and re-defining the `portDISABLE_INTERRUPTS()` and
`portENABLE_INTERRUPTS()` macros in terms of `__asm`.
  • Loading branch information
mayl committed Aug 6, 2024
1 parent 53c7e7c commit 7efc615
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions portable/IAR/MSP430X/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
*-----------------------------------------------------------
*/

/* Hardware includes. */
#include "msp430.h"

/* Type definitions. */
#define portCHAR char
#define portFLOAT float
Expand Down Expand Up @@ -75,8 +72,8 @@ typedef unsigned short UBaseType_t;
/*-----------------------------------------------------------*/

/* Interrupt control macros. */
#define portDISABLE_INTERRUPTS() _DINT(); _NOP()
#define portENABLE_INTERRUPTS() _EINT(); _NOP()
#define portDISABLE_INTERRUPTS() __asm volatile ( "DINT\n" "NOP")
#define portENABLE_INTERRUPTS() __asm volatile ( "EINT\n" "NOP")
/*-----------------------------------------------------------*/

/* Critical section control macros. */
Expand Down

0 comments on commit 7efc615

Please sign in to comment.