chargeController/APP/businessLogic/Src/Init.c

69 lines
1.4 KiB
C

#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"
#include "pDebug.h"
#include "interruptSend.h"
#include "FM_RTC.h"
#include "SOE.h"
/**
* @brief 初始化外设,同时通过配置文件初始化系统参数
* @param None
* @retval None
*
*/
void Init(void)
{
// HAL_Delay(10000);
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();
FM_RTC_Init();
Init_BAT485_uart(g_cfgParameter.bat485_Baud);
Init_GW485_uart(g_cfgParameter.gw485_Baud);
// Init_BAT485_uart(115200);
// Init_GW485_uart(115200);
start_gw485Rx_It();
start_bat485Rx_It();
send_init();
eventsOrderRecordStartInit();
// POW_FF_PCON_Open();
// POW_OUT_PCON_Open();
HAL_Delay(100);
setPowerOutput(TRUE);
// /* 判断有无电池 */
// if (getOutputVoltage() > 11.0f) {
// setBatteryState(TRUE);
// setPowerOutput(TRUE);
// } else {
// setBatteryState(FALSE);
// }
resetCheckImpedanceState();
// setDutyRatio(0.5);
// while (1) {
// log_info("Init_debug_uart \n");
// HAL_Delay(1000);
// }
}