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.
83 lines
2.0 KiB
83 lines
2.0 KiB
#include <stddef.h>
|
|
#include <stdio.h>
|
|
//
|
|
#include "base/appdep.hpp"
|
|
|
|
//
|
|
#include "base/protocol_processer_mgr.hpp"
|
|
//
|
|
|
|
#define TAG "main"
|
|
using namespace iflytop;
|
|
|
|
extern void umain();
|
|
extern "C" {
|
|
void StartDefaultTask(void const* argument) { umain(); }
|
|
}
|
|
/*******************************************************************************
|
|
* MAIN *
|
|
*******************************************************************************/
|
|
|
|
extern "C" {
|
|
// void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
|
|
// }
|
|
}
|
|
|
|
// void debug_light_ctrl() {
|
|
// static uint32_t lastcall = 0;
|
|
// static bool light_status = false;
|
|
|
|
// if (!gInitErrorFlag) {
|
|
// if (zhas_passedms(lastcall) > 300) {
|
|
// PublicBoard::ins()->toggleDebugLight();
|
|
// lastcall = zget_ticket();
|
|
// }
|
|
// } else {
|
|
// if (zhas_passedms(lastcall) > 30) {
|
|
// PublicBoard::ins()->toggleDebugLight();
|
|
// lastcall = zget_ticket();
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
#define REG_PROCESSER(processer) ProtocolProcesserMgr::ins()->regProcesser(processer);
|
|
|
|
/* 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();
|
|
}
|
|
}
|
|
|
|
void umain() {
|
|
gBoardFlagSetResetFlag();
|
|
|
|
deviceInfo_init();
|
|
config_init();
|
|
AppPeriodTaskMgr::ins()->initialize();
|
|
|
|
ZLOGI(TAG, "======================= boardinfo ==================== ");
|
|
ZLOGI(TAG, "project : %s ", PROJECT);
|
|
ZLOGI(TAG, "version : %d ", SOFTWARE_VERSION);
|
|
ZLOGI(TAG, "pversion : %d", deviceInfo_getProtocolVersion());
|
|
ZLOGI(TAG, "sn : %s", sn_get_str());
|
|
ZLOGI(TAG, "=");
|
|
|
|
|
|
AppPeriodTaskMgr::ins()->startScheduler();
|
|
|
|
ZLOGI(TAG, "======================= sysinfo ======================= ");
|
|
SysMgr::ins()->initedFinished();
|
|
SysMgr::ins()->dumpSysInfo();
|
|
ZLOGI(TAG, "=");
|
|
MX_IWDG_Init();
|
|
while (true) {
|
|
osDelay(30);
|
|
// debug_light_ctrl();
|
|
HAL_IWDG_Refresh(&hiwdg);
|
|
}
|
|
}
|