chargeController/APP/businessLogic/Src/Init.c

69 lines
1.4 KiB
C
Raw Normal View History

#include "Init.h"
#include "capture.h"
#include "inFlash.h"
#include "FM_GPIO.h"
#include "FM_TIM.h"
#include "uart_dev.h"
#include "parameter.h"
#include "abnormalManage.h"
2024-12-18 09:43:14 +00:00
#include "pDebug.h"
#include "interruptSend.h"
2024-12-24 06:43:20 +00:00
#include "FM_RTC.h"
2025-01-09 07:19:26 +00:00
#include "SOE.h"
/**
* @brief
* @param None
* @retval None
*
*/
void Init(void)
{
2024-12-24 06:43:20 +00:00
// HAL_Delay(10000);
2024-12-18 09:43:14 +00:00
config_info_start();
Init_debug_uart();
ADC_Capture_Init();
proportionalInt(g_cfgParameter.powerBoxType);
g_cfgParameter.firstStageProtectionValue = setfirstStageProtectionValue(g_cfgParameter.firstStageProtectionCurr);
FM_GPIO_Init();
tim_Init();
2024-12-24 06:43:20 +00:00
FM_RTC_Init();
2024-12-16 09:28:12 +00:00
Init_BAT485_uart(g_cfgParameter.bat485_Baud);
Init_GW485_uart(g_cfgParameter.gw485_Baud);
2025-01-17 12:32:22 +00:00
// Init_BAT485_uart(115200);
// Init_GW485_uart(115200);
start_gw485Rx_It();
start_bat485Rx_It();
2024-12-11 09:51:48 +00:00
2024-12-18 09:43:14 +00:00
send_init();
2025-01-09 07:19:26 +00:00
eventsOrderRecordStartInit();
// POW_FF_PCON_Open();
// POW_OUT_PCON_Open();
2024-12-18 09:43:14 +00:00
HAL_Delay(100);
setPowerOutput(TRUE);
// /* 判断有无电池 */
// if (getOutputVoltage() > 11.0f) {
// setBatteryState(TRUE);
// setPowerOutput(TRUE);
// } else {
// setBatteryState(FALSE);
// }
resetCheckImpedanceState();
2025-01-17 12:32:22 +00:00
2025-01-03 09:25:26 +00:00
// setDutyRatio(0.5);
2025-01-17 12:32:22 +00:00
// while (1) {
// log_info("Init_debug_uart \n");
// HAL_Delay(1000);
// }
}