summaryrefslogtreecommitdiff
path: root/src/modem.cc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-01-15 18:04:46 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-01-15 18:04:46 +0100
commit2575089632baea41591ffa794914455d35b5d52a (patch)
treedd0924a1eabdba36efe71cc8caa372dfa4e9aa81 /src/modem.cc
parentec9cfa2de32efc03355d420159025da8266a0d94 (diff)
fix Modem::init (used the wrong DEFINEs in some places), add modem test to main
Diffstat (limited to 'src/modem.cc')
-rw-r--r--src/modem.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modem.cc b/src/modem.cc
index 6020a15..cb3a6ee 100644
--- a/src/modem.cc
+++ b/src/modem.cc
@@ -7,6 +7,8 @@
* License: LGPLv3, see COPYING, and COPYING.LESSER -files for more info
*/
+#include <avr/io.h>
+#include <stdlib.h>
#include "modem.h"
/* Ring buffer global variables */
@@ -83,12 +85,12 @@ ISR(PCINT3_vect) {
*/
void Modem::init() {
/* Modem pin as input */
- MODEM_DDR &= ~(1 << MODEM_PIN);
+ MODEM_DDR &= ~_BV(MODEM_PIN);
/* Enable Pin Change Interrupts and PCINT for MODEM_PIN */
- PCMSK1 |= _BV(MODEM_PIN);
- PCICR |= _BV(PCIE3);
+ MODEM_PCMSK |= _BV(MODEM_PCINT);
+ PCICR |= _BV(MODEM_PCIE);
/* Timer: TCCR1: CS10 and CS11 bits: 8MHz clock with Prescaler 64 = 125kHz timer clock */
TCCR1B = _BV(CS11) | _BV(CS10);
-}
+}