|
|
@ -120,24 +120,30 @@ void umain() { |
|
|
|
* 3. 初始化工厂复位按键 |
|
|
|
*/ |
|
|
|
zaf_gpio_init_as_output(&m_debug_led, PC_DEBUG_LIGHT_GPIO, kxs_gpio_nopull, false, false); |
|
|
|
|
|
|
|
if (FACTORY_RESET_KEY != PinNull) { |
|
|
|
zaf_gpio_init_as_input(&m_factory_reset_key, FACTORY_RESET_KEY, kxs_gpio_nopull, kxs_gpio_no_irq, true); |
|
|
|
} |
|
|
|
|
|
|
|
// m_power_led
|
|
|
|
/**
|
|
|
|
* @brief 配置初始化 |
|
|
|
*/ |
|
|
|
config_init(); |
|
|
|
/**
|
|
|
|
* @brief 初始化网络服务 |
|
|
|
*/ |
|
|
|
network_service_init(); |
|
|
|
/**
|
|
|
|
* @brief fpga_interface init |
|
|
|
*/ |
|
|
|
fpga_if_init(); |
|
|
|
config_t* config = config_get(); |
|
|
|
for (uint32_t i = 0; i < ZARRAY_SIZE(config->reg_config_storage); i++) { |
|
|
|
if (config->reg_config_storage[i].add == 0) { |
|
|
|
break; |
|
|
|
} |
|
|
|
// ZLOGI(TAG, "init reg [0x%x] [0x%x]", config->reg_config_storage[i].add, config->reg_config_storage[i].val);
|
|
|
|
fpga_if_spi_write_data(config->reg_config_storage[i].add, config->reg_config_storage[i].val, NULL); |
|
|
|
} |
|
|
|
/**
|
|
|
|
* @brief 初始化网络服务 |
|
|
|
*/ |
|
|
|
network_service_init(); |
|
|
|
/**
|
|
|
|
* @brief reg_manager init |
|
|
|
*/ |
|
|
@ -149,15 +155,6 @@ void umain() { |
|
|
|
*/ |
|
|
|
osDelay(10); |
|
|
|
|
|
|
|
config_t* config = config_get(); |
|
|
|
for (uint32_t i = 0; i < ZARRAY_SIZE(config->reg_config_storage); i++) { |
|
|
|
if (config->reg_config_storage[i].add == 0) { |
|
|
|
break; |
|
|
|
} |
|
|
|
ZLOGI(TAG, "init reg [0x%x] [0x%x]", config->reg_config_storage[i].add, config->reg_config_storage[i].val); |
|
|
|
fpga_if_spi_write_data(config->reg_config_storage[i].add, config->reg_config_storage[i].val, NULL); |
|
|
|
} |
|
|
|
|
|
|
|
extern_if_service_init(); |
|
|
|
|
|
|
|
zaf_gpio_init_as_output(&m_fan0_power, PD0, kxs_gpio_pullup, true, false); |
|
|
@ -169,7 +166,6 @@ void umain() { |
|
|
|
ZLOGI(TAG, "system init done"); |
|
|
|
int32_t count = 0; |
|
|
|
|
|
|
|
|
|
|
|
while (true) { |
|
|
|
osDelay(10); |
|
|
|
count++; |
|
|
|