mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
added interrupt handler for UART1 (->uart0 & stdin) to MSB-430(h)
This commit is contained in:
parent
cb2ea424fc
commit
d89940624d
@ -55,8 +55,8 @@ static void msb_ports_init(void)
|
||||
// 0 - P2.7 [IN ] - SD-KARTE Detect
|
||||
|
||||
P3SEL = 0xC0; // Port3 Zweitfunktion
|
||||
P3OUT = 0x09; // Port3 Ausgangsregister: 00001001 = 0x09
|
||||
P3DIR = 0x2B; // Port3 Direction
|
||||
P3OUT = 0x49; // Port3 Ausgangsregister: 00001001 = 0x09
|
||||
P3DIR = 0xAB; // Port3 Direction
|
||||
// 1 - P3.0
|
||||
// 1 - P3.1
|
||||
// 0 - P3.2
|
||||
@ -119,7 +119,10 @@ void msp430_set_cpu_speed(uint32_t speed)
|
||||
UBR11 = br >> 8;
|
||||
UMCTL1 = calc_umctl(br); // set modulation
|
||||
|
||||
ME2 |= (UTXE1 | URXE1);
|
||||
UCTL1 &= ~SWRST;
|
||||
|
||||
IE2 |= URXIE1;
|
||||
//clock_init();
|
||||
eint();
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
#include "board.h"
|
||||
|
||||
#define UART1_TX TXBUF1
|
||||
#define UART1_TX TXBUF1
|
||||
#define UART1_WAIT_TXDONE() while( (UTCTL1 & TXEPT) == 0 ) { _NOP(); }
|
||||
|
||||
#include <stdio.h>
|
||||
#include <kernel.h>
|
||||
|
||||
#include <board_uart0.h>
|
||||
|
||||
int putchar(int c)
|
||||
{
|
||||
@ -11,11 +14,44 @@ int putchar(int c)
|
||||
UART1_WAIT_TXDONE();
|
||||
|
||||
if (c == 10) {
|
||||
UART1_TX = 13;
|
||||
UART1_WAIT_TXDONE();
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
void usart0irq(void);
|
||||
/**
|
||||
* \brief the interrupt function
|
||||
*/
|
||||
interrupt(USART1RX_VECTOR) usart0irq(void)
|
||||
{
|
||||
U1TCTL &= ~URXSE; /* Clear the URXS signal */
|
||||
U1TCTL |= URXSE; /* Re-enable URXS - needed here?*/
|
||||
int c = 0;
|
||||
/* Check status register for receive errors. */
|
||||
if(U1RCTL & RXERR) {
|
||||
if (U1RCTL & FE) {
|
||||
puts("rx framing error");
|
||||
}
|
||||
if (U1RCTL & OE) {
|
||||
puts("rx overrun error");
|
||||
}
|
||||
if (U1RCTL & PE) {
|
||||
puts("rx parity error");
|
||||
}
|
||||
if (U1RCTL & BRK) {
|
||||
puts("rx break error");
|
||||
}
|
||||
/* Clear error flags by forcing a dummy read. */
|
||||
c = U1RXBUF;
|
||||
}
|
||||
#ifdef MODULE_UART0
|
||||
else if (uart0_handler_pid) {
|
||||
c = U1RXBUF;
|
||||
uart0_handle_incoming(c);
|
||||
uart0_notify_thread();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
export INCLUDES += -I$(RIOTBOARD)/msb-430h/include -I$(RIOTBOARD)/msb-430-common/include
|
||||
include $(RIOTBOARD)/$(BOARD)/Makefile.dep
|
||||
|
||||
include $(RIOTBOARD)/msb-430-common/Makefile.include
|
||||
|
@ -337,8 +337,6 @@ void cc110x_spi_init(uint8_t clockrate)
|
||||
interrupt(PORT2_VECTOR) __attribute__((naked)) cc110x_isr(void)
|
||||
{
|
||||
__enter_isr();
|
||||
puts("cc110x_isr()");
|
||||
|
||||
// if (system_state.POWERDOWN) SPI_INIT; /* Initialize SPI after wakeup */
|
||||
/* Check IFG */
|
||||
if ((P2IFG & 0x01) != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user