Files

copied
Last update 8 years 4 months
Files
tests
.gitignore
.travis.yml
Makefile
README.md
button_fsm.c
button_fsm.h
hall_fsm.c
hall_fsm.h
light-control.brd
light-control.sch
main.c
messages.c
messages.h
port.c
port.h
room_fsm.c
room_fsm.h
timers.c
timers.h
button_fsm.h
#include <stdint.h> #include "timers.h" #include "messages.h" #define STATE_BUTTON_RELEASED 0 #define STATE_BUTTON_NOISE_DELAY 1 #define STATE_BUTTON_COUNT_LENGTH 2 #define STATE_BUTTON_WAIT_RELEASE 3 #define BUTTON_NOISE_DELAY 25 #define BUTTON_LONG_PUSH 500 typedef struct { uint8_t timer_id; uint8_t msg_id_short; uint8_t msg_id_long; volatile uint8_t *pin; uint8_t bit; } Button; int8_t Button_Read(Button *button); uint8_t button_fsm_init(); uint8_t button_fsm(uint8_t state, Button *button);
Report a bug