CFLAGS += -Duseuart1 -Dapimote
endif
CFLAGS += -Duseuart1 -Dapimote
endif
+ifneq (,$(findstring $(board),goodthopter01))
+mcu ?= msp430f2274
+platform := goodfet
+config := monitor spi
+endif
+
ifneq (,$(findstring $(board),goodfet20 goodfet10 goodfet11))
mcu ?= msp430f1612
platform := goodfet
ifneq (,$(findstring $(board),goodfet20 goodfet10 goodfet11))
mcu ?= msp430f1612
platform := goodfet
unsigned char serial1_rx(){
char c;
unsigned char serial1_rx(){
char c;
while (!(UC1IFG&UCA1RXIFG)); // USCI_A1 TX buffer ready?
c = UCA1RXBUF;
UC1IFG&=~UCA1RXIFG;
while (!(UC1IFG&UCA1RXIFG)); // USCI_A1 TX buffer ready?
c = UCA1RXBUF;
UC1IFG&=~UCA1RXIFG;
}
//! Transmit a byte on the second UART.
void serial1_tx(unsigned char x){
}
//! Transmit a byte on the second UART.
void serial1_tx(unsigned char x){
while ((UC1IFG & UCA1TXIFG) == 0); //loop until buffer is free
UCA1TXBUF = x; /* send the character */
while(!(UC1IFG & UCA1TXIFG));
while ((UC1IFG & UCA1TXIFG) == 0); //loop until buffer is free
UCA1TXBUF = x; /* send the character */
while(!(UC1IFG & UCA1TXIFG));
-}
-
-//! Transmit a byte.
-void serial_tx_old(unsigned char x){
- while ((IFG2 & UCA0TXIFG) == 0); //loop until buffer is free
- UCA0TXBUF = x; /* send the character */
- while(!(IFG2 & UCA0TXIFG));
//! Set the baud rate of the second uart.
void setbaud1(unsigned char rate){
//! Set the baud rate of the second uart.
void setbaud1(unsigned char rate){
//Table 15-4, page 481 of 2xx Family Guide
switch(rate){
case 1://9600 baud
//Table 15-4, page 481 of 2xx Family Guide
switch(rate){
case 1://9600 baud
//Interrupt is handled by target code, not by bootloader.
//IE2 |= UCA0RXIE; //DO NOT UNCOMMENT
//Interrupt is handled by target code, not by bootloader.
//IE2 |= UCA0RXIE; //DO NOT UNCOMMENT
// Serial 1 on P3.6, 3.7
P3SEL |= 0xC0;
//UCA1CTL0 = 0x00;
// Serial 1 on P3.6, 3.7
P3SEL |= 0xC0;
//UCA1CTL0 = 0x00;
setbaud1(5); //115200
UCA1MCTL = 0;
UCA1CTL1 &= ~UCSWRST; // Initialize USCI state machine
setbaud1(5); //115200
UCA1MCTL = 0;
UCA1CTL1 &= ~UCSWRST; // Initialize USCI state machine