添加注释

This commit is contained in:
2024-10-23 09:59:28 +08:00
parent 7561cdfe5a
commit 140de2ac1e
6 changed files with 27 additions and 10 deletions

View File

@@ -602,7 +602,7 @@ void iot_board_cfg_init()
os_mem_set(&g_board_info, 0x0, sizeof(board_info_t));
iot_board_hw_version_reload();
// 从oem中加载board配置
ret = board_load_oem_cfg();
if(ret != ERR_OK) {
iot_printf("Can't find pin config for board.\n");

View File

@@ -1129,10 +1129,12 @@ int system_uart_deinit();
int system_uart_init()
{
/* Get external port num. */
// 外置串口数目 目前是0
uint8_t port = iot_board_get_external_uart_port_num();
uart_info *p_uart_info = NULL;
int i;
// 获得串口api
g_uart_ctrl = uart_e_ctrl;
g_uart_ext_num = (int)port;
@@ -1156,10 +1158,11 @@ int system_uart_init()
os_mem_set(g_uart_rs485_port, 0x0,
g_uart_rs485_num * sizeof(struct uart_rs485_ctrl));
// 初始化所有串口,设置中断回调函数,除了打印串口
if (ERR_OK != uart_onchip_port_init(p_uart_info)) {
goto error_out;
}
// 外置串口数量为0 这里直接返回成功
if (ERR_OK != uart_external_port_init(g_uart_ext_num,
p_uart_info + IOT_UART_PORT_NUM_ONCHIP)) {
goto error_out;

View File

@@ -801,6 +801,7 @@ static uint8_t board_get_vc_uart_port(uint8_t type)
return port;
}
// 根据用途来获取串口号
uint8_t board_lookup_uart_port(uint8_t type)
{
uint8_t port = IOT_UART_PORT_SUPP_MAX;
@@ -811,7 +812,7 @@ uint8_t board_lookup_uart_port(uint8_t type)
if (g_fw_mode == FTM_MODE) {
return board_lookup_uart_port_ftm(type);
}
// 根据不同的板子修改type类型
type = board_lookup_uart_port_type_updata(type);
for (uint8_t i = 0; i < IOT_UART_MAX_NUM_V1; i++) {