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.
 
 
 

57 lines
1.4 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"
#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, "%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());
protocol_impl_service_init();
ZLOGI(TAG, "system init done");
SysMgr::ins()->regTaskId(osThreadGetId());
while (true) {
osDelay(1);
debug_light_ctrl();
}
}