reflow-oven-control-sw/stm-firmware/updater/ram-code/main.c

34 lines
410 B
C

#include <stdint.h>
#include <stm32/stm32f4xx.h>
#include <cmsis/core_cm4.h>
static void watchdog_ack(void)
{
IWDG->KR = 0xAAAA;
}
int ram_code_main(void)
{
SysTick_Config(168000UL);
__enable_irq();
while(1) {
__WFI();
}
return 0;
}
void SysTick_Handler(void)
{
static uint32_t tick_cnt = 0;
tick_cnt++;
watchdog_ack();
if (tick_cnt >= 250) {
GPIOB->ODR ^= (1<<2);
tick_cnt = 0;
}
}