From 1fc772392f03e3dcad792c78393c21922dd6817c Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Fri, 16 Aug 2024 15:48:39 +0530 Subject: [PATCH] Code review suggestions Signed-off-by: Gaurav Aggarwal --- portable/CCS/MSP430X/port.c | 3 +++ portable/CCS/MSP430X/portmacro.h | 9 +++------ portable/IAR/MSP430X/portmacro.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/portable/CCS/MSP430X/port.c b/portable/CCS/MSP430X/port.c index 186fb2cdd..2097a2931 100644 --- a/portable/CCS/MSP430X/port.c +++ b/portable/CCS/MSP430X/port.c @@ -26,6 +26,9 @@ * */ +/* Hardware includes. */ +#include "msp430.h" + /* Scheduler includes. */ #include "FreeRTOS.h" #include "task.h" diff --git a/portable/CCS/MSP430X/portmacro.h b/portable/CCS/MSP430X/portmacro.h index 91e2b9c5b..c00c5a902 100644 --- a/portable/CCS/MSP430X/portmacro.h +++ b/portable/CCS/MSP430X/portmacro.h @@ -39,9 +39,6 @@ *----------------------------------------------------------- */ -/* Hardware includes. */ -#include "msp430.h" - /* Type definitions. */ #define portCHAR char #define portFLOAT float @@ -75,8 +72,8 @@ typedef unsigned short UBaseType_t; /*-----------------------------------------------------------*/ /* Interrupt control macros. */ -#define portDISABLE_INTERRUPTS() _disable_interrupt(); _nop() -#define portENABLE_INTERRUPTS() _enable_interrupt(); _nop() +#define portDISABLE_INTERRUPTS() __asm volatile ( " DINT\n" " NOP" ) +#define portENABLE_INTERRUPTS() __asm volatile ( " NOP\n" " EINT\n" " NOP" ) /*-----------------------------------------------------------*/ /* Critical section control macros. */ @@ -126,7 +123,7 @@ extern void vPortYield( void ); #define portBYTE_ALIGNMENT 2 #define portSTACK_GROWTH ( -1 ) #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) -#define portNOP() __no_operation() +#define portNOP() __asm volatile ( " NOP" ) /*-----------------------------------------------------------*/ /* Task function macros as described on the FreeRTOS.org WEB site. */ diff --git a/portable/IAR/MSP430X/portmacro.h b/portable/IAR/MSP430X/portmacro.h index 9d0dcc111..b428f8d40 100644 --- a/portable/IAR/MSP430X/portmacro.h +++ b/portable/IAR/MSP430X/portmacro.h @@ -73,7 +73,7 @@ typedef unsigned short UBaseType_t; /* Interrupt control macros. */ #define portDISABLE_INTERRUPTS() __asm volatile ( "DINT\n" "NOP" ) -#define portENABLE_INTERRUPTS() __asm volatile ( "EINT\n" "NOP" ) +#define portENABLE_INTERRUPTS() __asm volatile ( "NOP\n" "EINT\n" "NOP" ) /*-----------------------------------------------------------*/ /* Critical section control macros. */ @@ -123,7 +123,7 @@ extern void vPortYield( void ); #define portBYTE_ALIGNMENT 2 #define portSTACK_GROWTH ( -1 ) #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) -#define portNOP() __asm volatile ( "NOP" ) +#define portNOP() __asm volatile ( "NOP" ) /*-----------------------------------------------------------*/ /* Task function macros as described on the FreeRTOS.org WEB site. */