mirror of
git://soft.sys114.com/klipper
synced 2026-02-12 23:50:27 +09:00
stm32: Rename stm32f4/ directory to stm32/
Now that the code in stm32f4/ can handle both stm32f1 and stm32f4 chips, rename the directory to just "stm32". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
committed by
KevinOConnor
parent
ec3d865b51
commit
8b9cc62359
25
src/stm32/watchdog.c
Normal file
25
src/stm32/watchdog.c
Normal file
@@ -0,0 +1,25 @@
|
||||
// Watchdog handler on STM32
|
||||
//
|
||||
// Copyright (C) 2019 Kevin O'Connor <kevin@koconnor.net>
|
||||
//
|
||||
// This file may be distributed under the terms of the GNU GPLv3 license.
|
||||
|
||||
#include "internal.h" // IWDG
|
||||
#include "sched.h" // DECL_TASK
|
||||
|
||||
void
|
||||
watchdog_reset(void)
|
||||
{
|
||||
IWDG->KR = 0xAAAA;
|
||||
}
|
||||
DECL_TASK(watchdog_reset);
|
||||
|
||||
void
|
||||
watchdog_init(void)
|
||||
{
|
||||
IWDG->KR = 0x5555;
|
||||
IWDG->PR = 0;
|
||||
IWDG->RLR = 0x0FFF; // 410-512ms timeout (depending on stm32 chip)
|
||||
IWDG->KR = 0xCCCC;
|
||||
}
|
||||
DECL_INIT(watchdog_init);
|
||||
Reference in New Issue
Block a user