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.
53 lines
1.2 KiB
53 lines
1.2 KiB
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
#include "service/config_service.hpp"
|
|
#include "zsdk/zsdk.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) {
|
|
// }
|
|
}
|
|
|
|
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() {
|
|
int32_t count = 0;
|
|
|
|
ZLOGI(TAG, "%s: %d.%d.%d", PROJECT, VERSION_MAIN(PC_VERSION), VERSION_SUB(PC_VERSION), VERSION_FIX(PC_VERSION));
|
|
ZLOGI(TAG, "sn: %s", sn_get_str());
|
|
|
|
config_init();
|
|
|
|
m_debugled.initAsOutput(DEBUG_LIGHT_GPIO, kxs_gpio_nopull, false, false);
|
|
|
|
ZLOGI(TAG, "system init done");
|
|
|
|
SysMgr::ins()->regTaskId(osThreadGetId());
|
|
SysMgr::ins()->dumpSysInfo();
|
|
|
|
while (true) {
|
|
osDelay(10);
|
|
debug_light_ctrl();
|
|
}
|
|
}
|