summaryrefslogtreecommitdiff
path: root/avr/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'avr/main.c')
-rw-r--r--avr/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/avr/main.c b/avr/main.c
index ba8a672..2955630 100644
--- a/avr/main.c
+++ b/avr/main.c
@@ -61,6 +61,11 @@ void print_reset_reason(void)
#endif
+ISR(INT5_vect)
+{
+ Stat |= S_MSG_PENDING;
+}
+
static
void setup_avr(void)
{
@@ -99,6 +104,11 @@ void setup_avr(void)
OCR3A = F_CPU / 1000 - 1; /* Timer3: 1000Hz interval (OC3A) */
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);
}
static