avr: add accessors for emergency buttons

Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
Ralf Ramsauer 2018-09-03 21:57:03 +00:00
parent 0f6c837eb8
commit 25595f18f2
1 changed files with 10 additions and 0 deletions

View File

@ -160,6 +160,16 @@ static inline void setup_ports(void)
DDRD = (1 << PD5) | (1 << PD6);
}
static inline bool is_emergency(void)
{
return !(PINB & (1 << PB3));
}
static inline bool is_door_open(void)
{
return !(PINB & (1 << PB2));
}
static unsigned char get_keys(void)
{
unsigned char ret = 0;