summaryrefslogtreecommitdiff
path: root/avr/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'avr/main.c')
-rw-r--r--avr/main.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/avr/main.c b/avr/main.c
index 2a1ecd3..34db6ef 100644
--- a/avr/main.c
+++ b/avr/main.c
@@ -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();
}