Search the Community
Showing results for tags 'macro'.
-
In my project, I use a few basic macros for GPIO. The goal is, that I can easily redefine pin assignment in a central location without compromising performance or code size. The macros (gpiomacros.h): // MSP430 gpio macros #define GPIO_SEL(port) P ## port ## SEL #define GPIO_DIR(port) P ## port ## DIR #define GPIO_OUT(port) P ## port ## OUT #define GPIO_IN(port) P ## port ## IN #define GPIO_IS_INPUT(port,pin) { GPIO_SEL(port) &= ~(pin); GPIO_DIR(port) &= ~(pin); } #define GPIO_IS_OUTPUT(port,pin) { GPIO_SEL(port) &= ~(pin); GPIO_DIR(port) |= (pin); } #define GPIO_IS_PERIPHER
-
Hello, I am new to the MSP430 Launchpad and am trying to get familiar with CCS5 and the MS430. I am trying to use macros to control the watch dog timer but I can't seem to get it working. The code builds fine but when it gets run it gets hung up and won't give me any kind of error until I pause. The error is as follows: Can't find a source file at "/tmp/TI_MKLIBTw7SkT/SRC/autoinit.c" Though, I am able to get it working if I set all the bits at once. See below for examples. This does not work.... #define wdt_password_set() ( WDTCTL |= WDTPW ) #define wdt_mode_inte