summaryrefslogtreecommitdiff
path: root/src/arch/msp430fr5969lp/driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/msp430fr5969lp/driver')
-rw-r--r--src/arch/msp430fr5969lp/driver/dmx1.cc (renamed from src/arch/msp430fr5969lp/driver/dmx.cc)16
-rw-r--r--src/arch/msp430fr5969lp/driver/stdin.cc4
2 files changed, 10 insertions, 10 deletions
diff --git a/src/arch/msp430fr5969lp/driver/dmx.cc b/src/arch/msp430fr5969lp/driver/dmx1.cc
index 78c7e19..cad965b 100644
--- a/src/arch/msp430fr5969lp/driver/dmx.cc
+++ b/src/arch/msp430fr5969lp/driver/dmx1.cc
@@ -5,7 +5,7 @@
*/
#include <msp430.h>
#include "arch.h"
-#include "driver/dmx.h"
+#include "driver/dmx1.h"
#include "driver/gpio.h"
/*
@@ -16,7 +16,7 @@
* Set UCBRS0 according to table 21-4
*/
-void DMX::setup()
+void DMX1::setup()
{
UCA1CTLW0 |= UCSWRST;
#if F_CPU == 16000000UL
@@ -38,7 +38,7 @@ void DMX::setup()
UCA1CTLW0 &= ~UCSWRST;
}
-void DMX::write()
+void DMX1::write()
{
// Disable UART for reset and mark signals
UCA1CTLW0 |= UCSWRST;
@@ -49,18 +49,14 @@ void DMX::write()
arch.delay_us(8); // mark
P2SEL1 |= BIT5;
UCA1CTLW0 &= ~UCSWRST; // causes line to go high
- for (unsigned char i = 0; i < 16; i++) {
+ for (unsigned short i = 0; i < num_frames; i++) {
while (!(UCA1IFG & UCTXIFG));
UCA1TXBUF = frames[i];
}
- for (unsigned char i = 0; i < 241; i++) {
- while (!(UCA1IFG & UCTXIFG));
- UCA1TXBUF = 0;
- }
- for (unsigned char i = 0; i < 255; i++) {
+ for (unsigned short i = 0; i < 258 - num_frames; i++) {
while (!(UCA1IFG & UCTXIFG));
UCA1TXBUF = 0;
}
}
-DMX dmx;
+DMX1 dmx1;
diff --git a/src/arch/msp430fr5969lp/driver/stdin.cc b/src/arch/msp430fr5969lp/driver/stdin.cc
index 0850dab..92b7157 100644
--- a/src/arch/msp430fr5969lp/driver/stdin.cc
+++ b/src/arch/msp430fr5969lp/driver/stdin.cc
@@ -8,6 +8,10 @@
void StandardInput::setup()
{
+ UCA0CTLW0 |= UCSWRST;
+ P2SEL0 &= ~BIT1;
+ P2SEL1 |= BIT1;
+ UCA0CTLW0 &= ~UCSWRST;
UCA0IE |= UCRXIE;
}