app: minor, add flag to debug reed switch

This commit is contained in:
King Kévin 2022-08-11 14:16:48 +02:00
parent f335044c77
commit 886965ee80
1 changed files with 2 additions and 1 deletions

View File

@ -86,7 +86,7 @@ static bool drv8825_reached = false; /**< set when the goal is reached */
#define DIAL_CYCLE_STEPS 4200U /**< number of steps for the hour dial to make a round */
#define DIAL_MIDNIGHT_STEPS 3207U /**< number of steps after dial detection for dials to show midnight */
static volatile uint32_t dial_steps = 0; /**< set to drv8825_steps when dial is nearby */
static volatile bool reed_flag = false;
#define WSMATRIX_HEIGHT (2 * 8) /**< WS2812b panel height, in pixels */
#define WSMATRIX_WIDTH 32 /**< WS2812b panel width, in pixels */
@ -1231,6 +1231,7 @@ void TIM_ISR(DRV8825_STEP_TIMER)(void)
void GPIO_EXTI_ISR(DIAL_SWITCH_PIN)(void)
{
exti_reset_request(GPIO_EXTI(DIAL_SWITCH_PIN)); // reset interrupt
reed_flag = true;
// I don't know why, but the RGBPANEL_ISR does trigger this EXTI
if (gpio_get(GPIO_PORT(DIAL_SWITCH_PIN), GPIO_PIN(DIAL_SWITCH_PIN))) { // be sure the pin is actually low
return;