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.
 
 
 

148 lines
3.9 KiB

#include <stddef.h>
#include <stdio.h>
#include "configs/device_id_mgr.hpp"
#include "public_service/public_service.hpp"
#include "sysmgr/sys_mgr.hpp"
//
//
#define TAG "main"
using namespace std;
using namespace iflytop;
extern void umain();
extern "C" {
void StartDefaultTask(void const* argument) { umain(); }
}
int32_t deviceId = 0;
static void board_init() {
switch (deviceId) {
// case 10:
// subboard10_hbot_board_init();
// break;
// case 20: // 板夹仓
// subboard20_plate_clamp_case_board_init();
// break;
// case 30: // 摇匀模组
// subboard30_shake_module_board_init();
// break;
// case 40: // 温度控制板40
// case 50: // 温度控制板50
// subboard40_and_50_temperature_ctrl_board_init();
// break;
// case 60: // 进出料模组
// subboard60_inlet_and_outlet_module_board_init();
// break;
// case 70: // 孵化转盘
// subboard70_incubation_turntable_board_init();
// break;
// case 80:
// subboard80_cliptip_board_init();
// break;
// case 90:
// subboard90_optical_module_board_init();
// break;
// case 100:
// subboard100_id_card_reader_board_init();
// break;
// case 200:
// subboard200_ext_tmc5160_board_init();
// break;
default:
common_hardware_init();
break;
}
}
static void board_post_init() {
GService::inst()->initialize();
switch (deviceId) {
// case 10:
// Subboard10Hbot::ins()->initialize();
// break;
// case 20:
// Subboard20PlateClampCase::ins()->initialize();
// break;
// case 30: // 摇匀模组
// Subboard30ShakeModule::ins()->initialize();
// break;
// case 40: // 温度控制板40
// case 50: // 温度控制板50
// Subboard40And50TemperatureCtrl::ins()->initialize();
// break;
// case 60: // 进出料模组
// Subboard60InjectAndOutletModule::ins()->initialize();
// break;
// case 70: // 孵化转盘
// Subboard70IncubationTurntable::ins()->initialize();
// break;
// case 80:
// Subboard80Cliptip::ins()->initialize();
// break;
// case 100:
// Subboard100IdCardReader::ins()->initialize();
// break;
// case 200:
// Subboard200ExtTmc5160::ins()->initialize();
// break;
// case 90:
// Subboard90OpticalModule::ins()->initialize();
break;
default:
break;
}
}
void umain() {
// deviceId = zdevice_id_mgr_get_device_id();
// board_init();
// Pin_t debugLight = PC_DEBUG_LIGHT_GPIO;
// if (deviceId == 20) {
// debugLight = PC_SUBBOARD_20_70_LIGHT_GPIO;
// }
// zos_cfg_t zoscfg = {0};
// chip_cfg_t chipcfg = {};
// chipcfg.us_dleay_tim = &PC_SYS_DELAY_US_TIMER;
// chipcfg.tim_irq_scheduler_tim = &PC_SYS_TIM_IRQ_SCHEDULER_TIMER;
// chipcfg.huart = &PC_DEBUG_UART;
// chipcfg.debuglight = debugLight;
// chip_init(&chipcfg);
// zos_init(&zoscfg);
// zdevice_id_mgr_init();
// ZEARLY_LOGI("SYS", "chip init ok");
// ZEARLY_LOGI("SYS", "= manufacturer : %s", PC_MANUFACTURER);
// ZEARLY_LOGI("SYS", "= project name : %s", PC_PROJECT_NAME);
// ZEARLY_LOGI("SYS", "= version : %d", PC_VERSION);
// ZEARLY_LOGI("SYS", "= freq : %d", HAL_RCC_GetSysClockFreq());
// ZEARLY_LOGI("SYS", "= build time : %s", __DATE__ " " __TIME__);
// ZEARLY_LOGI("SYS", "= device id : %d", deviceId);
// if (deviceId <= 0) {
// chip_set_error();
// ZEARLY_LOGE("SYS", "device id is not set");
// while (true) {
// zos_delay(1);
// }
// }
// board_post_init();
// ZLOGI(TAG, "======================= sysinfo ======================= ");
// SysMgr::ins()->initedFinished();
// SysMgr::ins()->dumpSysInfo();
// ZLOGI(TAG, "=");
// while (true) {
// GService::inst()->getZCanReceiver()->loop();
// zos_delay(1);
// }
}