Browse Source

add watchdog timer to planck ez

planck_ez_wdg
Jack Humbert 5 years ago
parent
commit
c012d715bf
3 changed files with 12 additions and 2 deletions
  1. +10
    -0
      keyboards/planck/ez/ez.c
  2. +1
    -1
      quantum/stm32/halconf.h
  3. +1
    -1
      quantum/stm32/mcuconf.h

+ 10
- 0
keyboards/planck/ez/ez.c View File

@ -137,6 +137,13 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
{{3|(4<<4)}, {20.36*11,21.33*3}, 1}
};
static const WDGConfig wdognormalcfg =
{
STM32_IWDG_PR_64,
STM32_IWDG_RL(1000),
STM32_IWDG_WIN_DISABLED
};
void matrix_init_kb(void) {
matrix_init_user();
@ -145,9 +152,12 @@ void matrix_init_kb(void) {
palClearPad(GPIOB, 8);
palClearPad(GPIOB, 9);
wdgStart(&WDGD1, &wdognormalcfg);
}
void matrix_scan_kb(void) {
wdgReset(&WDGD1);
matrix_scan_user();
}


+ 1
- 1
quantum/stm32/halconf.h View File

@ -174,7 +174,7 @@
* @brief Enables the WDG subsystem.
*/
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
#define HAL_USE_WDG FALSE
#define HAL_USE_WDG TRUE
#endif
/*===========================================================================*/


+ 1
- 1
quantum/stm32/mcuconf.h View File

@ -252,6 +252,6 @@
/*
* WDG driver system settings.
*/
#define STM32_WDG_USE_IWDG FALSE
#define STM32_WDG_USE_IWDG TRUE
#endif /* MCUCONF_H */

Loading…
Cancel
Save