diff options
author | Leo C | 2014-10-23 02:25:00 +0200 |
---|---|---|
committer | Leo C | 2014-10-23 02:25:00 +0200 |
commit | 89adce76dd02f2076ec6de1c6b434bc1f29512f4 (patch) | |
tree | 33badc10f344a4648a41dee78b0a7ea24ae36144 /avr/main.c | |
parent | 6a4e9540b950d871ea8fa072b195490a231b251d (diff) | |
download | z180-stamp-89adce76dd02f2076ec6de1c6b434bc1f29512f4.zip |
working host communication, new command: connect
Diffstat (limited to 'avr/main.c')
-rw-r--r-- | avr/main.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -18,6 +18,7 @@ #include "timer.h" #include "cli.h" #include "env.h" +#include "z180-serv.h" #define udelay(n) _delay_us(n) @@ -66,6 +67,11 @@ ISR(INT5_vect) Stat |= S_MSG_PENDING; } +ISR(INT6_vect) +{ + Stat |= S_CON_PENDING; +} + static void setup_avr(void) { @@ -105,10 +111,13 @@ void setup_avr(void) TCCR3B = (0b01<<WGM32)|(0b001<<CS30); /* CTC Mode, Prescaler 1 */ TIMSK3 = _BV(OCIE3A); /* Enable TC2.oca interrupt */ - /* INT5 falling edge */ - EICRB = (EICRB & ~(0b11 << ISC50)) | 0b10 << ISC50; - /* Enable INT5 */ - EIMSK |= _BV(INT5); + /* INT5, INT6: falling edge */ + EICRB = (EICRB & ~((0b11 << ISC50) | (0b11 << ISC60))) | + (0b10 << ISC50) | (0b10 << ISC60); + /* Reset pending ints */ + EIFR |= _BV(INTF5) | _BV(INTF6); + /* Enable INT5, and INT6 */ + EIMSK |= _BV(INT5) | _BV(INT6); } static @@ -240,6 +249,7 @@ int main(void) printf_P(PSTR("\nATMEGA1281+Z8S180 Stamp Monitor\n\n")); + setup_z180_serv(); main_loop(); } |