reflow-oven-control-sw/stm-firmware/updater/ram-code/main.c
Mario Hüttel 963b1e106c Updater: Write functional ram code loader
Updater RAM Code
----------------
* Ack running watchdog every 250 ms
* Blink green LED every 250 ms

Firmware
--------
* Add RAM code loader
* Reorganize initialization
* Add update command to shell
2020-12-14 20:29:51 +01:00

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;
}
}