diff --git a/inc/system/gpio.h b/inc/system/gpio.h --- a/inc/system/gpio.h +++ b/inc/system/gpio.h @@ -4,6 +4,12 @@ #include "stm32f3xx_hal.h" +// Helper macros +#define CHANGE_PERIOD_MS 100 +#define CHANGE_ELAPSED (HAL_GetTick() - change_time_reset) > CHANGE_PERIOD_MS +#define CHANGE_RESET change_time_reset = HAL_GetTick() + + // Define button push #define SW_D_Pin GPIO_PIN_4 #define SW_D_GPIO_Port GPIOA