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.
65 lines
1.7 KiB
65 lines
1.7 KiB
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
#include "base/config_service.hpp"
|
|
#include "base/device_info.hpp"
|
|
#include "protocol_impl/protocol_impl_service.hpp"
|
|
#include "zsdk/zcanreceiver/zcanreceiver.hpp"
|
|
#include "zsdk/zsdk.hpp"
|
|
#include "iwdg.h"
|
|
|
|
#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) {
|
|
// }
|
|
}
|
|
|
|
ZGPIO m_debugled;
|
|
|
|
void debug_light_ctrl() {
|
|
static uint32_t lastcall = 0;
|
|
static bool light_status = false;
|
|
if (zhas_passedms(lastcall) > 100) {
|
|
m_debugled.toggle();
|
|
lastcall = zget_ticket();
|
|
}
|
|
}
|
|
|
|
void umain() {
|
|
m_debugled.initAsOutput(DEBUG_LIGHT_GPIO, kxs_gpio_nopull, false, false);
|
|
|
|
config_init();
|
|
deviceInfo_init();
|
|
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, "boardId : %d", deviceInfo_getBoardId());
|
|
ZLOGI(TAG, "=");
|
|
|
|
ZLOGI(TAG, "======================= init info ==================== ");
|
|
protocol_impl_service_init();
|
|
ZLOGI(TAG, "=");
|
|
|
|
ZLOGI(TAG, "======================= sysinfo ======================= ");
|
|
SysMgr::ins()->initedFinished();
|
|
SysMgr::ins()->dumpSysInfo();
|
|
ZLOGI(TAG, "=");
|
|
|
|
while (true) {
|
|
osDelay(1);
|
|
debug_light_ctrl();
|
|
HAL_IWDG_Refresh(&hiwdg);
|
|
}
|
|
}
|