41 #include "dev/uart1.h"
42 #include "dev/watchdog.h"
45 #include "isr_compat.h"
47 static int (*uart1_input_handler)(
unsigned char c);
49 static volatile uint8_t transmitting;
55 return (UCA1STAT & UCBUSY) | transmitting;
59 uart1_set_input(
int (*input)(
unsigned char c))
61 uart1_input_handler = input;
65 uart1_writeb(
unsigned char c)
69 while((UCA1STAT & UCBUSY));
106 UCA1CTL1 &= ~UCSWRST;
110 ISR(USCI_A1, uart1_rx_interrupt)
114 ENERGEST_ON(ENERGEST_TYPE_IRQ);
117 if(UCA1STAT & UCRXERR) {
121 if(uart1_input_handler !=
NULL) {
122 if(uart1_input_handler(c)) {
128 ENERGEST_OFF(ENERGEST_TYPE_IRQ);
void uart1_init(unsigned long ubr)
Initalize the RS232 port.
Header file for the ring buffer library
#define NULL
The null pointer.
Header file for the energy estimation mechanism
void watchdog_periodic(void)
Writes the WDT clear sequence.