You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
934 B
40 lines
934 B
#include <stddef.h>
|
|
#include <stdio.h>
|
|
//
|
|
#include "appdep.hpp"
|
|
|
|
#define TAG "main"
|
|
extern void umain();
|
|
extern "C" {
|
|
void StartDefaultTask(void const *argument) { umain(); }
|
|
}
|
|
/*******************************************************************************
|
|
* MAIN *
|
|
*******************************************************************************/
|
|
|
|
/* IWDG init function */
|
|
void MX_IWDG_Init(void) {
|
|
hiwdg.Instance = IWDG;
|
|
hiwdg.Init.Prescaler = IWDG_PRESCALER_256;
|
|
hiwdg.Init.Reload = 501;
|
|
if (HAL_IWDG_Init(&hiwdg) != HAL_OK) {
|
|
Error_Handler();
|
|
}
|
|
}
|
|
|
|
int32_t getDeviceIdFromFlash() {
|
|
int32_t *deviceId = (int32_t *)BOARD_TYPE_ID_FLASH_ADD;
|
|
if (*deviceId <= 0) {
|
|
return 0;
|
|
}
|
|
return *deviceId;
|
|
}
|
|
|
|
void umain() {
|
|
MX_IWDG_Init();
|
|
while (true) {
|
|
osDelay(30);
|
|
// debug_light_ctrl();
|
|
HAL_IWDG_Refresh(&hiwdg);
|
|
}
|
|
}
|