Hi folks! Trying to play with the new GCC 4.8 included with CCSv6 beta, and I'm having some issues with interrupts. If this is something not yet "stable" or implemented let me know...
Current objective is to produce a small program that blinks an LED on the Wolverine LaunchPad via the WDT in interval mode, and for that I'm using:
/*
* main.c
*/
#include <msp430.h>
int main(void) {
WDTCTL = WDTPW | WDTHOLD;
// GPIO Setup
P1OUT = 0;
P1DIR = 0xFF;
P2OUT = 0;
P2DIR = 0xFF;
P3OUT = 0;
P3DIR = 0xFF;
P4OUT = 0;
P4DIR = 0xFF;
PJOUT = 0;
PJSEL0 = BIT4 | BIT5; // For XT1
PJDIR = 0xFFFF;
// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
// Clock System Setup
CSCTL0_H = CSKEY >> 8; // Unlock CS registers
CSCTL1 = DCOFSEL_6; // Set DCO to 8MHz
CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers
CSCTL4 &= ~LFXTOFF; // Enable LFXT1
do
{
CSCTL5 &= ~LFXTOFFG; // Clear XT1 fault flag
SFRIFG1 &= ~OFIFG;
} while (SFRIFG1&OFIFG); // Test oscillator fault flag
CSCTL0_H = 0; // Lock CS registers
WDTCTL = WDT_ADLY_250;
while (1) {
__delay_cycles(4000000);
}
return 0;
}
void __attribute__((interrupt(WDT_VECTOR))) WDT_ISR(void)
{
P4OUT ^= BIT6;
}
So while the main() routine generally works as I've tested the P4OUT ^= BIT6; inside that while(1) loop, when trying to declare my WDT ISR I get the following warning from the compiler:
../main.c:54:1: warning: numeric argument of 'interrupt' attribute must be in range 0..31 [-Wattributes]
From what I gather, WDT_VECTOR is defined as (50) in msp430fr5969.h, and there is a definition for __interrupt_vector_50 in the linker script:
__interrupt_vector_50 : { KEEP (*(__interrupt_vector_50)) KEEP (*(__interrupt_vector_wdt)) } > VECT50
with VECT50 defined higher up in the linker script as:
VECT50 : ORIGIN = 0xFFF2, LENGTH = 0x0002
So I'm not sure what's going on here. Incomplete implementation for the higher-end chips perhaps?