Introduce CPP macros for AVR IN/OUT registers

This commit is contained in:
2020-11-23 18:51:44 +01:00
parent 1e9512925d
commit 8a13a13a7c
7 changed files with 41 additions and 38 deletions

View File

@@ -2,6 +2,7 @@
#include <avr/pgmspace.h>
#include <avr/io.h>
#include <stdlib.h>
#include "common.h"
#include "rtc.h"
#include "i2c.h"
@@ -21,8 +22,8 @@ void rtc_invoke_handler(void);
void rtc_int0_init(void)
{
MCUCR |= (1<<ISC01);
INT0_DIR &= ~(1<<INT0_PIN);
INT0_PORT |= (1<<INT0_PIN);
R_DDR(INT0_PORT) &= ~(1<<INT0_IN);
R_PORT(INT0_PORT) |= (1<<INT0_IN);
rtc_invoke_handler();
}