diff --git a/gpio.c b/gpio.c --- a/gpio.c +++ b/gpio.c @@ -20,6 +20,21 @@ void user_input(uint16_t* to_modify) } } +void user_input_signed(int16_t* to_modify) +{ + // TODO: Bounds check on int16_t + if(CHANGE_ELAPSED) { + if(!HAL_GPIO_ReadPin(SW_UP) ) { + CHANGE_RESET; + (*to_modify)++; + } + else if(!HAL_GPIO_ReadPin(SW_DOWN)) { + CHANGE_RESET; + (*to_modify)--; + } + } +} + void init_gpio(void) {