FIX | 去掉TAB

master
yuliang 5 months ago
parent 8feaf1ac48
commit ede556c5e5

@ -808,7 +808,7 @@ static HAL_StatusTypeDef _debug_adj_connect(void)
HAL_GPIO_WritePin(RS485_A_DE_GPIO_Port, RS485_A_DE_Pin, GPIO_PIN_SET); HAL_GPIO_WritePin(RS485_A_DE_GPIO_Port, RS485_A_DE_Pin, GPIO_PIN_SET);
HAL_E_RETURN(HAL_UART_Transmit(debug_adj_uart, debug_flash, head->len, 300)); HAL_E_RETURN(HAL_UART_Transmit(debug_adj_uart, debug_flash, head->len, 300));
HAL_GPIO_WritePin(RS485_A_DE_GPIO_Port, RS485_A_DE_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(RS485_A_DE_GPIO_Port, RS485_A_DE_Pin, GPIO_PIN_RESET);
/* 接收报文. */ /* 接收报文. */
HAL_UART_Abort(debug_adj_uart); HAL_UART_Abort(debug_adj_uart);
HAL_E_RETURN(HAL_UART_Receive(debug_adj_uart, debug_flash, 0x29, 300)); HAL_E_RETURN(HAL_UART_Receive(debug_adj_uart, debug_flash, 0x29, 300));
@ -890,7 +890,7 @@ static HAL_StatusTypeDef _debug_adj_auto(uint8_t bitmap)
/* 设置开始操作. */ /* 设置开始操作. */
HAL_E_RETURN(_debug_adj_start()); HAL_E_RETURN(_debug_adj_start());
//for(i = 0; i < DAU_PORT_POWER_CNT; i++) //for(i = 0; i < DAU_PORT_POWER_CNT; i++)
for(i = 0; i < 1; i++) for(i = 0; i < 1; i++)
{ {
/* 过滤不需要的通道. */ /* 过滤不需要的通道. */
@ -914,15 +914,15 @@ static HAL_StatusTypeDef _debug_adj_auto(uint8_t bitmap)
} }
/* 开始自动校准, 注意不同变比的通道不能一起校准. */ /* 开始自动校准, 注意不同变比的通道不能一起校准. */
for (j = 0; j < 1; j++) // 只校准一个分段点 2024/12/11 for (j = 0; j < 1; j++) // 只校准一个分段点 2024/12/11
{ {
HAL_E_RETURN(_debug_adj_source_set(bitmap_new, j)); HAL_E_RETURN(_debug_adj_source_set(bitmap_new, j));
osDelay(3000); osDelay(3000);
g_is_adj_status = 1; g_is_adj_status = 1;
while (g_is_adj_status != 2) while (g_is_adj_status != 2)
{ {
common_watchdog_set(COM_WDG_CLI); common_watchdog_set(COM_WDG_CLI);
osDelay(2000); osDelay(2000);
} }
DBG(DBG_M_RS485_DEBUG, "capture end...\r\n"); DBG(DBG_M_RS485_DEBUG, "capture end...\r\n");
HAL_E_RETURN(_dau_base_auto(bitmap_new, j + 1)); HAL_E_RETURN(_dau_base_auto(bitmap_new, j + 1));
@ -949,7 +949,7 @@ static HAL_StatusTypeDef _debug_adj_autoEx(uint8_t bitmap, uint16_t elec, uint8_
/* 设置开始操作. */ /* 设置开始操作. */
HAL_E_RETURN(_debug_adj_start()); HAL_E_RETURN(_debug_adj_start());
//for(i = 0; i < DAU_PORT_POWER_CNT; i++) //for(i = 0; i < DAU_PORT_POWER_CNT; i++)
for(i = 0; i < 1; i++) for(i = 0; i < 1; i++)
{ {
/* 过滤不需要的通道. */ /* 过滤不需要的通道. */
@ -974,18 +974,18 @@ static HAL_StatusTypeDef _debug_adj_autoEx(uint8_t bitmap, uint16_t elec, uint8_
/* 开始自动校准, 注意不同变比的通道不能一起校准. */ /* 开始自动校准, 注意不同变比的通道不能一起校准. */
//for (j = 0; j < DAU_POWER_ADJ_CNT; j++) //for (j = 0; j < DAU_POWER_ADJ_CNT; j++)
{ {
HAL_E_RETURN(_debug_adj_source_setEx(bitmap_new, index-1, elec)); HAL_E_RETURN(_debug_adj_source_setEx(bitmap_new, index-1, elec));
osDelay(5000); osDelay(5000);
g_is_adj_status = 1; g_is_adj_status = 1;
while (g_is_adj_status != 2) while (g_is_adj_status != 2)
{ {
common_watchdog_set(COM_WDG_CLI); common_watchdog_set(COM_WDG_CLI);
osDelay(2000); osDelay(2000);
} }
DBG(DBG_M_RS485_DEBUG, "capture end...\r\n"); DBG(DBG_M_RS485_DEBUG, "capture end...\r\n");
HAL_E_RETURN(_dau_base_auto(bitmap_new, index)); HAL_E_RETURN(_dau_base_auto(bitmap_new, index));
g_is_adj_status = 0; g_is_adj_status = 0;
} }
} }
@ -1056,7 +1056,7 @@ void _debug_pkt_adj_autoEx(uint16_t elec, uint8_t index)
data->ch_selecet = 1; data->ch_selecet = 1;
if (data->ch_selecet == 1) if (data->ch_selecet == 1)
{ {
HAL_GPIO_WritePin(LED_RUN_GPIO_Port, LED_RUN_Pin, GPIO_PIN_SET); HAL_GPIO_WritePin(LED_RUN_GPIO_Port, LED_RUN_Pin, GPIO_PIN_SET);
} }
rv = _debug_adj_autoEx(data->ch_selecet, elec, index); rv = _debug_adj_autoEx(data->ch_selecet, elec, index);
if (rv == HAL_OK) if (rv == HAL_OK)

@ -887,24 +887,24 @@ void cli_start(void const * argument)
/* 默认开启的 debug. */ /* 默认开启的 debug. */
if (IS_MONITOR_BIT_SET(dev_config.flag, DEV_FLAG_CLI)) if (IS_MONITOR_BIT_SET(dev_config.flag, DEV_FLAG_CLI))
{ {
dbg_cmd_hander(DBG_CMD_ON, DBG_M_DAU); dbg_cmd_hander(DBG_CMD_ON, DBG_M_DAU);
//dbg_cmd_hander(DBG_CMD_ON, DBG_M_DAU_TXRX); //dbg_cmd_hander(DBG_CMD_ON, DBG_M_DAU_TXRX);
//dbg_cmd_hander(DBG_CMD_ON, DBG_M_GPS); //dbg_cmd_hander(DBG_CMD_ON, DBG_M_GPS);
dbg_cmd_hander(DBG_CMD_ON, DBG_M_4G); dbg_cmd_hander(DBG_CMD_ON, DBG_M_4G);
dbg_cmd_hander(DBG_CMD_ON, DBG_M_RS485_SEN); dbg_cmd_hander(DBG_CMD_ON, DBG_M_RS485_SEN);
dbg_cmd_hander(DBG_CMD_ON, DBG_M_RS485_DEBUG); dbg_cmd_hander(DBG_CMD_ON, DBG_M_RS485_DEBUG);
} }
/* 初始化 ADC 采样任务. */ /* 初始化 ADC 采样任务. */
ADC_init(); ADC_init();
if (IS_MONITOR_BIT_SET(dev_config.flag, DEV_FLAG_ADJ)) if (IS_MONITOR_BIT_SET(dev_config.flag, DEV_FLAG_ADJ))
{ {
dau_adj_init(); dau_adj_init();
} }
else else
{ {
/* 初始化 DAU 任务. */ /* 初始化 DAU 任务. */
dau_init(); dau_init();
} }
/* 初始化无线通讯任务. */ /* 初始化无线通讯任务. */

@ -163,7 +163,7 @@ static struct tm _dau_tm;
int8_t _dau_spi_rw; int8_t _dau_spi_rw;
uint16_t _dau_spi_addr; uint16_t _dau_spi_addr;
uint16_t _dau_spi_len; uint16_t _dau_spi_len;
int8_t g_is_adj_status = 0; // 1:采集 2:采集完成 int8_t g_is_adj_status = 0; // 1:采集 2:采集完成
/* Private function prototypes -----------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/
/* Internal functions --------------------------------------------------------*/ /* Internal functions --------------------------------------------------------*/
@ -869,7 +869,7 @@ void _dau_power_calculate(DAU_SOURCE_E source)
/* dau data base 自动计算. */ /* dau data base 自动计算. */
HAL_StatusTypeDef _dau_base_auto(uint8_t ch_bitmap, uint8_t index) HAL_StatusTypeDef _dau_base_auto(uint8_t ch_bitmap, uint8_t index)
{ {
int16_t (*val)[DAU_POWER_DATE_LEN] = dau_ctrl.reg_power; int16_t (*val)[DAU_POWER_DATE_LEN] = dau_ctrl.reg_power;
//uint32_t *power = dau_ctrl.reg_elec; //uint32_t *power = dau_ctrl.reg_elec;
uint8_t ch = 0; uint8_t ch = 0;
uint16_t i = 0; uint16_t i = 0;
@ -1237,54 +1237,54 @@ static void _dau_adj_start(void *argument)
osDelay(10000); osDelay(10000);
common_watchdog_set(COM_WDG_DAU); common_watchdog_set(COM_WDG_DAU);
if (g_is_adj_status == 1) if (g_is_adj_status == 1)
{ {
memset(dau_ctrl.reg_power, 0, sizeof(dau_ctrl.reg_power)); memset(dau_ctrl.reg_power, 0, sizeof(dau_ctrl.reg_power));
/* 读取全局状态寄存器 */ /* 读取全局状态寄存器 */
rv = _dau_reg_read_global_state(); rv = _dau_reg_read_global_state();
if (rv != HAL_OK) if (rv != HAL_OK)
{ {
vty_print("rv=%d\r\n", rv); vty_print("rv=%d\r\n", rv);
continue; continue;
} }
/* 循环工频缺陷电流采集 */ /* 循环工频缺陷电流采集 */
dau_ctrl.col_time = 600000; dau_ctrl.col_time = 600000;
MONITOR_BITMAP_SET(dau_ctrl.col_flag, DAU_COL_FLAG_FAULT_CMP); MONITOR_BITMAP_SET(dau_ctrl.col_flag, DAU_COL_FLAG_FAULT_CMP);
MONITOR_BITMAP_SET(dau_ctrl.col_flag, DAU_COL_FLAG_REG_CMP); MONITOR_BITMAP_SET(dau_ctrl.col_flag, DAU_COL_FLAG_REG_CMP);
_dau_wave_col_trigger_by_reg(); _dau_wave_col_trigger_by_reg();
#if 1 #if 1
//for(i = 0; i < DAU_PORT_POWER_CNT; i++) //for(i = 0; i < DAU_PORT_POWER_CNT; i++)
for(i = 0; i < 1; i++) for(i = 0; i < 1; i++)
{ {
vty_print("POWER %d\r\n", i); vty_print("POWER %d\r\n", i);
buf = (uint16_t*)dau_ctrl.reg_power[i]; buf = (uint16_t*)dau_ctrl.reg_power[i];
for(j = 0; j < DAU_PKT_POWER_CNT; j++) for(j = 0; j < DAU_PKT_POWER_CNT; j++)
{ {
common_watchdog_set(COM_WDG_DAU); common_watchdog_set(COM_WDG_DAU);
for(k = 0; k < 512;) for(k = 0; k < 512;)
{ {
vty_print("%-04x ", buf[k++]); vty_print("%-04x ", buf[k++]);
if(0 == (j*512+k ) % 40) if(0 == (j*512+k ) % 40)
{ {
osDelay(100); osDelay(100);
vty_print("\r\n"); vty_print("\r\n");
} }
} }
/*if((j*512+k ) % 40 != 0) /*if((j*512+k ) % 40 != 0)
{ {
osDelay(100); osDelay(100);
vty_print("\r\n"); vty_print("\r\n");
}*/ }*/
buf += 512; buf += 512;
} }
vty_print("\r\n"); vty_print("\r\n");
} }
#endif #endif
g_is_adj_status = 2; g_is_adj_status = 2;
_dau_base_auto(1, 0); _dau_base_auto(1, 0);
} }
} }
} }

Loading…
Cancel
Save