diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..7b0093d
Binary files /dev/null and b/.DS_Store differ
diff --git a/.mxproject b/.mxproject
new file mode 100644
index 0000000..b83ae77
--- /dev/null
+++ b/.mxproject
@@ -0,0 +1,33 @@
+[PreviousLibFiles]
+LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_adc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_can.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_adc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_bus.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_system.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_utils.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_can.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usart.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f107xc.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_armv8mbl.h;
+
+[PreviousUsedCubeIDEFiles]
+SourceFiles=Core/Src/main.c;Core/Src/gpio.c;Core/Src/adc.c;Core/Src/can.c;Core/Src/usart.c;Core/Src/stm32f1xx_it.c;Core/Src/stm32f1xx_hal_msp.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Core/Src/system_stm32f1xx.c;;;
+HeaderPath=Drivers/STM32F1xx_HAL_Driver/Inc;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy;Drivers/CMSIS/Device/ST/STM32F1xx/Include;Drivers/CMSIS/Include;Core/Inc;
+CDefines=USE_HAL_DRIVER;STM32F107xC;USE_HAL_DRIVER;USE_HAL_DRIVER;
+
+[PreviousGenFiles]
+AdvancedFolderStructure=true
+HeaderFileListSize=7
+HeaderFiles#0=../Core/Inc/gpio.h
+HeaderFiles#1=../Core/Inc/adc.h
+HeaderFiles#2=../Core/Inc/can.h
+HeaderFiles#3=../Core/Inc/usart.h
+HeaderFiles#4=../Core/Inc/stm32f1xx_it.h
+HeaderFiles#5=../Core/Inc/stm32f1xx_hal_conf.h
+HeaderFiles#6=../Core/Inc/main.h
+HeaderFolderListSize=1
+HeaderPath#0=../Core/Inc
+HeaderFiles=;
+SourceFileListSize=7
+SourceFiles#0=../Core/Src/gpio.c
+SourceFiles#1=../Core/Src/adc.c
+SourceFiles#2=../Core/Src/can.c
+SourceFiles#3=../Core/Src/usart.c
+SourceFiles#4=../Core/Src/stm32f1xx_it.c
+SourceFiles#5=../Core/Src/stm32f1xx_hal_msp.c
+SourceFiles#6=../Core/Src/main.c
+SourceFolderListSize=1
+SourcePath#0=../Core/Src
+SourceFiles=;
+
diff --git a/.project b/.project
new file mode 100644
index 0000000..d1dece3
--- /dev/null
+++ b/.project
@@ -0,0 +1,32 @@
+
+
+ GbTModuleSW
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ com.st.stm32cube.ide.mcu.MCUProjectNature
+ com.st.stm32cube.ide.mcu.MCUCubeProjectNature
+ org.eclipse.cdt.core.cnature
+ com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature
+ com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature
+ com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature
+ com.st.stm32cube.ide.mcu.MCURootProjectNature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/Core/.DS_Store b/Core/.DS_Store
new file mode 100644
index 0000000..4ff38d0
Binary files /dev/null and b/Core/.DS_Store differ
diff --git a/Core/Inc/.DS_Store b/Core/Inc/.DS_Store
new file mode 100644
index 0000000..84d66a1
Binary files /dev/null and b/Core/Inc/.DS_Store differ
diff --git a/Core/Inc/adc.h b/Core/Inc/adc.h
new file mode 100644
index 0000000..d92b71e
--- /dev/null
+++ b/Core/Inc/adc.h
@@ -0,0 +1,52 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file adc.h
+ * @brief This file contains all the function prototypes for
+ * the adc.c file
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __ADC_H__
+#define __ADC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+extern ADC_HandleTypeDef hadc1;
+
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+void MX_ADC1_Init(void);
+
+/* USER CODE BEGIN Prototypes */
+
+/* USER CODE END Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ADC_H__ */
+
diff --git a/Core/Inc/board.h b/Core/Inc/board.h
new file mode 100644
index 0000000..775b882
--- /dev/null
+++ b/Core/Inc/board.h
@@ -0,0 +1,25 @@
+/*
+ * board.h
+ *
+ * Created on: Apr 15, 2024
+ * Author: colorbass
+ */
+
+#ifndef SRC_BOARD_H_
+#define SRC_BOARD_H_
+
+void GBT_Lock(uint8_t state);
+
+typedef enum{
+ RELAY_AUX,
+ RELAY_CC,
+
+}relay_t;
+
+void RELAY_Write(relay_t num, uint8_t state);
+void Init_Peripheral();
+uint8_t GBT_LockGetState();
+void GBT_Lock(uint8_t state);
+uint8_t SW_GetAddr();
+
+#endif /* SRC_BOARD_H_ */
diff --git a/Core/Inc/can.h b/Core/Inc/can.h
new file mode 100644
index 0000000..5f9c899
--- /dev/null
+++ b/Core/Inc/can.h
@@ -0,0 +1,55 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file can.h
+ * @brief This file contains all the function prototypes for
+ * the can.c file
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __CAN_H__
+#define __CAN_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+extern CAN_HandleTypeDef hcan1;
+
+extern CAN_HandleTypeDef hcan2;
+
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+void MX_CAN1_Init(void);
+void MX_CAN2_Init(void);
+
+/* USER CODE BEGIN Prototypes */
+
+/* USER CODE END Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CAN_H__ */
+
diff --git a/Core/Inc/charger_gbt.h b/Core/Inc/charger_gbt.h
new file mode 100644
index 0000000..bb4417e
--- /dev/null
+++ b/Core/Inc/charger_gbt.h
@@ -0,0 +1,209 @@
+/*
+ * charger_gbt.h
+ *
+ * Created on: Apr 18, 2024
+ * Author: colorbass
+ */
+
+#ifndef INC_CHARGER_GBT_H_
+#define INC_CHARGER_GBT_H_
+#include "main.h"
+
+typedef enum{
+ GBT_CC_UNKNOWN,
+ GBT_CC_12V,
+ GBT_CC_6V,
+ GBT_CC_4V,
+ GBT_CC_2V,
+
+}gbtCcState_t;
+
+typedef enum{
+ GBT_DISABLED,
+ GBT_S0_UNCONNECTED, //СС1 12V/6V СС2 12V
+ GBT_S1_CONNECTED, //СС1 4V СС2 4V (6V)
+ GBT_S2_LOCKED, //
+ GBT_S3_STARTED, // 12V AUX
+ GBT_S4_ISOTEST, // testing isolation, send CHM receive BHM
+ GBT_S5_BAT_INFO, // identifying BMS, send CRM receive BRM (long)
+ GBT_S6_BAT_STAT, // send CRM(AA), receive BCP (long)
+ GBT_S7_BMS_WAIT, // wait for BMS, send CTS+CML receive BRO(00), next BRO(AA)
+ GBT_S8_INIT_CHARGER,// starting power modules, send CRO(00)
+ GBT_S9_WAIT_BCL, // waiting for BCL (requested voltage), send CRO(00)
+ GBT_S10_CHARGING, // charging, contactor ON, send CCS, receiving BCL+BCS+BSM
+ GBT_STOP, // stop
+ //TODO: after stop send BSD state
+
+}gbtState_t;
+
+#pragma pack(push, 1)
+
+
+typedef struct {
+ uint16_t maxOutputVoltage;
+
+}GBT_BHM_t;
+
+typedef struct {
+ uint8_t bmsIdentified;
+ char chargerNumber[4];
+ char chargerLocation[3];
+}GBT_CRM_t;
+
+typedef struct {
+ uint16_t maxOutputVoltage;
+ uint16_t minOutputVoltage;
+ uint16_t maxOutputCurrent;
+ uint16_t minOutputCurrent;
+
+}GBT_CML_t;
+
+typedef struct{
+ uint8_t version[3]; //GB/T version
+ uint8_t batteryType; //battery type
+ uint16_t batteryCapacity; // 0.1Ah/bit
+ uint16_t batteryVoltage; // 0.1V/bit
+ uint8_t batteryVendor[4]; // Battery vendor (ASCII string)
+ uint32_t batterySN; // int
+ uint8_t batteryManuY; // year (offset 1985)
+ uint8_t batteryManuM; // month
+ uint8_t batteryManuD; // day
+ uint32_t batteryCycleCount:24; //uint24_t
+ uint8_t ownAuto; // 0 = lizing, 1 = own auto
+ uint8_t rsvd0;
+ uint8_t EVIN[17]; //EVIN
+ uint8_t EV_SW_VER[8];
+
+}GBT_BRM_t;
+
+typedef struct {
+ uint16_t maxCellVoltage; // 0.01v/bit
+ uint16_t maxChargingCurrent; // 0.1A/bit
+ uint16_t totalEnergy; // 0.1kWh
+ uint16_t maxChargingVoltage; // 0.1V/ bit
+ uint8_t maxTemp; // 1C/bit, -50C offset
+ uint16_t SOC; // 0.1%/bit , 0..100%
+ uint16_t measVoltage; // 0.1V/bit
+}GBT_BCP_t;
+
+typedef struct {
+ uint16_t requestedVoltage; // 0.1V/bit
+ uint16_t requestedCurrent; // 0.1A/bit
+ uint8_t chargingMode; // 0x01 - CV, 0x02 - CC
+
+}GBT_BCL_t;
+
+typedef struct {
+ uint16_t measuredChargingVoltage;
+ uint16_t measuredChargingCurrent;
+ uint16_t highestVoltageOfBatteryCell;
+ uint8_t groupNrOfCellWithHighestVoltage;
+ uint16_t currentChargeState;
+ uint16_t estimatedRemainingChargingTime;
+
+}GBT_BCS_t;
+
+typedef struct {
+
+ uint8_t singleBatteryHighestVoltageSerNo;// SINGLE_BATTERY_HIGHEST_VOLTAGE_SER_NO
+ uint8_t batteryHighestTemp; //BATTERY_HIGHEST_TEMP
+ uint8_t batteryHighestTempSerNo;//BATTERY_HIGHEST_TEMP_SER_NO
+ uint8_t batteryLowestTemp;//BATTERY_LOWEST_TEMP
+ uint8_t batteryLowestTempSerNo;//BATTERY_LOWEST_TEMP_SER_NO
+ uint8_t batteryCellVoltageState;//BATTERY_CELL_VOLTAGE_STATE
+ uint8_t batteryStatus;//BATTERY_STATUS[bit-mask];
+
+}GBT_BSM_t;
+
+typedef struct {
+
+ uint16_t outputVoltage;
+ uint16_t outputCurrent;
+ uint16_t chargingTime;
+ uint16_t chargingPermissible;
+
+}GBT_CCS_t;
+
+
+typedef struct {
+ uint8_t enablePSU;
+ uint16_t requestedVoltage; // 0.1V/bit
+ uint16_t requestedCurrent; // 0.1A/bit
+ uint8_t chargingMode; // 0x01 - CV, 0x02 - CC
+ uint8_t chargingPercentage; //
+ uint16_t chargingRemainingTimeMin; //
+ uint16_t chargingElapsedTimeMin; //
+ uint8_t chargingElapsedTimeSec; //
+
+}GBT_EDCAN_Output_t;
+
+typedef struct {
+ uint8_t PSU_Status;
+ uint16_t measuredVoltage; // 0.1V/bit
+ uint16_t measuredCurrent; // 0.1A/bit
+
+
+}GBT_EDCAN_Input_t;
+
+/* 500 - Power Supply
+TX
+* PSU_ENABLE
+* BMS_STATUS
+* BMS_ERRORS
+* PSU_REQUESTED_VOLTAGE[2]
+* PSU_REQUESTED_CURRENT[2]
+* BMS_CHARGE_PERCENTAGE
+// BMS_MIN_CURRENT
+* CHARGE_REMAINING_TIME_MIN
+* CHARGE_REMAINING_TIME_SEC
+* CHARGE_ELAPSED_TIME[1]
+
+RX
+* MEASURED_VOLTAGE[2]
+* MEASURED_CURRENT[2]
+// MAX_VOLTAGE[2]
+// MAX_CURRENT[2]
+// MAX_POWER[2]
+* PSU_STATUS
+*
+*/
+
+#pragma pack(pop)
+
+extern ADC_HandleTypeDef hadc1;
+
+extern GBT_BRM_t GBT_EVInfo;
+extern GBT_BCP_t GBT_BATStat;
+extern GBT_BCS_t GBT_ChargingStatus;
+extern GBT_BCL_t GBT_ReqPower;
+extern GBT_CML_t GBT_MaxLoad;
+extern GBT_CCS_t GBT_ChargerCurrentStatus;
+extern GBT_CRM_t GBT_ChargerInfo;
+extern GBT_BSM_t GBT_BatteryStatus;
+
+extern uint8_t GBT_BRO;
+
+void GBT_Init();
+void GBT_Start();
+void GBT_Stop();
+void GBT_Stop1();
+void GBT_ChargerTask();
+float GBT_CC_GetAdc();
+void ADC_Select_Channel(uint32_t ch);
+uint8_t GBT_CC_GetState();
+void GBT_SwitchState(gbtState_t state);
+void GBT_Delay(uint32_t delay);
+uint32_t GBT_StateTick();
+void J_SendPacket(uint32_t PGN, uint8_t pri, uint8_t DLC, uint8_t *data);
+
+void GBT_SendCCS();
+void GBT_SendCST();
+void GBT_SendCRO(uint8_t state);
+void GBT_SendCML();
+void GBT_SendCTS();
+void GBT_SendCHM();
+void GBT_SendCRM(uint8_t state);
+
+
+
+#endif /* INC_CHARGER_GBT_H_ */
diff --git a/Core/Inc/debug.h b/Core/Inc/debug.h
new file mode 100644
index 0000000..1543b68
--- /dev/null
+++ b/Core/Inc/debug.h
@@ -0,0 +1,16 @@
+/*
+ * debug.h
+ *
+ * Created on: Apr 16, 2024
+ * Author: colorbass
+ */
+
+#ifndef SRC_DEBUG_H_
+#define SRC_DEBUG_H_
+
+void debug_task();
+void debug_init();
+void debug_rx_interrupt(UART_HandleTypeDef *huart, uint16_t Size);
+
+
+#endif /* SRC_DEBUG_H_ */
diff --git a/Core/Inc/edcan_config.h b/Core/Inc/edcan_config.h
new file mode 100644
index 0000000..8e49fbd
--- /dev/null
+++ b/Core/Inc/edcan_config.h
@@ -0,0 +1,13 @@
+//
+// Created by Артём Чамайкин on 20.07.2024.
+//
+
+#ifndef EDCAN_CONFIG_H
+#define EDCAN_CONFIG_H
+
+#define DEVICE_ID 0x20
+#define FWVER 1
+//#define ED_CAN1
+#define ED_CAN2
+
+#endif //EDCAN_CONFIG_H
diff --git a/Core/Inc/gpio.h b/Core/Inc/gpio.h
new file mode 100644
index 0000000..e55ab97
--- /dev/null
+++ b/Core/Inc/gpio.h
@@ -0,0 +1,49 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file gpio.h
+ * @brief This file contains all the function prototypes for
+ * the gpio.c file
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __GPIO_H__
+#define __GPIO_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+void MX_GPIO_Init(void);
+
+/* USER CODE BEGIN Prototypes */
+
+/* USER CODE END Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*__ GPIO_H__ */
+
diff --git a/Core/Inc/j1939.h b/Core/Inc/j1939.h
new file mode 100644
index 0000000..ff65f51
--- /dev/null
+++ b/Core/Inc/j1939.h
@@ -0,0 +1,39 @@
+/*
+ * j1939.h
+ *
+ * Created on: May 3, 2024
+ * Author: colorbass
+ */
+
+#ifndef INC_J1939_H_
+#define INC_J1939_H_
+
+#define J_ID_SE 0x56
+#define J_ID_EV 0xF4
+
+#include "main.h"
+
+extern CAN_HandleTypeDef hcan1;
+
+typedef struct{
+ uint8_t data[256]; //data array
+ uint32_t PGN; //received PGN
+ uint16_t size;
+ uint8_t packets;
+ uint8_t packet;
+ uint8_t step;
+ uint8_t step_cts_remain;
+ uint8_t state; //(0 = standby, 1= receiving)
+ uint32_t tick;
+}j_receive_t;
+
+extern j_receive_t j_rx;
+
+
+void J_SendCTS(j_receive_t rx);
+void J_SendACK(j_receive_t rx);
+
+
+void GBT_CAN_ReInit();
+
+#endif /* INC_J1939_H_ */
diff --git a/Core/Inc/main.h b/Core/Inc/main.h
new file mode 100644
index 0000000..a23c6d7
--- /dev/null
+++ b/Core/Inc/main.h
@@ -0,0 +1,91 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.h
+ * @brief : Header for main.c file.
+ * This file contains the common defines of the application.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f1xx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+#define ADC_CC1_Pin GPIO_PIN_6
+#define ADC_CC1_GPIO_Port GPIOA
+#define LOCK_A_Pin GPIO_PIN_4
+#define LOCK_A_GPIO_Port GPIOC
+#define LOCK_B_Pin GPIO_PIN_5
+#define LOCK_B_GPIO_Port GPIOC
+#define ADC_NTC1_Pin GPIO_PIN_0
+#define ADC_NTC1_GPIO_Port GPIOB
+#define ADC_NTC2_Pin GPIO_PIN_1
+#define ADC_NTC2_GPIO_Port GPIOB
+#define LOCK_FB_Pin GPIO_PIN_9
+#define LOCK_FB_GPIO_Port GPIOE
+#define ADDR_0_Pin GPIO_PIN_10
+#define ADDR_0_GPIO_Port GPIOE
+#define ADDR_1_Pin GPIO_PIN_11
+#define ADDR_1_GPIO_Port GPIOE
+#define RELAY_CC_Pin GPIO_PIN_15
+#define RELAY_CC_GPIO_Port GPIOE
+#define USART2_DIR_Pin GPIO_PIN_4
+#define USART2_DIR_GPIO_Port GPIOD
+#define RELAY_AUX_Pin GPIO_PIN_4
+#define RELAY_AUX_GPIO_Port GPIOB
+
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
diff --git a/Core/Inc/soft_rtc.h b/Core/Inc/soft_rtc.h
new file mode 100644
index 0000000..72e048a
--- /dev/null
+++ b/Core/Inc/soft_rtc.h
@@ -0,0 +1,19 @@
+/*
+ * soft_rtc.h
+ *
+ * Created on: Jul 22, 2024
+ * Author: colorbass
+ */
+
+#ifndef INC_SOFT_RTC_H_
+#define INC_SOFT_RTC_H_
+
+#include "main.h"
+
+uint32_t get_Current_Time();
+void set_Time(uint32_t unix_time);
+void unix_to_bcd(uint32_t unix_time, uint8_t *time);
+void writeTimeReg(uint8_t reg_number, uint8_t value);
+uint8_t getTimeReg(uint8_t reg_number);
+
+#endif /* INC_SOFT_RTC_H_ */
diff --git a/Core/Inc/stm32f1xx_hal_conf.h b/Core/Inc/stm32f1xx_hal_conf.h
new file mode 100644
index 0000000..40b0e5e
--- /dev/null
+++ b/Core/Inc/stm32f1xx_hal_conf.h
@@ -0,0 +1,391 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f1xx_hal_conf.h
+ * @brief HAL configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2017 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F1xx_HAL_CONF_H
+#define __STM32F1xx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+
+#define HAL_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+/*#define HAL_CRYP_MODULE_ENABLED */
+#define HAL_CAN_MODULE_ENABLED
+/*#define HAL_CAN_LEGACY_MODULE_ENABLED */
+/*#define HAL_CEC_MODULE_ENABLED */
+/*#define HAL_CORTEX_MODULE_ENABLED */
+/*#define HAL_CRC_MODULE_ENABLED */
+/*#define HAL_DAC_MODULE_ENABLED */
+/*#define HAL_DMA_MODULE_ENABLED */
+/*#define HAL_ETH_MODULE_ENABLED */
+/*#define HAL_FLASH_MODULE_ENABLED */
+#define HAL_GPIO_MODULE_ENABLED
+/*#define HAL_I2C_MODULE_ENABLED */
+/*#define HAL_I2S_MODULE_ENABLED */
+/*#define HAL_IRDA_MODULE_ENABLED */
+/*#define HAL_IWDG_MODULE_ENABLED */
+/*#define HAL_NOR_MODULE_ENABLED */
+/*#define HAL_NAND_MODULE_ENABLED */
+/*#define HAL_PCCARD_MODULE_ENABLED */
+/*#define HAL_PCD_MODULE_ENABLED */
+/*#define HAL_HCD_MODULE_ENABLED */
+/*#define HAL_PWR_MODULE_ENABLED */
+/*#define HAL_RCC_MODULE_ENABLED */
+/*#define HAL_RTC_MODULE_ENABLED */
+/*#define HAL_SD_MODULE_ENABLED */
+/*#define HAL_MMC_MODULE_ENABLED */
+/*#define HAL_SDRAM_MODULE_ENABLED */
+/*#define HAL_SMARTCARD_MODULE_ENABLED */
+/*#define HAL_SPI_MODULE_ENABLED */
+/*#define HAL_SRAM_MODULE_ENABLED */
+/*#define HAL_TIM_MODULE_ENABLED */
+#define HAL_UART_MODULE_ENABLED
+/*#define HAL_USART_MODULE_ENABLED */
+/*#define HAL_WWDG_MODULE_ENABLED */
+
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_EXTI_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+
+/* ########################## Oscillator Values adaptation ####################*/
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI) value.
+ */
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE 40000U /*!< LSI Typical Value in Hz */
+#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature. */
+
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ * This value is used by the UART, RTC HAL module to compute the system frequency
+ */
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
+#endif /* LSE_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+ #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
+#endif /* LSE_STARTUP_TIMEOUT */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+#define VDD_VALUE 3300U /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY 15U /*!< tick interrupt priority (lowest by default) */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
+#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
+#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
+#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
+#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
+#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
+#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
+#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
+#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
+#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
+#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
+#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
+#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
+#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
+#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## Ethernet peripheral configuration ##################### */
+
+/* Section 1 : Ethernet peripheral configuration */
+
+/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
+#define MAC_ADDR0 2U
+#define MAC_ADDR1 0U
+#define MAC_ADDR2 0U
+#define MAC_ADDR3 0U
+#define MAC_ADDR4 0U
+#define MAC_ADDR5 0U
+
+/* Definition of the Ethernet driver buffers size and count */
+#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
+#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
+#define ETH_RXBUFNB 8U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
+#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
+
+/* Section 2: PHY configuration section */
+
+/* DP83848_PHY_ADDRESS Address*/
+#define DP83848_PHY_ADDRESS 0x01U
+/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
+#define PHY_RESET_DELAY 0x000000FFU
+/* PHY Configuration delay */
+#define PHY_CONFIG_DELAY 0x00000FFFU
+
+#define PHY_READ_TO 0x0000FFFFU
+#define PHY_WRITE_TO 0x0000FFFFU
+
+/* Section 3: Common PHY Registers */
+
+#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
+#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
+
+#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
+#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
+#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
+#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
+#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
+#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
+#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
+#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
+#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
+#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
+
+#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
+#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
+#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
+
+/* Section 4: Extended PHY Registers */
+#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */
+
+#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */
+#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+* Activated: CRC code is present inside driver
+* Deactivated: CRC code cleaned from driver
+*/
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+#include "stm32f1xx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+#include "stm32f1xx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+#include "stm32f1xx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_DMA_MODULE_ENABLED
+#include "stm32f1xx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_ETH_MODULE_ENABLED
+#include "stm32f1xx_hal_eth.h"
+#endif /* HAL_ETH_MODULE_ENABLED */
+
+#ifdef HAL_CAN_MODULE_ENABLED
+#include "stm32f1xx_hal_can.h"
+#endif /* HAL_CAN_MODULE_ENABLED */
+
+#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
+ #include "Legacy/stm32f1xx_hal_can_legacy.h"
+#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
+
+#ifdef HAL_CEC_MODULE_ENABLED
+#include "stm32f1xx_hal_cec.h"
+#endif /* HAL_CEC_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+#include "stm32f1xx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+#include "stm32f1xx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+#include "stm32f1xx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_DAC_MODULE_ENABLED
+#include "stm32f1xx_hal_dac.h"
+#endif /* HAL_DAC_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+#include "stm32f1xx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_SRAM_MODULE_ENABLED
+#include "stm32f1xx_hal_sram.h"
+#endif /* HAL_SRAM_MODULE_ENABLED */
+
+#ifdef HAL_NOR_MODULE_ENABLED
+#include "stm32f1xx_hal_nor.h"
+#endif /* HAL_NOR_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+#include "stm32f1xx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_I2S_MODULE_ENABLED
+#include "stm32f1xx_hal_i2s.h"
+#endif /* HAL_I2S_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+#include "stm32f1xx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+#include "stm32f1xx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+#include "stm32f1xx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_PCCARD_MODULE_ENABLED
+#include "stm32f1xx_hal_pccard.h"
+#endif /* HAL_PCCARD_MODULE_ENABLED */
+
+#ifdef HAL_SD_MODULE_ENABLED
+#include "stm32f1xx_hal_sd.h"
+#endif /* HAL_SD_MODULE_ENABLED */
+
+#ifdef HAL_NAND_MODULE_ENABLED
+#include "stm32f1xx_hal_nand.h"
+#endif /* HAL_NAND_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+#include "stm32f1xx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+#include "stm32f1xx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+#include "stm32f1xx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+#include "stm32f1xx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+#include "stm32f1xx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+#include "stm32f1xx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+#include "stm32f1xx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+#include "stm32f1xx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_HCD_MODULE_ENABLED
+#include "stm32f1xx_hal_hcd.h"
+#endif /* HAL_HCD_MODULE_ENABLED */
+
+#ifdef HAL_MMC_MODULE_ENABLED
+#include "stm32f1xx_hal_mmc.h"
+#endif /* HAL_MMC_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+void assert_failed(uint8_t* file, uint32_t line);
+#else
+#define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F1xx_HAL_CONF_H */
+
diff --git a/Core/Inc/stm32f1xx_it.h b/Core/Inc/stm32f1xx_it.h
new file mode 100644
index 0000000..afbaefe
--- /dev/null
+++ b/Core/Inc/stm32f1xx_it.h
@@ -0,0 +1,70 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f1xx_it.h
+ * @brief This file contains the headers of the interrupt handlers.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F1xx_IT_H
+#define __STM32F1xx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+void CAN1_RX0_IRQHandler(void);
+void USART2_IRQHandler(void);
+void CAN2_TX_IRQHandler(void);
+void CAN2_RX1_IRQHandler(void);
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F1xx_IT_H */
diff --git a/Core/Inc/usart.h b/Core/Inc/usart.h
new file mode 100644
index 0000000..731e3b0
--- /dev/null
+++ b/Core/Inc/usart.h
@@ -0,0 +1,52 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file usart.h
+ * @brief This file contains all the function prototypes for
+ * the usart.c file
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __USART_H__
+#define __USART_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+extern UART_HandleTypeDef huart2;
+
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+void MX_USART2_UART_Init(void);
+
+/* USER CODE BEGIN Prototypes */
+
+/* USER CODE END Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __USART_H__ */
+
diff --git a/Core/Src/.DS_Store b/Core/Src/.DS_Store
new file mode 100644
index 0000000..82f6282
Binary files /dev/null and b/Core/Src/.DS_Store differ
diff --git a/Core/Src/adc.c b/Core/Src/adc.c
new file mode 100644
index 0000000..69db07a
--- /dev/null
+++ b/Core/Src/adc.c
@@ -0,0 +1,133 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file adc.c
+ * @brief This file provides code for the configuration
+ * of the ADC instances.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Includes ------------------------------------------------------------------*/
+#include "adc.h"
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+ADC_HandleTypeDef hadc1;
+
+/* ADC1 init function */
+void MX_ADC1_Init(void)
+{
+
+ /* USER CODE BEGIN ADC1_Init 0 */
+
+ /* USER CODE END ADC1_Init 0 */
+
+ ADC_ChannelConfTypeDef sConfig = {0};
+
+ /* USER CODE BEGIN ADC1_Init 1 */
+
+ /* USER CODE END ADC1_Init 1 */
+
+ /** Common config
+ */
+ hadc1.Instance = ADC1;
+ hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE;
+ hadc1.Init.ContinuousConvMode = DISABLE;
+ hadc1.Init.DiscontinuousConvMode = DISABLE;
+ hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
+ hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
+ hadc1.Init.NbrOfConversion = 1;
+ if (HAL_ADC_Init(&hadc1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ /** Configure Regular Channel
+ */
+ sConfig.Channel = ADC_CHANNEL_8;
+ sConfig.Rank = ADC_REGULAR_RANK_1;
+ sConfig.SamplingTime = ADC_SAMPLETIME_1CYCLE_5;
+ if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN ADC1_Init 2 */
+
+ /* USER CODE END ADC1_Init 2 */
+
+}
+
+void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle)
+{
+
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(adcHandle->Instance==ADC1)
+ {
+ /* USER CODE BEGIN ADC1_MspInit 0 */
+
+ /* USER CODE END ADC1_MspInit 0 */
+ /* ADC1 clock enable */
+ __HAL_RCC_ADC1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**ADC1 GPIO Configuration
+ PA6 ------> ADC1_IN6
+ PB0 ------> ADC1_IN8
+ PB1 ------> ADC1_IN9
+ */
+ GPIO_InitStruct.Pin = ADC_CC1_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
+ HAL_GPIO_Init(ADC_CC1_GPIO_Port, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = ADC_NTC1_Pin|ADC_NTC2_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /* USER CODE BEGIN ADC1_MspInit 1 */
+
+ /* USER CODE END ADC1_MspInit 1 */
+ }
+}
+
+void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle)
+{
+
+ if(adcHandle->Instance==ADC1)
+ {
+ /* USER CODE BEGIN ADC1_MspDeInit 0 */
+
+ /* USER CODE END ADC1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_ADC1_CLK_DISABLE();
+
+ /**ADC1 GPIO Configuration
+ PA6 ------> ADC1_IN6
+ PB0 ------> ADC1_IN8
+ PB1 ------> ADC1_IN9
+ */
+ HAL_GPIO_DeInit(ADC_CC1_GPIO_Port, ADC_CC1_Pin);
+
+ HAL_GPIO_DeInit(GPIOB, ADC_NTC1_Pin|ADC_NTC2_Pin);
+
+ /* USER CODE BEGIN ADC1_MspDeInit 1 */
+
+ /* USER CODE END ADC1_MspDeInit 1 */
+ }
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
diff --git a/Core/Src/board.c b/Core/Src/board.c
new file mode 100644
index 0000000..86a017c
--- /dev/null
+++ b/Core/Src/board.c
@@ -0,0 +1,92 @@
+/*
+ * board.c
+ *
+ * Created on: Apr 15, 2024
+ * Author: colorbass
+ */
+#include "main.h"
+#include "board.h"
+
+extern ADC_HandleTypeDef hadc1;
+
+//TODO:
+//TEMP READ
+//LOCK_FB
+//GBT_TEMP_SENSORS
+//USB
+
+void GBT_Lock(uint8_t state){
+ if(state){//LOCK
+ HAL_GPIO_WritePin(LOCK_A_GPIO_Port, LOCK_A_Pin, 1);
+ HAL_Delay(50);
+ HAL_GPIO_WritePin(LOCK_A_GPIO_Port, LOCK_A_Pin, 0);
+ }else{ //UNLOCK
+ HAL_GPIO_WritePin(LOCK_B_GPIO_Port, LOCK_B_Pin, 1);
+ HAL_Delay(50);
+ HAL_GPIO_WritePin(LOCK_B_GPIO_Port, LOCK_B_Pin, 0);
+ }
+}
+uint8_t GBT_LockGetState(){
+ return HAL_GPIO_ReadPin(LOCK_FB_GPIO_Port, LOCK_FB_Pin);
+
+}
+
+
+void RELAY_Write(relay_t num, uint8_t state){
+ if(num==RELAY_AUX)HAL_GPIO_WritePin(RELAY_AUX_GPIO_Port, RELAY_AUX_Pin, state);
+ if(num==RELAY_CC)HAL_GPIO_WritePin(RELAY_CC_GPIO_Port, RELAY_CC_Pin, state);
+
+}
+
+uint8_t GetBoardTemp(){
+ //TODO
+// HAL_ADC_Start(&hadc1); // start the adc
+//
+// HAL_ADC_PollForConversion(&hadc1, 100); // poll for conversion
+//
+// adc_val = HAL_ADC_GetValue(&hadc1); // get the adc value
+//
+// HAL_ADC_Stop(&hadc1); // stop adc
+ return 0;
+}
+
+void Init_Peripheral(){
+ HAL_ADCEx_Calibration_Start(&hadc1);
+ RELAY_Write(RELAY_AUX, 0);
+ RELAY_Write(RELAY_CC, 1);
+
+}
+
+uint8_t GBT_ReadTemp(){
+ //TODO
+ return 0;
+}
+
+void ADC_Select_Channel(uint32_t ch) {
+ ADC_ChannelConfTypeDef conf = {
+ .Channel = ch,
+ .Rank = 1,
+ .SamplingTime = ADC_SAMPLETIME_28CYCLES_5,
+ };
+ if (HAL_ADC_ConfigChannel(&hadc1, &conf) != HAL_OK) {
+ Error_Handler();
+ }
+}
+
+uint8_t SW_GetAddr(){
+ if(!HAL_GPIO_ReadPin(ADDR_0_GPIO_Port, ADDR_0_Pin)){
+ if(!HAL_GPIO_ReadPin(ADDR_1_GPIO_Port, ADDR_1_Pin)){
+ return 0x23;
+ }else{
+ return 0x21;
+ }
+
+ }else{
+ if(!HAL_GPIO_ReadPin(ADDR_1_GPIO_Port, ADDR_1_Pin)){
+ return 0x22;
+ }else{
+ return 0x20;
+ }
+
+ }
+}
diff --git a/Core/Src/can.c b/Core/Src/can.c
new file mode 100644
index 0000000..53963ac
--- /dev/null
+++ b/Core/Src/can.c
@@ -0,0 +1,231 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file can.c
+ * @brief This file provides code for the configuration
+ * of the CAN instances.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Includes ------------------------------------------------------------------*/
+#include "can.h"
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+CAN_HandleTypeDef hcan1;
+CAN_HandleTypeDef hcan2;
+
+/* CAN1 init function */
+void MX_CAN1_Init(void)
+{
+
+ /* USER CODE BEGIN CAN1_Init 0 */
+
+ /* USER CODE END CAN1_Init 0 */
+
+ /* USER CODE BEGIN CAN1_Init 1 */
+
+ /* USER CODE END CAN1_Init 1 */
+ hcan1.Instance = CAN1;
+ hcan1.Init.Prescaler = 8;
+ hcan1.Init.Mode = CAN_MODE_NORMAL;
+ hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
+ hcan1.Init.TimeSeg1 = CAN_BS1_15TQ;
+ hcan1.Init.TimeSeg2 = CAN_BS2_2TQ;
+ hcan1.Init.TimeTriggeredMode = DISABLE;
+ hcan1.Init.AutoBusOff = ENABLE;
+ hcan1.Init.AutoWakeUp = ENABLE;
+ hcan1.Init.AutoRetransmission = DISABLE;
+ hcan1.Init.ReceiveFifoLocked = DISABLE;
+ hcan1.Init.TransmitFifoPriority = ENABLE;
+ if (HAL_CAN_Init(&hcan1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN CAN1_Init 2 */
+
+ /* USER CODE END CAN1_Init 2 */
+
+}
+/* CAN2 init function */
+void MX_CAN2_Init(void)
+{
+
+ /* USER CODE BEGIN CAN2_Init 0 */
+
+ /* USER CODE END CAN2_Init 0 */
+
+ /* USER CODE BEGIN CAN2_Init 1 */
+
+ /* USER CODE END CAN2_Init 1 */
+ hcan2.Instance = CAN2;
+ hcan2.Init.Prescaler = 16;
+ hcan2.Init.Mode = CAN_MODE_NORMAL;
+ hcan2.Init.SyncJumpWidth = CAN_SJW_1TQ;
+ hcan2.Init.TimeSeg1 = CAN_BS1_15TQ;
+ hcan2.Init.TimeSeg2 = CAN_BS2_2TQ;
+ hcan2.Init.TimeTriggeredMode = DISABLE;
+ hcan2.Init.AutoBusOff = ENABLE;
+ hcan2.Init.AutoWakeUp = ENABLE;
+ hcan2.Init.AutoRetransmission = DISABLE;
+ hcan2.Init.ReceiveFifoLocked = DISABLE;
+ hcan2.Init.TransmitFifoPriority = ENABLE;
+ if (HAL_CAN_Init(&hcan2) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN CAN2_Init 2 */
+
+ /* USER CODE END CAN2_Init 2 */
+
+}
+
+static uint32_t HAL_RCC_CAN1_CLK_ENABLED=0;
+
+void HAL_CAN_MspInit(CAN_HandleTypeDef* canHandle)
+{
+
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(canHandle->Instance==CAN1)
+ {
+ /* USER CODE BEGIN CAN1_MspInit 0 */
+
+ /* USER CODE END CAN1_MspInit 0 */
+ /* CAN1 clock enable */
+ HAL_RCC_CAN1_CLK_ENABLED++;
+ if(HAL_RCC_CAN1_CLK_ENABLED==1){
+ __HAL_RCC_CAN1_CLK_ENABLE();
+ }
+
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+ /**CAN1 GPIO Configuration
+ PD0 ------> CAN1_RX
+ PD1 ------> CAN1_TX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_0;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_1;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+
+ __HAL_AFIO_REMAP_CAN1_3();
+
+ /* CAN1 interrupt Init */
+ HAL_NVIC_SetPriority(CAN1_RX0_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(CAN1_RX0_IRQn);
+ /* USER CODE BEGIN CAN1_MspInit 1 */
+
+ /* USER CODE END CAN1_MspInit 1 */
+ }
+ else if(canHandle->Instance==CAN2)
+ {
+ /* USER CODE BEGIN CAN2_MspInit 0 */
+
+ /* USER CODE END CAN2_MspInit 0 */
+ /* CAN2 clock enable */
+ __HAL_RCC_CAN2_CLK_ENABLE();
+ HAL_RCC_CAN1_CLK_ENABLED++;
+ if(HAL_RCC_CAN1_CLK_ENABLED==1){
+ __HAL_RCC_CAN1_CLK_ENABLE();
+ }
+
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ /**CAN2 GPIO Configuration
+ PB5 ------> CAN2_RX
+ PB6 ------> CAN2_TX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_5;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ __HAL_AFIO_REMAP_CAN2_ENABLE();
+
+ /* CAN2 interrupt Init */
+ HAL_NVIC_SetPriority(CAN2_TX_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(CAN2_TX_IRQn);
+ HAL_NVIC_SetPriority(CAN2_RX1_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(CAN2_RX1_IRQn);
+ /* USER CODE BEGIN CAN2_MspInit 1 */
+
+ /* USER CODE END CAN2_MspInit 1 */
+ }
+}
+
+void HAL_CAN_MspDeInit(CAN_HandleTypeDef* canHandle)
+{
+
+ if(canHandle->Instance==CAN1)
+ {
+ /* USER CODE BEGIN CAN1_MspDeInit 0 */
+
+ /* USER CODE END CAN1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ HAL_RCC_CAN1_CLK_ENABLED--;
+ if(HAL_RCC_CAN1_CLK_ENABLED==0){
+ __HAL_RCC_CAN1_CLK_DISABLE();
+ }
+
+ /**CAN1 GPIO Configuration
+ PD0 ------> CAN1_RX
+ PD1 ------> CAN1_TX
+ */
+ HAL_GPIO_DeInit(GPIOD, GPIO_PIN_0|GPIO_PIN_1);
+
+ /* CAN1 interrupt Deinit */
+ HAL_NVIC_DisableIRQ(CAN1_RX0_IRQn);
+ /* USER CODE BEGIN CAN1_MspDeInit 1 */
+
+ /* USER CODE END CAN1_MspDeInit 1 */
+ }
+ else if(canHandle->Instance==CAN2)
+ {
+ /* USER CODE BEGIN CAN2_MspDeInit 0 */
+
+ /* USER CODE END CAN2_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_CAN2_CLK_DISABLE();
+ HAL_RCC_CAN1_CLK_ENABLED--;
+ if(HAL_RCC_CAN1_CLK_ENABLED==0){
+ __HAL_RCC_CAN1_CLK_DISABLE();
+ }
+
+ /**CAN2 GPIO Configuration
+ PB5 ------> CAN2_RX
+ PB6 ------> CAN2_TX
+ */
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_5|GPIO_PIN_6);
+
+ /* CAN2 interrupt Deinit */
+ HAL_NVIC_DisableIRQ(CAN2_TX_IRQn);
+ HAL_NVIC_DisableIRQ(CAN2_RX1_IRQn);
+ /* USER CODE BEGIN CAN2_MspDeInit 1 */
+
+ /* USER CODE END CAN2_MspDeInit 1 */
+ }
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
diff --git a/Core/Src/charger_gbt.c b/Core/Src/charger_gbt.c
new file mode 100644
index 0000000..b154bbd
--- /dev/null
+++ b/Core/Src/charger_gbt.c
@@ -0,0 +1,366 @@
+/*
+ * charger_gbt.c
+ *
+ * Created on: Apr 18, 2024
+ * Author: colorbass
+ */
+
+
+#include "charger_gbt.h"
+#include "main.h"
+#include "board.h"
+#include "stdio.h"
+#include "j1939.h"
+#include "string.h"
+#include "edcan.h"
+
+gbtState_t GBT_State;
+uint32_t GBT_state_tick; //Tick after state switch
+uint32_t GBT_delay;
+uint8_t GBT_BAT_INFO_recv;
+uint8_t GBT_BAT_STAT_recv;
+uint8_t EV_ready;
+
+GBT_BHM_t GBT_MaxVoltage;
+GBT_CML_t GBT_MaxLoad;
+GBT_CRM_t GBT_ChargerInfo;
+
+GBT_BRM_t GBT_EVInfo;
+GBT_BCP_t GBT_BATStat;
+GBT_BCL_t GBT_ReqPower;
+GBT_BCL_t GBT_CurrPower;
+
+GBT_BCS_t GBT_ChargingStatus;
+
+GBT_BSM_t GBT_BatteryStatus;
+
+GBT_CCS_t GBT_ChargerCurrentStatus;
+
+uint8_t GBT_BRO;
+
+extern GBT_EDCAN_Output_t GBT_EDCAN_Output;
+
+
+void GBT_Init(){
+ GBT_State = GBT_DISABLED;
+ GBT_Lock(0);
+}
+
+uint8_t GBT_CC_GetState(){
+ //Vref=3.3v = 4095
+ //k=1/11
+ //Vin = 12v
+ //Vin*k= 1.09v
+ //12vin = 1353 ADC
+//TODO: Filter 100ms
+ uint32_t adc;
+ float volt;
+ ADC_Select_Channel(ADC_CHANNEL_6);
+ HAL_ADC_Start(&hadc1);
+ HAL_ADC_PollForConversion(&hadc1, 100);
+ adc = HAL_ADC_GetValue(&hadc1);
+ HAL_ADC_Stop(&hadc1);
+
+ volt = (float)adc/113.4f;
+ if((volt<12.6f) && (volt>11.4f)) return GBT_CC_12V;
+ if((volt<6.8f) && (volt>5.2f)) return GBT_CC_6V;
+ if((volt<4.8f) && (volt>3.2f)) return GBT_CC_4V;
+ if((volt<2.8f) && (volt>1.2f)) return GBT_CC_2V;
+ return GBT_CC_UNKNOWN;
+}
+
+float GBT_CC_GetAdc(){
+ //Vref=3.3v = 4095
+ //k=1/11
+ //Vin = 12v
+ //Vin*k= 1.09v
+ //12vin = 1353 ADC
+
+ uint32_t adc;
+ float volt;
+ ADC_Select_Channel(ADC_CHANNEL_6);
+ HAL_ADC_Start(&hadc1);
+ HAL_ADC_PollForConversion(&hadc1, 100);
+ adc = HAL_ADC_GetValue(&hadc1);
+ HAL_ADC_Stop(&hadc1);
+
+ volt = (float)adc/113.4f;
+
+ return volt;
+}
+
+void GBT_ChargerTask(){
+
+ if(j_rx.state == 2){
+ switch (j_rx.PGN){
+ case 0x2700: //PGN BHM
+ memcpy (&GBT_MaxVoltage, j_rx.data, sizeof(GBT_MaxVoltage));
+
+ break;
+
+ case 0x0200: //PGN BRM LONG
+ GBT_BAT_INFO_recv = 1;
+ memcpy (&GBT_EVInfo, j_rx.data, sizeof(GBT_EVInfo));
+
+ break;
+
+ case 0x0600: //PGN BCP LONG
+ GBT_BAT_STAT_recv = 1;
+ memcpy (&GBT_BATStat, j_rx.data, sizeof(GBT_BATStat));
+ break;
+
+ case 0x0900: //PGN BRO
+ if(j_rx.data[0] == 0xAA) EV_ready = 1;
+ else EV_ready = 0;
+ GBT_BRO = j_rx.data[0];
+ break;
+
+ case 0x1000: //PGN BCL
+ //TODO: power block
+ memcpy (&GBT_ReqPower, j_rx.data, sizeof(GBT_ReqPower));
+ uint16_t volt=GBT_ReqPower.requestedVoltage/10;
+ GBT_EDCAN_Output.requestedVoltage = volt;
+ uint16_t curr=(4000-GBT_ReqPower.requestedCurrent);
+ GBT_EDCAN_Output.requestedCurrent = curr;
+ break;
+
+ case 0x1100: //PGN BCS
+ //TODO
+ memcpy (&GBT_ChargingStatus, j_rx.data, sizeof(GBT_ChargingStatus));
+ GBT_EDCAN_Output.chargingRemainingTimeMin = GBT_ChargingStatus.estimatedRemainingChargingTime;
+ GBT_EDCAN_Output.chargingPercentage = GBT_ChargingStatus.currentChargeState;
+ break;
+
+ case 0x1300: //PGN BSM
+ //TODO
+ memcpy (&GBT_BatteryStatus, j_rx.data, sizeof(GBT_BatteryStatus));
+ break;
+
+ case 0x1500: //PGN BMV
+ //TODO
+ break;
+
+ case 0x1600: //PGN BMT
+ //TODO
+ break;
+
+ case 0x1700: //PGN BSP
+ //TODO
+ break;
+
+
+ //BSM BMV BMT BSP BST BSD BEM
+
+ }
+ j_rx.state = 0;
+ }
+
+ if(GBT_delay>HAL_GetTick()){
+ //waiting
+ }else switch (GBT_State){
+ case GBT_DISABLED:
+
+ break;
+ case GBT_S0_UNCONNECTED:
+ if(GBT_CC_GetState()==GBT_CC_4V){
+
+ GBT_SwitchState(GBT_S1_CONNECTED);
+ GBT_Delay(500);
+ }
+ break;
+ case GBT_S1_CONNECTED:
+ if(GBT_CC_GetState()==GBT_CC_4V){
+
+ GBT_Lock(1);
+ GBT_SwitchState(GBT_S2_LOCKED);
+ GBT_Delay(500);
+ }else{
+ GBT_SwitchState(GBT_S0_UNCONNECTED);
+ }
+ break;
+ case GBT_S2_LOCKED:
+ if(1){ //TODO: charge permission
+ RELAY_Write(RELAY_AUX, 1); // 13.8V AUX ON
+ GBT_SwitchState(GBT_S3_STARTED);
+ GBT_Delay(500);
+ }
+ break;
+
+ case GBT_S3_STARTED:
+ GBT_SwitchState(GBT_S4_ISOTEST);
+ GBT_Delay(500);
+ break;
+
+ case GBT_S4_ISOTEST:
+ if(j_rx.state == 0) GBT_SendCHM();
+ GBT_Delay(250);
+ //TODO: Isolation test
+ //TODO: Timeout
+ if(GBT_StateTick()>1500){
+ //Isolation test finish
+ GBT_SwitchState(GBT_S5_BAT_INFO);
+ }
+ break;
+
+ case GBT_S5_BAT_INFO:
+ if(j_rx.state == 0) GBT_SendCRM(0x00);
+ GBT_Delay(250);
+ if(GBT_BAT_INFO_recv){
+ //Got battery info
+ GBT_SwitchState(GBT_S6_BAT_STAT);
+ }
+ break;
+
+ case GBT_S6_BAT_STAT:
+ if(j_rx.state == 0) GBT_SendCRM(0xAA);
+ GBT_Delay(250);
+ if(GBT_BAT_STAT_recv){
+ //Got battery status
+ GBT_SwitchState(GBT_S7_BMS_WAIT);
+ }
+ break;
+
+ case GBT_S7_BMS_WAIT:
+ if(j_rx.state == 0) GBT_SendCTS();
+ HAL_Delay(2);
+ if(j_rx.state == 0) GBT_SendCML();
+ GBT_Delay(250);
+ if(EV_ready){
+ //EV ready (AA)
+ GBT_SwitchState(GBT_S8_INIT_CHARGER);
+ }
+ break;
+
+ case GBT_S8_INIT_CHARGER:
+ if(j_rx.state == 0) GBT_SendCRO(0x00);
+ //TODO
+ GBT_Delay(250);
+ if(GBT_StateTick()>1500){
+ //Power Modules initiated
+ GBT_SwitchState(GBT_S9_WAIT_BCL);
+ }
+ break;
+
+ case GBT_S9_WAIT_BCL:
+ if(j_rx.state == 0) GBT_SendCRO(0xAA);
+ GBT_Delay(250);
+ if(GBT_ReqPower.chargingMode != 0){
+ //BCL power requirements received
+ //write power modules
+ GBT_SwitchState(GBT_S10_CHARGING);
+ uint16_t curr=(4000-GBT_ReqPower.requestedCurrent);
+ uint16_t volt=GBT_ReqPower.requestedVoltage/10;
+ //if ((curr10>0) && (curr10<500));
+ //PSU_SetVoltage(volt);
+ //PSU_SetCurrent(curr);
+ GBT_EDCAN_Output.requestedVoltage = volt;
+ GBT_EDCAN_Output.requestedCurrent = curr;
+ GBT_EDCAN_Output.enablePSU = 1;
+
+
+ //TODO: EDCAN_SendPacketRead
+
+ //смещение -400а
+ //RELAY_Write(RELAY_3, 1);
+ //PSU_Mode(0x0200);
+ }
+ break;
+
+ case GBT_S10_CHARGING:
+ //CHARGING
+ if(j_rx.state == 0) GBT_SendCCS();
+ // write power modules
+
+
+// if(mm_queue_size()==0){//TODO: hysteresis, charging mode
+// if(GBT_CurrPower.requestedCurrent != GBT_ReqPower.requestedCurrent){
+// GBT_CurrPower.requestedCurrent = GBT_ReqPower.requestedCurrent;
+// //PSU_SetVoltage(GBT_ReqPower.requestedVoltage/10);
+// uint16_t curr=(4000-GBT_ReqPower.requestedCurrent);
+// //PSU_SetCurrent(curr);
+// GBT_ChargingSummary.requestedCurrent = curr;
+// }
+// if(GBT_CurrPower.requestedVoltage != GBT_ReqPower.requestedVoltage){
+// GBT_CurrPower.requestedVoltage = GBT_ReqPower.requestedVoltage;
+// //PSU_SetCurrent(GBT_ReqPower.requestedCurrent);
+// uint16_t volt=GBT_ReqPower.requestedVoltage/10;
+// GBT_ChargingSummary.requestedVoltage = volt;
+// //PSU_SetVoltage(volt);
+// //смещение -400а
+// }
+//// }
+
+ GBT_Delay(50);
+
+ break;
+
+ case GBT_STOP:
+ //TODO: turn off power modules
+ GBT_Delay(10);
+ GBT_EDCAN_Output.enablePSU = 0;
+ GBT_SendCST();
+ //RELAY_Write(RELAY_OUTPUT, 0);
+ //GBT_SwitchState(GBT_DISABLED);
+ if(GBT_StateTick()>1000){
+ GBT_SwitchState(GBT_DISABLED);
+ GBT_Lock(0);
+ RELAY_Write(RELAY_AUX, 0);
+ //PSU_Mode(0x0100);
+ }
+ break;
+
+ default:
+ GBT_SwitchState(GBT_DISABLED);
+ }
+}
+
+
+
+void GBT_SwitchState(gbtState_t state){
+ GBT_State = state;
+ ED_status = state;
+ GBT_state_tick = HAL_GetTick();
+ if(GBT_State == GBT_DISABLED) printf ("GBT_DISABLED\n");
+ if(GBT_State == GBT_S0_UNCONNECTED) printf ("GBT_S0_UNCONNECTED\n");
+ if(GBT_State == GBT_S1_CONNECTED) printf ("GBT_S1_CONNECTED\n");
+ if(GBT_State == GBT_S2_LOCKED) printf ("GBT_S2_LOCKED\n");
+ if(GBT_State == GBT_S3_STARTED) printf ("GBT_S3_STARTED\n");
+ if(GBT_State == GBT_S4_ISOTEST) printf ("GBT_S4_ISOTEST\n");
+ if(GBT_State == GBT_S5_BAT_INFO) printf ("GBT_S5_BAT_INFO\n");
+ if(GBT_State == GBT_S6_BAT_STAT) printf ("GBT_S6_BAT_STAT\n");
+ if(GBT_State == GBT_S7_BMS_WAIT) printf ("GBT_S7_BMS_WAIT\n");
+ if(GBT_State == GBT_S8_INIT_CHARGER)printf ("GBT_S8_INIT_CHARGER\n");
+ if(GBT_State == GBT_S9_WAIT_BCL) printf ("GBT_S9_WAIT_BCL\n");
+ if(GBT_State == GBT_S10_CHARGING) printf ("GBT_S10_CHARGING\n");
+ if(GBT_State == GBT_STOP) printf ("GBT_STOP\n");
+
+
+}
+
+uint32_t GBT_StateTick(){
+ return HAL_GetTick() - GBT_state_tick;
+}
+
+void GBT_Delay(uint32_t delay){
+ GBT_delay = HAL_GetTick()+delay;
+}
+
+void GBT_Stop(){
+ if(GBT_State != GBT_STOP) GBT_SwitchState(GBT_STOP);
+}
+
+void GBT_Stop1(){
+ GBT_SwitchState(GBT_DISABLED);
+ GBT_Lock(0);
+ RELAY_Write(RELAY_AUX, 0);
+}
+
+void GBT_Start(){
+ GBT_BAT_INFO_recv = 0;
+ GBT_BAT_STAT_recv = 0;
+ EV_ready = 0;
+ memset(&GBT_EVInfo, 0, sizeof (GBT_EVInfo));
+ memset(&GBT_BATStat, 0, sizeof (GBT_BATStat));
+ memset(&GBT_ReqPower, 0, sizeof (GBT_ReqPower));
+ GBT_SwitchState(GBT_S0_UNCONNECTED);
+}
diff --git a/Core/Src/debug.c b/Core/Src/debug.c
new file mode 100644
index 0000000..c708380
--- /dev/null
+++ b/Core/Src/debug.c
@@ -0,0 +1,181 @@
+/*
+ * debug.c
+ *
+ * Created on: Apr 16, 2024
+ * Author: colorbass
+ */
+
+#include "main.h"
+#include
+#include
+#include "debug.h"
+#include "board.h"
+#include "charger_gbt.h"
+#include "usart.h"
+
+uint8_t debug_rx_buffer[256];
+uint8_t debug_cmd_received;
+uint8_t debug_rx_buffer_size = 0;
+
+extern UART_HandleTypeDef huart2;
+
+#if defined(__GNUC__)
+int _write(int fd, char * ptr, int len)
+{
+ HAL_UART_Transmit(&huart2, (uint8_t *) ptr, len, HAL_MAX_DELAY);
+ return len;
+}
+#endif
+
+void debug_rx_interrupt(UART_HandleTypeDef *huart, uint16_t Size){
+ debug_rx_buffer[Size] = '\0';
+ debug_rx_buffer_size = Size;
+ debug_cmd_received = 1;
+}
+
+void debug_init(){
+ HAL_UARTEx_ReceiveToIdle_IT(&huart2,debug_rx_buffer,255);
+ //mm_schedule_write(0x01, 0x0000, 0x0800);
+ // mm_schedule_write(0x02, 0x00FF, 0xFFFF);
+ //for (int i=0;i<60;i++)
+ // mm_schedule_write(0x02, 0x0000, 0xFF00);
+ // mm_schedule_write(0x01, 0x0000, 0x0100);
+ // mm_schedule_write(0x01, 0x0000, 0x0100);
+}
+
+void parse_command(uint8_t* buffer, size_t length) {
+ // ignore \r \n symbols
+ size_t i = 0;
+ for (i = 0; i < length; i++) {
+ if (buffer[i] == '\r' || buffer[i] == '\n') {
+ buffer[i] = '\0';
+ length = i;
+ break;
+ }
+ }
+
+ if (strncmp((const char*)buffer, "reset", length) == 0) {
+ printf("Resetting...\n");
+ NVIC_SystemReset();
+
+ } else if (strncmp((const char*)buffer, "relayaux", length) == 0) {
+ printf("Relaying...\n");
+ RELAY_Write(RELAY_AUX, 1);
+ HAL_Delay(200);
+ RELAY_Write(RELAY_AUX, 0);
+ } else if (strncmp((const char*)buffer, "relaycc", length) == 0) {
+ printf("Relaying...\n");
+ RELAY_Write(RELAY_CC, 1);
+ HAL_Delay(200);
+ RELAY_Write(RELAY_CC, 0);
+
+
+// } else if (strncmp((const char*)buffer, "voltage", length) == 0) {
+// printf("Voltaging...\n");
+// mm_schedule_read(0x02, 0x0001);
+
+ } else if (strncmp((const char*)buffer, "adc", length) == 0) {
+ printf("CC1=%.2f\n", GBT_CC_GetAdc());
+
+ } else if (strncmp((const char*)buffer, "lock_state", length) == 0) {
+ printf("Lock state=%d\n", GBT_LockGetState());
+
+ } else if (strncmp((const char*)buffer, "lock_lock", length) == 0) {
+ printf("Locked\n");
+ GBT_Lock(1);
+
+ } else if (strncmp((const char*)buffer, "lock_unlock", length) == 0) {
+ printf("Unlocked\n");
+ GBT_Lock(0);
+
+ } else if (strncmp((const char*)buffer, "start", length) == 0) {
+ printf("Started\n");
+ GBT_Start();
+
+ } else if (strncmp((const char*)buffer, "stop", length) == 0) {
+ printf("Stopped\n");
+ GBT_Stop();
+
+ } else if (strncmp((const char*)buffer, "stop1", length) == 0) {
+ printf("Stopped\n");
+ GBT_Stop1();
+
+ } else if (strncmp((const char*)buffer, "force", length) == 0) {
+ printf("Stopped\n");
+ GBT_Lock(1);
+ GBT_SwitchState(GBT_S2_LOCKED);
+ GBT_Delay(500);
+
+ } else if (strncmp((const char*)buffer, "cc_state", length) == 0) {
+ switch(GBT_CC_GetState()){
+ case GBT_CC_UNKNOWN:
+ printf("GBT_CC_UNKNOWN\n");
+ break;
+ case GBT_CC_12V:
+ printf("GBT_CC_12V\n");
+ break;
+ case GBT_CC_6V:
+ printf("GBT_CC_6V\n");
+ break;
+ case GBT_CC_4V:
+ printf("GBT_CC_4V\n");
+ break;
+ case GBT_CC_2V:
+ printf("GBT_CC_2V\n");
+ break;
+
+ }
+ } else if (strncmp((const char*)buffer, "info1", length) == 0) {
+ printf("Battery info:\n");
+ printf("maxCV %dV\n",GBT_BATStat.maxCellVoltage/100); // 0.01v/bit
+ printf("maxCC %dA\n",GBT_BATStat.maxChargingCurrent/10); // 0.1A/bit
+ printf("totE %dkWh\n",GBT_BATStat.totalEnergy/10); // 0.1kWh
+ printf("maxCV %dV\n",GBT_BATStat.maxChargingVoltage/10); // 0.1V/ bit
+ printf("maxT %dC\n",(int16_t)GBT_BATStat.maxTemp-50); // 1C/bit, -50C offset
+ printf("SOC %dp\n",GBT_BATStat.SOC/10); // 0.1%/bit , 0..100%
+ printf("Volt. %dV\n",GBT_BATStat.measVoltage/10); // 0.1V/bit
+
+ } else if (strncmp((const char*)buffer, "info2", length) == 0) {
+ printf("EV info:\n");
+ printf("GBT_ver V%d.%d%d\n",GBT_EVInfo.version[0],GBT_EVInfo.version[1],GBT_EVInfo.version[2]);
+ printf("Battery type: %d\n",GBT_EVInfo.batteryType);
+ printf("Battery capacity: %d\n", GBT_EVInfo.batteryCapacity); // 0.1Ah/bit
+ printf("Battery voltage: %d\n", GBT_EVInfo.batteryVoltage); // 0.1V/bit
+ printf("Battery vendor: %.4s\n", GBT_EVInfo.batteryVendor); // Battery vendor (ASCII string)
+ printf("Battery SN: %lu\n", GBT_EVInfo.batterySN); // int
+ printf("Battery manufacture date: %02d.%02d.%04d\n", GBT_EVInfo.batteryManuD, GBT_EVInfo.batteryManuM ,GBT_EVInfo.batteryManuY+1985); // year (offset 1985)
+ printf("Battery cycles: %d\n", GBT_EVInfo.batteryCycleCount); //uint24_t
+ printf("Own auto: %d\n", GBT_EVInfo.ownAuto); // 0 = lizing, 1 = own auto
+ printf("EVIN: %.17s\n", GBT_EVInfo.EVIN); //EVIN
+ printf("EV_SW_VER: %.8s\n", GBT_EVInfo.EV_SW_VER);
+
+ } else if (strncmp((const char*)buffer, "help", length) == 0) {
+ printf("Command list:\n");
+ printf("reset\n");
+ printf("help\n");
+ printf("cc_state\n");
+ printf("lock_lock\n");
+ printf("lock_unlock\n");
+ printf("lock_state\n");
+ printf("adc\n");
+ printf("relay(cc,aux)\n");
+ printf("start\n");
+ printf("stop\n");
+ printf("stop1\n");
+ printf("force\n");
+ printf("info1\n");
+ printf("info2\n");
+ //TODO: info commands
+
+ } else {
+ printf("Unknown command\n");
+ }
+}
+
+void debug_task(){
+ if(debug_cmd_received){
+ parse_command(debug_rx_buffer, debug_rx_buffer_size);
+ HAL_UARTEx_ReceiveToIdle_IT(&huart2,debug_rx_buffer,255);
+ debug_cmd_received = 0;
+ }
+}
diff --git a/Core/Src/edcan_handler_user.c b/Core/Src/edcan_handler_user.c
new file mode 100644
index 0000000..d9d918d
--- /dev/null
+++ b/Core/Src/edcan_handler_user.c
@@ -0,0 +1,259 @@
+/*
+ * edcan_handler.c
+ *
+ * В этом файле расположены обработчики приходящих пакетов для пользовательских регистров
+ *
+ * Created on: Jul 5, 2024
+ * Author: colorbass
+ */
+
+
+#include
+#include "stdio.h"
+#include "soft_rtc.h"
+#include "charger_gbt.h"
+
+// * здесь объявлять внешние устройства и их регистры *
+//uint8_t edcan_register_BMS[256];//300...3FF
+
+
+////meter registers
+//#define EDCAN_ID_METER 0x10
+//#define EDCAN_REG_METER_VOLTAGE 0x03
+//#define EDCAN_REG_METER_CURRENT 0x04
+
+
+//own registers
+#define EDCAN_REG_CHARGER_ENABLE 0x100
+
+
+/* Charger info registers */
+#define EDCAN_REG_CHARGER_NUMBER_0 0x200
+#define EDCAN_REG_CHARGER_NUMBER_1 0x201
+#define EDCAN_REG_CHARGER_NUMBER_2 0x202
+#define EDCAN_REG_CHARGER_NUMBER_3 0x203
+
+#define EDCAN_REG_CHARGER_LOCATION_0 0x204
+#define EDCAN_REG_CHARGER_LOCATION_1 0x205
+#define EDCAN_REG_CHARGER_LOCATION_2 0x206
+
+//UNIX TIME
+#define EDCAN_REG_TIME_0 0x210
+#define EDCAN_REG_TIME_1 0x211
+#define EDCAN_REG_TIME_2 0x212
+#define EDCAN_REG_TIME_3 0x213
+//#define EDCAN_REG_SECONDS 0x210
+//#define EDCAN_REG_MINUTES 0x211
+//#define EDCAN_REG_HOURS 0x212
+//#define EDCAN_REG_DAYS 0x213
+//#define EDCAN_REG_MONTH 0x214
+//#define EDCAN_REG_YEARS 0x215
+//#define EDCAN_REG_CENTURIES 0x216
+//#define EDCAN_REG_TIME_SYNC 0x217
+
+#define EDCAN_REG_MAX_LOAD 0x220
+
+#define EDCAN_REG_BRM 0x310
+
+#define EDCAN_REG_BCP 0x350
+
+#define EDCAN_REG_BRO 0x35F
+
+#define EDCAN_REG_BCL 0x360
+
+#define EDCAN_REG_BCS 0x370
+
+#define EDCAN_REG_BSM 0x380
+
+
+#define EDCAN_REG_OUTPUT 0x500
+
+GBT_EDCAN_Output_t GBT_EDCAN_Output;
+
+
+#define EDCAN_REG_INPUT 0x580
+
+GBT_EDCAN_Input_t GBT_EDCAN_Input;
+
+
+
+
+//extern uint8_t relay_value[8];
+
+
+/**
+ * @brief Handler for incoming Read packet
+ * Another device reply value of its registers
+ *
+ * @param SourceID: Packet Source ID
+ * DestinationID: Packet Destination ID
+ * Addr: First register address in sequence
+ * *data: pointer for data array
+ * len: length of data (1..255)
+ */
+void EDCAN_ReadHandler(uint8_t SourceID, uint8_t DestinationID, uint16_t Addr, uint8_t *data, uint8_t len){
+ //Получили пакет Read (запрошенное значение регистров)
+// printf("Received packet: Read\n");
+// printf("Source ID = %d\n", SourceID);
+// printf("Destination ID = %d\n", DestinationID);
+// printf("Address = %d\n", Addr);
+// printf("Len = %d\n", len);
+// printf("\n");
+
+ for (uint16_t AddrOffset = 0; AddrOffset < len; AddrOffset++){ //по очереди перебираем все полученные регистры через Handler
+
+ // * добавить сюда новые устройства *
+
+// if(SourceID == EDCAN_ID_METER){
+// printf ("register[%d] = %d\n", Addr+AddrOffset, data[AddrOffset]);
+// switch(Addr+AddrOffset){
+//
+// // * добавить сюда внешние регистры этого устройства *
+// case EDCAN_REG_METER_VOLTAGE:
+// printf ("Voltage = %d\n", data[AddrOffset]);
+// break;
+//
+// case EDCAN_REG_METER_CURRENT:
+// printf ("Current = %d\n", data[AddrOffset]);
+// break;
+// default:
+// printf ("Unknown register\n");
+// }
+// }
+
+ }
+// printf("\n");
+}
+
+/**
+ * @brief Handler for incoming Read packet
+ * Another device reply value of its registers
+ *
+ * @param SourceID: Packet Source ID
+ * DestinationID: Packet Destination ID
+ * Addr: First register address in sequence
+ * *data: pointer for data array
+ * len: length of data (1..255)
+ */
+void EDCAN_WriteUserRegister(uint16_t addr, uint8_t value){
+ switch(addr){
+ //edcan_register[addr] = value;
+// case EDCAN_REG_K0:
+// printf ("K0 = %d\n", value);
+// HAL_GPIO_WritePin (K0_GPIO_Port, K0_Pin, (value == 0));
+// break;
+ case EDCAN_REG_CHARGER_ENABLE:
+ if(value){
+ GBT_Start();//TODO IF protections
+ }else{
+ GBT_Stop();
+ }
+
+ break;
+
+ case EDCAN_REG_TIME_0:
+ writeTimeReg(0, value);
+ break;
+ case EDCAN_REG_TIME_1:
+ writeTimeReg(1, value);
+ break;
+ case EDCAN_REG_TIME_2:
+ writeTimeReg(2, value);
+ break;
+ case EDCAN_REG_TIME_3:
+ writeTimeReg(3, value);
+ break;
+
+
+
+ //0x220
+ case EDCAN_REG_MAX_LOAD ... (EDCAN_REG_MAX_LOAD+sizeof(GBT_CML_t)):
+ ((uint8_t*)&GBT_MaxLoad)[addr - EDCAN_REG_MAX_LOAD] = value;
+ break;
+
+ //0x580
+ case EDCAN_REG_INPUT ... (EDCAN_REG_INPUT+sizeof(GBT_EDCAN_Input_t)):
+ ((uint8_t*)&GBT_EDCAN_Input)[addr - EDCAN_REG_INPUT] = value;
+
+ //TODO
+ //GBT_EDCAN_Input.measuredCurrent;
+ break;
+
+
+
+ default:
+ printf ("Unknown register\n");
+ }
+
+}
+
+
+uint8_t EDCAN_GetUserRegisterValue(uint16_t addr){
+ switch (addr){
+
+// /* регистры 256..2047 используются пользовательских нужд */
+
+
+ case EDCAN_REG_TIME_0:
+ return getTimeReg(0);
+ break;
+
+ case EDCAN_REG_TIME_1:
+ return getTimeReg(1);
+ break;
+
+ case EDCAN_REG_TIME_2:
+ return getTimeReg(2);
+ break;
+
+ case EDCAN_REG_TIME_3:
+ return getTimeReg(3);
+ break;
+
+
+ //0x220
+ case EDCAN_REG_MAX_LOAD ... (EDCAN_REG_MAX_LOAD+sizeof(GBT_CML_t)):
+ return ((uint8_t*)&GBT_MaxLoad)[addr - EDCAN_REG_MAX_LOAD];
+
+ //0x310
+ case EDCAN_REG_BRM ... (EDCAN_REG_BRM+sizeof(GBT_BRM_t)-1):
+ return ((uint8_t*)&GBT_EVInfo)[addr - EDCAN_REG_BRM];
+
+ //0x340
+ case EDCAN_REG_BCP ... (EDCAN_REG_BCP+sizeof(GBT_BCP_t)):
+ return ((uint8_t*)&GBT_BATStat)[addr - EDCAN_REG_BCP];
+
+ //0x34F
+ case EDCAN_REG_BRO:
+ return GBT_BRO;
+
+ //0x350
+ case EDCAN_REG_BCL ... (EDCAN_REG_BCL+sizeof(GBT_BCL_t)):
+ return ((uint8_t*)&GBT_ReqPower)[addr - EDCAN_REG_BCL];
+
+ //0x360
+ case EDCAN_REG_BCS ... (EDCAN_REG_BCS+sizeof(GBT_BCS_t)):
+ return ((uint8_t*)&GBT_ChargingStatus)[addr - EDCAN_REG_BCS];
+
+ //0x370
+ case EDCAN_REG_BSM ... (EDCAN_REG_BSM+sizeof(GBT_BSM_t)):
+ return ((uint8_t*)&GBT_BatteryStatus)[addr - EDCAN_REG_BSM];
+
+
+ //0x500
+ case EDCAN_REG_OUTPUT ... (EDCAN_REG_OUTPUT+sizeof(GBT_EDCAN_Output_t)):
+ return ((uint8_t*)&GBT_EDCAN_Output)[addr - EDCAN_REG_OUTPUT];
+
+ //0x580
+ case EDCAN_REG_INPUT ... (EDCAN_REG_INPUT+sizeof(GBT_EDCAN_Input_t)):
+ return ((uint8_t*)&GBT_EDCAN_Input)[addr - EDCAN_REG_INPUT];
+
+
+ default:
+ return 0x00;
+ }
+}
+
+
+
+
diff --git a/Core/Src/gbt_packet.c b/Core/Src/gbt_packet.c
new file mode 100644
index 0000000..04178f0
--- /dev/null
+++ b/Core/Src/gbt_packet.c
@@ -0,0 +1,109 @@
+/*
+ * gbt_packet.c
+ *
+ * Created on: Jul 23, 2024
+ * Author: colorbass
+ */
+
+
+// GB/T Time Synchronization Packet
+#include "main.h"
+#include "soft_rtc.h"
+#include "charger_gbt.h"
+
+void GBT_SendCTS(){
+
+ uint8_t data[7];
+ unix_to_bcd(get_Current_Time(), data);
+// data[0] = 0x00; //seconds
+// data[1] = 0x30; //minutes
+// data[2] = 0x23; //hours
+// data[3] = 0x05; //days
+// data[4] = 0x05; //month
+// data[5] = 0x24; //years
+// data[6] = 0x20; //centuries
+
+ J_SendPacket(0x000700, 6, 7, data);
+}
+
+//TODO
+//GB/T Max Load Packet
+void GBT_SendCML(){
+// uint8_t data[8];
+// data[0] = 0x94; //450V max output voltage
+// data[1] = 0x11; //
+// data[2] = 0xB0; //120V min output voltage
+// data[3] = 0x04; //
+// data[4] = 0xC4; //-150A maximum output current
+// data[5] = 0x09; //
+// data[6] = 0x8C; //-2A minimum output current
+// data[7] = 0x0F; //
+
+ J_SendPacket(0x000800, 6, 8, (uint8_t*)&GBT_MaxLoad);
+
+}
+
+//GB/T Version packet
+void GBT_SendCHM(){
+ uint8_t data[3];
+ data[0] = 0x01;
+ data[1] = 0x01;
+ data[2] = 0x00;
+ J_SendPacket(0x2600, 6, 3, data);
+}
+
+//TODO
+//GB/T CRM Packet (state=BMS identified)
+void GBT_SendCRM(uint8_t state){
+// uint8_t data[8];
+// data[0] = state; // 0x00 / 0xAA
+// data[1] = 0x40; //TODO: Charger Number 123456
+// data[2] = 0xE2;
+// data[3] = 0x01;
+// data[4] = 0x00;
+// data[5] = 0x42; //TODO: location BFG
+// data[6] = 0x46;
+// data[7] = 0x47;
+ GBT_ChargerInfo.bmsIdentified = state;
+ J_SendPacket(0x100, 6, 8, (uint8_t *)&GBT_ChargerInfo);
+}
+
+//GB/T CRO packet (Charger ready)
+void GBT_SendCRO(uint8_t state){
+ uint8_t data[1];
+ data[0] = state;
+ J_SendPacket(0xA00, 4, 1, data);
+}
+
+
+//TODO: Send measured voltage current
+//GB/T CCS packet (Charger current status)
+void GBT_SendCCS(){
+// uint8_t data[8];
+// data[0] = GBT_CurrPower.requestedVoltage; //
+// data[1] = GBT_CurrPower.requestedVoltage>>8; //output voltage
+// data[2] = GBT_CurrPower.requestedCurrent; //смещение 400а, границы
+// //-400A = 0
+// // 0A = 4000
+// // -100A = 3000
+// data[3] = GBT_CurrPower.requestedCurrent>>8; //TODO: current
+// data[4] = GBT_StateTick()/60000; //charging time (min)
+// data[5] = 0; //TODO: 255 min+
+// data[6] = 0b11111101; //charging not permitted
+// data[7] = 0xFF;
+ J_SendPacket(0x1200, 6, 8, (uint8_t *)&GBT_ChargerCurrentStatus);
+}
+
+//TODO: stop cause
+// GB/T Charging Stop packet
+void GBT_SendCST(){
+ uint8_t data[8];
+ data[0] = 0x04; // Artificially stop charging
+ data[1] = 0x00; //TODO: Cause stop
+ data[2] = 0xF0; //
+ data[3] = 0xF0; //
+
+ J_SendPacket(0x1A00, 4, 4, data);
+}
+
+//TODO CSD priority 6
diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c
new file mode 100644
index 0000000..7dc0857
--- /dev/null
+++ b/Core/Src/gpio.c
@@ -0,0 +1,110 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file gpio.c
+ * @brief This file provides code for the configuration
+ * of all used GPIO pins.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "gpio.h"
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/*----------------------------------------------------------------------------*/
+/* Configure GPIO */
+/*----------------------------------------------------------------------------*/
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
+
+/** Configure pins as
+ * Analog
+ * Input
+ * Output
+ * EVENT_OUT
+ * EXTI
+*/
+void MX_GPIO_Init(void)
+{
+
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ __HAL_RCC_GPIOE_CLK_ENABLE();
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOC, LOCK_A_Pin|LOCK_B_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(RELAY_CC_GPIO_Port, RELAY_CC_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(USART2_DIR_GPIO_Port, USART2_DIR_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(RELAY_AUX_GPIO_Port, RELAY_AUX_Pin, GPIO_PIN_RESET);
+
+ /*Configure GPIO pins : PCPin PCPin */
+ GPIO_InitStruct.Pin = LOCK_A_Pin|LOCK_B_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : PtPin */
+ GPIO_InitStruct.Pin = LOCK_FB_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(LOCK_FB_GPIO_Port, &GPIO_InitStruct);
+
+ /*Configure GPIO pins : PEPin PEPin */
+ GPIO_InitStruct.Pin = ADDR_0_Pin|ADDR_1_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : PtPin */
+ GPIO_InitStruct.Pin = RELAY_CC_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(RELAY_CC_GPIO_Port, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : PtPin */
+ GPIO_InitStruct.Pin = USART2_DIR_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(USART2_DIR_GPIO_Port, &GPIO_InitStruct);
+
+ /*Configure GPIO pin : PtPin */
+ GPIO_InitStruct.Pin = RELAY_AUX_Pin;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(RELAY_AUX_GPIO_Port, &GPIO_InitStruct);
+
+}
+
+/* USER CODE BEGIN 2 */
+
+/* USER CODE END 2 */
diff --git a/Core/Src/j1939.c b/Core/Src/j1939.c
new file mode 100644
index 0000000..a161518
--- /dev/null
+++ b/Core/Src/j1939.c
@@ -0,0 +1,163 @@
+/*
+ * j1939.c
+ *
+ * Created on: May 3, 2024
+ * Author: colorbass
+ */
+
+#include "main.h"
+#include "j1939.h"
+#include "charger_gbt.h"
+#include "string.h"
+#include "can.h"
+
+extern GBT_BCL_t GBT_ReqPower;
+extern GBT_BCL_t GBT_CurrPower;
+
+j_receive_t j_rx;
+
+void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
+{
+ CAN_RxHeaderTypeDef RxHeader;
+ uint8_t RxData[8] = {0,};
+
+ if(HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &RxHeader, RxData) == HAL_OK)
+ {
+ if((RxHeader.ExtId & 0x00FFFF) == ((J_ID_SE << 8) | J_ID_EV)){ // SA, DA match
+ switch ((RxHeader.ExtId>>8) & 0x00FF00){
+
+ case 0xEC00: //PGN Connection Management Message
+ if(RxData[0] == 16){ //Request to Send
+ /* Set the RTS values */
+ j_rx.size = RxData[1] | (RxData[2]<<8);
+ j_rx.packet = 1;
+ j_rx.packets = RxData[3];
+ j_rx.step = 2; //TODO
+ j_rx.step_cts_remain = j_rx.step;
+ j_rx.PGN = (RxData[7] << 16) | (RxData[6] << 8) | RxData[5];
+ if(j_rx.size<256) { //TODO: valid check
+ J_SendCTS(j_rx);
+ j_rx.state = 1;
+ }
+ }
+ if(RxData[0] == 255){ //Connection Abort
+ j_rx.state = 0;
+ }
+
+ //if(RxData[0] == 32){}//Broadcast Announce Message
+ /*
+ * 1CEC56F4 10 31 00 07 07 00 02 00
+ * 1CECF456 11 02 01 FF FF 00 02 00
+ * 1CEB56F4 01 01 01 00 03 46 05 40
+ * 1CEC56F4 FF FF FF FF FF 00 00 00
+ */
+
+ break;
+
+ case 0xEB00: //PGN Data Message
+ if(j_rx.state != 1) break;
+ if((RxData[0]>0) && (RxData[0]<35)){ //Array limit check
+ if(j_rx.packet == RxData[0]){ //step check
+ memcpy (&j_rx.data[(RxData[0]-1)*7], &RxData[1],7);
+ j_rx.packet++;
+ if(j_rx.packet > j_rx.packets){
+ //End of transmission
+ J_SendACK(j_rx);
+
+ j_rx.state = 2;
+ }else{
+ if(j_rx.step_cts_remain > 0) j_rx.step_cts_remain--;
+ if(j_rx.step_cts_remain == 0){
+ J_SendCTS(j_rx);
+ j_rx.step_cts_remain = 2;
+ }
+ }
+ }
+ }
+ break;
+
+ case 0x1E00: //PGN BEM (ERROR)
+ GBT_Stop();
+ break;
+
+ case 0x1900: //PGN BST (STOP)
+ GBT_Stop();
+ break;
+
+ default:
+ if(j_rx.state == 0){//TODO protections
+ //Short packet
+ j_rx.size = RxHeader.DLC;
+ j_rx.packet = 1;
+ j_rx.packets = 1;
+ j_rx.step = 1;
+ j_rx.step_cts_remain = 0;
+ j_rx.PGN = (RxHeader.ExtId>>8) & 0x00FF00;
+ j_rx.state = 2;
+ memcpy (j_rx.data, RxData, j_rx.size);
+ }
+ }
+ }
+ }
+}
+
+void GBT_CAN_ReInit(){
+ HAL_CAN_Stop(&hcan1);
+ MX_CAN1_Init();
+ HAL_CAN_Start(&hcan1);
+ HAL_CAN_ActivateNotification(&hcan1, CAN_IT_RX_FIFO0_MSG_PENDING);
+}
+
+void J_SendPacket(uint32_t PGN, uint8_t pri, uint8_t DLC, uint8_t *data){
+
+ CAN_TxHeaderTypeDef tx_header;
+ uint32_t tx_mailbox;
+
+ tx_header.ExtId = (pri << 26) | (PGN << 8) | (J_ID_EV << 8) | J_ID_SE;
+ tx_header.RTR = CAN_RTR_DATA;
+ tx_header.IDE = CAN_ID_EXT;
+ tx_header.DLC = DLC;
+
+ HAL_CAN_AddTxMessage(&hcan1, &tx_header, data, &tx_mailbox);
+ //HAL_Delay(2);
+
+}
+
+//void J_SendPacketLong(){
+// //TODO (no need)
+//}
+
+// J1939 sequence Clear To Send packet
+void J_SendCTS(j_receive_t rx){
+
+ //if(rx.packets <= rx.packet) return; TODO
+ uint8_t data[8];
+ data[0] = 17; //CONTROL_BYTE_TP_CM_CTS
+ data[1] = rx.step;//total_number_of_packages_transmitted
+ if (rx.step > (rx.packets - rx.packet+1)) data[1] = rx.packets - rx.packet+1;
+ data[2] = rx.packet;//next_packet_number_transmitted
+ data[3] = 0xFF; /* Reserved */
+ data[4] = 0xFF;
+ data[5] = rx.PGN;
+ data[6] = rx.PGN >> 8;
+ data[7] = rx.PGN >> 16;
+
+ J_SendPacket(0x00EC00, 7, 8, data);
+}
+
+// J1939 sequence ACK packet
+void J_SendACK(j_receive_t rx){//uint32_t PGN, uint8_t step, uint8_t packet){
+
+ uint8_t data[8];
+ data[0] = 19; //CONTROL_BYTE_TP_CM_ACK
+ data[1] = j_rx.size;
+ data[2] = j_rx.size>>8;
+ data[3] = j_rx.packets;
+ data[4] = 0xFF;//TODO
+ data[5] = rx.PGN;
+ data[6] = rx.PGN >> 8;
+ data[7] = rx.PGN >> 16;
+
+ J_SendPacket(0x00EC00, 7, 8, data);
+}
+
diff --git a/Core/Src/main.c b/Core/Src/main.c
new file mode 100644
index 0000000..0d1c749
--- /dev/null
+++ b/Core/Src/main.c
@@ -0,0 +1,223 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.c
+ * @brief : Main program body
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "adc.h"
+#include "can.h"
+#include "usart.h"
+#include "gpio.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "can.h"
+#include "board.h"
+#include
+#include "debug.h"
+#include "charger_gbt.h"
+#include "soft_rtc.h"
+#include "j1939.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+
+/* USER CODE END PTD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+#include "edcan_config.h"
+#include "edcan_defines.h"
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ /* USER CODE BEGIN 1 */
+
+ /* USER CODE END 1 */
+
+ /* MCU Configuration--------------------------------------------------------*/
+
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ /* USER CODE BEGIN Init */
+
+ /* USER CODE END Init */
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ /* USER CODE BEGIN SysInit */
+
+ /* USER CODE END SysInit */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_ADC1_Init();
+ MX_CAN1_Init();
+ MX_CAN2_Init();
+ MX_USART2_UART_Init();
+ /* USER CODE BEGIN 2 */
+ CAN_ReInit();
+ Init_Peripheral();
+
+ HAL_Delay(300);
+ GBT_Init();
+ set_Time(1721651966); //2024-07-22T12:39:26+00:00
+ printf("Startup (type \'help\' for command list)\n");
+ debug_init();
+ //EDCAN_Init(SW_GetAddr()); //0x20..0x23
+ EDCAN_Init(0x20); //Адрес EDCAN
+ CAN_ReInit();
+ GBT_CAN_ReInit();
+ /* USER CODE END 2 */
+
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
+ while (1)
+ {
+ /* USER CODE END WHILE */
+
+ /* USER CODE BEGIN 3 */
+// HAL_Delay(1);
+ EDCAN_Loop();
+ // can_task();
+ debug_task();
+ GBT_ChargerTask();
+
+ }
+ /* USER CODE END 3 */
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
+
+ /** Initializes the RCC Oscillators according to the specified parameters
+ * in the RCC_OscInitTypeDef structure.
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV5;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.Prediv1Source = RCC_PREDIV1_SOURCE_PLL2;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
+ RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
+ RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
+ RCC_OscInitStruct.PLL2.PLL2State = RCC_PLL2_ON;
+ RCC_OscInitStruct.PLL2.PLL2MUL = RCC_PLL2_MUL8;
+ RCC_OscInitStruct.PLL2.HSEPrediv2Value = RCC_HSE_PREDIV2_DIV5;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ /** Initializes the CPU, AHB and APB buses clocks
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
+ PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ /** Configure the Systick interrupt time
+ */
+ __HAL_RCC_PLLI2S_ENABLE();
+}
+
+/* USER CODE BEGIN 4 */
+
+/* USER CODE END 4 */
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+ /* USER CODE BEGIN Error_Handler_Debug */
+ /* User can add his own implementation to report the HAL error return state */
+ __disable_irq();
+ while (1)
+ {
+ }
+ /* USER CODE END Error_Handler_Debug */
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
diff --git a/Core/Src/soft_rtc.c b/Core/Src/soft_rtc.c
new file mode 100644
index 0000000..084aa73
--- /dev/null
+++ b/Core/Src/soft_rtc.c
@@ -0,0 +1,74 @@
+/*
+ * rtc.c
+ *
+ * Created on: Jul 22, 2024
+ * Author: colorbass
+ */
+
+#include
+#include
+#include
+
+uint32_t GBT_time_offset; //current time = offset+HAL_GetTick()/1000;
+uint8_t tmp_time[4];
+uint8_t tmp_time32;
+
+uint32_t get_Current_Time(){
+ return GBT_time_offset + (HAL_GetTick()/1000);
+}
+
+void set_Time(uint32_t unix_time){
+ if(unix_time <= (HAL_GetTick()/1000)) return; //invalid time
+ GBT_time_offset = unix_time - (HAL_GetTick()/1000);
+}
+
+uint8_t to_bcd(int value) {
+ return ((value / 10) << 4) | (value % 10);
+}
+
+void unix_to_bcd(uint32_t unix_time, uint8_t *time) {
+ struct tm *tm_info;
+ time_t raw_time = (time_t)unix_time;
+ tm_info = gmtime(&raw_time);
+
+ time[0] = to_bcd(tm_info->tm_sec);
+ time[1] = to_bcd(tm_info->tm_min);
+ time[2] = to_bcd(tm_info->tm_hour);
+ time[3] = to_bcd(tm_info->tm_mday);
+ time[4] = to_bcd(tm_info->tm_mon + 1); // tm_mon is 0-11
+ time[5] = to_bcd((tm_info->tm_year + 1900) % 100); // Year in 2 digits
+ time[6] = to_bcd((tm_info->tm_year + 1900) / 100); // Century in 2 digits
+}
+
+void writeTimeReg(uint8_t reg_number, uint8_t value){
+ tmp_time[reg_number] = value;
+ if(reg_number == 3) set_Time((tmp_time[0])+(tmp_time[1]<<8)+(tmp_time[2]<<16)+(tmp_time[3]<<24));
+};
+
+uint8_t getTimeReg(uint8_t reg_number){
+ if(reg_number == 0){
+ tmp_time32 = get_Current_Time();
+ return tmp_time32 & 0xFF;
+ }else if(reg_number == 1){
+ return (tmp_time32>>8) & 0xFF;
+ }else if(reg_number == 2){
+ return (tmp_time32>>16) & 0xFF;
+ }else if(reg_number == 3){
+ return (tmp_time32>>24) & 0xFF;
+ }else{
+ return 0x00;
+ }
+};
+//int main() {
+// uint32_t unix_time = 1672531199; // Example Unix timestamp
+// uint8_t time[8];
+//
+// unix_to_bcd(unix_time, time);
+//
+// // Print the BCD values for verification
+// for (int i = 0; i < 8; i++) {
+// printf("time[%d]: %02X\n", i, time[i]);
+// }
+//
+// return 0;
+//}
diff --git a/Core/Src/stm32f1xx_hal_msp.c b/Core/Src/stm32f1xx_hal_msp.c
new file mode 100644
index 0000000..a51f0d4
--- /dev/null
+++ b/Core/Src/stm32f1xx_hal_msp.c
@@ -0,0 +1,85 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f1xx_hal_msp.c
+ * @brief This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_AFIO_CLK_ENABLE();
+ __HAL_RCC_PWR_CLK_ENABLE();
+
+ /* System interrupt init*/
+
+ /** NOJTAG: JTAG-DP Disabled and SW-DP Enabled
+ */
+ __HAL_AFIO_REMAP_SWJ_NOJTAG();
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
diff --git a/Core/Src/stm32f1xx_it.c b/Core/Src/stm32f1xx_it.c
new file mode 100644
index 0000000..16853bf
--- /dev/null
+++ b/Core/Src/stm32f1xx_it.c
@@ -0,0 +1,261 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f1xx_it.c
+ * @brief Interrupt Service Routines.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32f1xx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+extern CAN_HandleTypeDef hcan1;
+extern CAN_HandleTypeDef hcan2;
+extern UART_HandleTypeDef huart2;
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex-M3 Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+ while (1)
+ {
+ }
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Prefetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32F1xx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32f1xx.s). */
+/******************************************************************************/
+
+/**
+ * @brief This function handles CAN1 RX0 interrupt.
+ */
+void CAN1_RX0_IRQHandler(void)
+{
+ /* USER CODE BEGIN CAN1_RX0_IRQn 0 */
+
+ /* USER CODE END CAN1_RX0_IRQn 0 */
+ HAL_CAN_IRQHandler(&hcan1);
+ /* USER CODE BEGIN CAN1_RX0_IRQn 1 */
+
+ /* USER CODE END CAN1_RX0_IRQn 1 */
+}
+
+/**
+ * @brief This function handles USART2 global interrupt.
+ */
+void USART2_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART2_IRQn 0 */
+
+ /* USER CODE END USART2_IRQn 0 */
+ HAL_UART_IRQHandler(&huart2);
+ /* USER CODE BEGIN USART2_IRQn 1 */
+
+ /* USER CODE END USART2_IRQn 1 */
+}
+
+/**
+ * @brief This function handles CAN2 TX interrupt.
+ */
+void CAN2_TX_IRQHandler(void)
+{
+ /* USER CODE BEGIN CAN2_TX_IRQn 0 */
+
+ /* USER CODE END CAN2_TX_IRQn 0 */
+ HAL_CAN_IRQHandler(&hcan2);
+ /* USER CODE BEGIN CAN2_TX_IRQn 1 */
+
+ /* USER CODE END CAN2_TX_IRQn 1 */
+}
+
+/**
+ * @brief This function handles CAN2 RX1 interrupt.
+ */
+void CAN2_RX1_IRQHandler(void)
+{
+ /* USER CODE BEGIN CAN2_RX1_IRQn 0 */
+
+ /* USER CODE END CAN2_RX1_IRQn 0 */
+ HAL_CAN_IRQHandler(&hcan2);
+ /* USER CODE BEGIN CAN2_RX1_IRQn 1 */
+
+ /* USER CODE END CAN2_RX1_IRQn 1 */
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
diff --git a/Core/Src/syscalls.c b/Core/Src/syscalls.c
new file mode 100644
index 0000000..d190edf
--- /dev/null
+++ b/Core/Src/syscalls.c
@@ -0,0 +1,176 @@
+/**
+ ******************************************************************************
+ * @file syscalls.c
+ * @author Auto-generated by STM32CubeIDE
+ * @brief STM32CubeIDE Minimal System calls file
+ *
+ * For more information about which c-functions
+ * need which of these lowlevel functions
+ * please consult the Newlib libc-manual
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2020-2023 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+/* Includes */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+/* Variables */
+extern int __io_putchar(int ch) __attribute__((weak));
+extern int __io_getchar(void) __attribute__((weak));
+
+
+char *__env[1] = { 0 };
+char **environ = __env;
+
+
+/* Functions */
+void initialise_monitor_handles()
+{
+}
+
+int _getpid(void)
+{
+ return 1;
+}
+
+int _kill(int pid, int sig)
+{
+ (void)pid;
+ (void)sig;
+ errno = EINVAL;
+ return -1;
+}
+
+void _exit (int status)
+{
+ _kill(status, -1);
+ while (1) {} /* Make sure we hang here */
+}
+
+__attribute__((weak)) int _read(int file, char *ptr, int len)
+{
+ (void)file;
+ int DataIdx;
+
+ for (DataIdx = 0; DataIdx < len; DataIdx++)
+ {
+ *ptr++ = __io_getchar();
+ }
+
+ return len;
+}
+
+__attribute__((weak)) int _write(int file, char *ptr, int len)
+{
+ (void)file;
+ int DataIdx;
+
+ for (DataIdx = 0; DataIdx < len; DataIdx++)
+ {
+ __io_putchar(*ptr++);
+ }
+ return len;
+}
+
+int _close(int file)
+{
+ (void)file;
+ return -1;
+}
+
+
+int _fstat(int file, struct stat *st)
+{
+ (void)file;
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+int _isatty(int file)
+{
+ (void)file;
+ return 1;
+}
+
+int _lseek(int file, int ptr, int dir)
+{
+ (void)file;
+ (void)ptr;
+ (void)dir;
+ return 0;
+}
+
+int _open(char *path, int flags, ...)
+{
+ (void)path;
+ (void)flags;
+ /* Pretend like we always fail */
+ return -1;
+}
+
+int _wait(int *status)
+{
+ (void)status;
+ errno = ECHILD;
+ return -1;
+}
+
+int _unlink(char *name)
+{
+ (void)name;
+ errno = ENOENT;
+ return -1;
+}
+
+int _times(struct tms *buf)
+{
+ (void)buf;
+ return -1;
+}
+
+int _stat(char *file, struct stat *st)
+{
+ (void)file;
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+int _link(char *old, char *new)
+{
+ (void)old;
+ (void)new;
+ errno = EMLINK;
+ return -1;
+}
+
+int _fork(void)
+{
+ errno = EAGAIN;
+ return -1;
+}
+
+int _execve(char *name, char **argv, char **env)
+{
+ (void)name;
+ (void)argv;
+ (void)env;
+ errno = ENOMEM;
+ return -1;
+}
diff --git a/Core/Src/sysmem.c b/Core/Src/sysmem.c
new file mode 100644
index 0000000..921ecef
--- /dev/null
+++ b/Core/Src/sysmem.c
@@ -0,0 +1,79 @@
+/**
+ ******************************************************************************
+ * @file sysmem.c
+ * @author Generated by STM32CubeIDE
+ * @brief STM32CubeIDE System Memory calls file
+ *
+ * For more information about which C functions
+ * need which of these lowlevel functions
+ * please consult the newlib libc manual
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2023 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+/* Includes */
+#include
+#include
+
+/**
+ * Pointer to the current high watermark of the heap usage
+ */
+static uint8_t *__sbrk_heap_end = NULL;
+
+/**
+ * @brief _sbrk() allocates memory to the newlib heap and is used by malloc
+ * and others from the C library
+ *
+ * @verbatim
+ * ############################################################################
+ * # .data # .bss # newlib heap # MSP stack #
+ * # # # # Reserved by _Min_Stack_Size #
+ * ############################################################################
+ * ^-- RAM start ^-- _end _estack, RAM end --^
+ * @endverbatim
+ *
+ * This implementation starts allocating at the '_end' linker symbol
+ * The '_Min_Stack_Size' linker symbol reserves a memory for the MSP stack
+ * The implementation considers '_estack' linker symbol to be RAM end
+ * NOTE: If the MSP stack, at any point during execution, grows larger than the
+ * reserved size, please increase the '_Min_Stack_Size'.
+ *
+ * @param incr Memory size
+ * @return Pointer to allocated memory
+ */
+void *_sbrk(ptrdiff_t incr)
+{
+ extern uint8_t _end; /* Symbol defined in the linker script */
+ extern uint8_t _estack; /* Symbol defined in the linker script */
+ extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */
+ const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
+ const uint8_t *max_heap = (uint8_t *)stack_limit;
+ uint8_t *prev_heap_end;
+
+ /* Initialize heap end at first call */
+ if (NULL == __sbrk_heap_end)
+ {
+ __sbrk_heap_end = &_end;
+ }
+
+ /* Protect heap from growing into the reserved MSP stack */
+ if (__sbrk_heap_end + incr > max_heap)
+ {
+ errno = ENOMEM;
+ return (void *)-1;
+ }
+
+ prev_heap_end = __sbrk_heap_end;
+ __sbrk_heap_end += incr;
+
+ return (void *)prev_heap_end;
+}
diff --git a/Core/Src/system_stm32f1xx.c b/Core/Src/system_stm32f1xx.c
new file mode 100644
index 0000000..3e277e6
--- /dev/null
+++ b/Core/Src/system_stm32f1xx.c
@@ -0,0 +1,406 @@
+/**
+ ******************************************************************************
+ * @file system_stm32f1xx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
+ *
+ * 1. This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): Setups the system clock (System clock source, PLL Multiplier
+ * factors, AHB/APBx prescalers and Flash settings).
+ * This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32f1xx_xx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ * 2. After each device reset the HSI (8 MHz) is used as system clock source.
+ * Then SystemInit() function is called, in "startup_stm32f1xx_xx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * 4. The default value of HSE crystal is set to 8 MHz (or 25 MHz, depending on
+ * the product used), refer to "HSE_VALUE".
+ * When HSE is used as system clock source, directly or through PLL, and you
+ * are using different crystal you have to adapt the HSE value to your own
+ * configuration.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2017-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32f1xx_system
+ * @{
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Includes
+ * @{
+ */
+
+#include "stm32f1xx.h"
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Defines
+ * @{
+ */
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE 8000000U /*!< Default value of the External oscillator in Hz.
+ This value can be provided and adapted by the user application. */
+#endif /* HSE_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE 8000000U /*!< Default value of the Internal oscillator in Hz.
+ This value can be provided and adapted by the user application. */
+#endif /* HSI_VALUE */
+
+/*!< Uncomment the following line if you need to use external SRAM */
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
+/* #define DATA_IN_ExtSRAM */
+#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
+
+/* Note: Following vector table addresses must be defined in line with linker
+ configuration. */
+/*!< Uncomment the following line if you need to relocate the vector table
+ anywhere in Flash or Sram, else the vector table is kept at the automatic
+ remap of boot address selected */
+/* #define USER_VECT_TAB_ADDRESS */
+
+#if defined(USER_VECT_TAB_ADDRESS)
+/*!< Uncomment the following line if you need to relocate your vector Table
+ in Sram else user remap will be done in Flash. */
+/* #define VECT_TAB_SRAM */
+#if defined(VECT_TAB_SRAM)
+#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
+ This value must be a multiple of 0x200. */
+#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+#else
+#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
+ This value must be a multiple of 0x200. */
+#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+#endif /* VECT_TAB_SRAM */
+#endif /* USER_VECT_TAB_ADDRESS */
+
+/******************************************************************************/
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Variables
+ * @{
+ */
+
+ /* This variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+uint32_t SystemCoreClock = 16000000;
+const uint8_t AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
+const uint8_t APBPrescTable[8U] = {0, 0, 0, 0, 1, 2, 3, 4};
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
+#ifdef DATA_IN_ExtSRAM
+ static void SystemInit_ExtMemCtl(void);
+#endif /* DATA_IN_ExtSRAM */
+#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Functions
+ * @{
+ */
+
+/**
+ * @brief Setup the microcontroller system
+ * Initialize the Embedded Flash Interface, the PLL and update the
+ * SystemCoreClock variable.
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+void SystemInit (void)
+{
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
+ #ifdef DATA_IN_ExtSRAM
+ SystemInit_ExtMemCtl();
+ #endif /* DATA_IN_ExtSRAM */
+#endif
+
+ /* Configure the Vector Table location -------------------------------------*/
+#if defined(USER_VECT_TAB_ADDRESS)
+ SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
+#endif /* USER_VECT_TAB_ADDRESS */
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**)
+ * or HSI_VALUE(*) multiplied by the PLL factors.
+ *
+ * (*) HSI_VALUE is a constant defined in stm32f1xx.h file (default value
+ * 8 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSE_VALUE is a constant defined in stm32f1xx.h file (default value
+ * 8 MHz or 25 MHz, depending on the product used), user has to ensure
+ * that HSE_VALUE is same as the real frequency of the crystal used.
+ * Otherwise, this function may have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate (void)
+{
+ uint32_t tmp = 0U, pllmull = 0U, pllsource = 0U;
+
+#if defined(STM32F105xC) || defined(STM32F107xC)
+ uint32_t prediv1source = 0U, prediv1factor = 0U, prediv2factor = 0U, pll2mull = 0U;
+#endif /* STM32F105xC */
+
+#if defined(STM32F100xB) || defined(STM32F100xE)
+ uint32_t prediv1factor = 0U;
+#endif /* STM32F100xB or STM32F100xE */
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ tmp = RCC->CFGR & RCC_CFGR_SWS;
+
+ switch (tmp)
+ {
+ case 0x00U: /* HSI used as system clock */
+ SystemCoreClock = HSI_VALUE;
+ break;
+ case 0x04U: /* HSE used as system clock */
+ SystemCoreClock = HSE_VALUE;
+ break;
+ case 0x08U: /* PLL used as system clock */
+
+ /* Get PLL clock source and multiplication factor ----------------------*/
+ pllmull = RCC->CFGR & RCC_CFGR_PLLMULL;
+ pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
+
+#if !defined(STM32F105xC) && !defined(STM32F107xC)
+ pllmull = ( pllmull >> 18U) + 2U;
+
+ if (pllsource == 0x00U)
+ {
+ /* HSI oscillator clock divided by 2 selected as PLL clock entry */
+ SystemCoreClock = (HSI_VALUE >> 1U) * pllmull;
+ }
+ else
+ {
+ #if defined(STM32F100xB) || defined(STM32F100xE)
+ prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;
+ /* HSE oscillator clock selected as PREDIV1 clock entry */
+ SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
+ #else
+ /* HSE selected as PLL clock entry */
+ if ((RCC->CFGR & RCC_CFGR_PLLXTPRE) != (uint32_t)RESET)
+ {/* HSE oscillator clock divided by 2 */
+ SystemCoreClock = (HSE_VALUE >> 1U) * pllmull;
+ }
+ else
+ {
+ SystemCoreClock = HSE_VALUE * pllmull;
+ }
+ #endif
+ }
+#else
+ pllmull = pllmull >> 18U;
+
+ if (pllmull != 0x0DU)
+ {
+ pllmull += 2U;
+ }
+ else
+ { /* PLL multiplication factor = PLL input clock * 6.5 */
+ pllmull = 13U / 2U;
+ }
+
+ if (pllsource == 0x00U)
+ {
+ /* HSI oscillator clock divided by 2 selected as PLL clock entry */
+ SystemCoreClock = (HSI_VALUE >> 1U) * pllmull;
+ }
+ else
+ {/* PREDIV1 selected as PLL clock entry */
+
+ /* Get PREDIV1 clock source and division factor */
+ prediv1source = RCC->CFGR2 & RCC_CFGR2_PREDIV1SRC;
+ prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;
+
+ if (prediv1source == 0U)
+ {
+ /* HSE oscillator clock selected as PREDIV1 clock entry */
+ SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
+ }
+ else
+ {/* PLL2 clock selected as PREDIV1 clock entry */
+
+ /* Get PREDIV2 division factor and PLL2 multiplication factor */
+ prediv2factor = ((RCC->CFGR2 & RCC_CFGR2_PREDIV2) >> 4U) + 1U;
+ pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8U) + 2U;
+ SystemCoreClock = (((HSE_VALUE / prediv2factor) * pll2mull) / prediv1factor) * pllmull;
+ }
+ }
+#endif /* STM32F105xC */
+ break;
+
+ default:
+ SystemCoreClock = HSI_VALUE;
+ break;
+ }
+
+ /* Compute HCLK clock frequency ----------------*/
+ /* Get HCLK prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4U)];
+ /* HCLK clock frequency */
+ SystemCoreClock >>= tmp;
+}
+
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
+/**
+ * @brief Setup the external memory controller. Called in startup_stm32f1xx.s
+ * before jump to __main
+ * @param None
+ * @retval None
+ */
+#ifdef DATA_IN_ExtSRAM
+/**
+ * @brief Setup the external memory controller.
+ * Called in startup_stm32f1xx_xx.s/.c before jump to main.
+ * This function configures the external SRAM mounted on STM3210E-EVAL
+ * board (STM32 High density devices). This SRAM will be used as program
+ * data memory (including heap and stack).
+ * @param None
+ * @retval None
+ */
+void SystemInit_ExtMemCtl(void)
+{
+ __IO uint32_t tmpreg;
+ /*!< FSMC Bank1 NOR/SRAM3 is used for the STM3210E-EVAL, if another Bank is
+ required, then adjust the Register Addresses */
+
+ /* Enable FSMC clock */
+ RCC->AHBENR = 0x00000114U;
+
+ /* Delay after an RCC peripheral clock enabling */
+ tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);
+
+ /* Enable GPIOD, GPIOE, GPIOF and GPIOG clocks */
+ RCC->APB2ENR = 0x000001E0U;
+
+ /* Delay after an RCC peripheral clock enabling */
+ tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPDEN);
+
+ (void)(tmpreg);
+
+/* --------------- SRAM Data lines, NOE and NWE configuration ---------------*/
+/*---------------- SRAM Address lines configuration -------------------------*/
+/*---------------- NOE and NWE configuration --------------------------------*/
+/*---------------- NE3 configuration ----------------------------------------*/
+/*---------------- NBL0, NBL1 configuration ---------------------------------*/
+
+ GPIOD->CRL = 0x44BB44BBU;
+ GPIOD->CRH = 0xBBBBBBBBU;
+
+ GPIOE->CRL = 0xB44444BBU;
+ GPIOE->CRH = 0xBBBBBBBBU;
+
+ GPIOF->CRL = 0x44BBBBBBU;
+ GPIOF->CRH = 0xBBBB4444U;
+
+ GPIOG->CRL = 0x44BBBBBBU;
+ GPIOG->CRH = 0x444B4B44U;
+
+/*---------------- FSMC Configuration ---------------------------------------*/
+/*---------------- Enable FSMC Bank1_SRAM Bank ------------------------------*/
+
+ FSMC_Bank1->BTCR[4U] = 0x00001091U;
+ FSMC_Bank1->BTCR[5U] = 0x00110212U;
+}
+#endif /* DATA_IN_ExtSRAM */
+#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
diff --git a/Core/Src/usart.c b/Core/Src/usart.c
new file mode 100644
index 0000000..d97daeb
--- /dev/null
+++ b/Core/Src/usart.c
@@ -0,0 +1,124 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file usart.c
+ * @brief This file provides code for the configuration
+ * of the USART instances.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Includes ------------------------------------------------------------------*/
+#include "usart.h"
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+UART_HandleTypeDef huart2;
+
+/* USART2 init function */
+
+void MX_USART2_UART_Init(void)
+{
+
+ /* USER CODE BEGIN USART2_Init 0 */
+
+ /* USER CODE END USART2_Init 0 */
+
+ /* USER CODE BEGIN USART2_Init 1 */
+
+ /* USER CODE END USART2_Init 1 */
+ huart2.Instance = USART2;
+ huart2.Init.BaudRate = 115200;
+ huart2.Init.WordLength = UART_WORDLENGTH_8B;
+ huart2.Init.StopBits = UART_STOPBITS_1;
+ huart2.Init.Parity = UART_PARITY_NONE;
+ huart2.Init.Mode = UART_MODE_TX_RX;
+ huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart2.Init.OverSampling = UART_OVERSAMPLING_16;
+ if (HAL_UART_Init(&huart2) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN USART2_Init 2 */
+
+ /* USER CODE END USART2_Init 2 */
+
+}
+
+void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
+{
+
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(uartHandle->Instance==USART2)
+ {
+ /* USER CODE BEGIN USART2_MspInit 0 */
+
+ /* USER CODE END USART2_MspInit 0 */
+ /* USART2 clock enable */
+ __HAL_RCC_USART2_CLK_ENABLE();
+
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+ /**USART2 GPIO Configuration
+ PD5 ------> USART2_TX
+ PD6 ------> USART2_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_5;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+
+ __HAL_AFIO_REMAP_USART2_ENABLE();
+
+ /* USART2 interrupt Init */
+ HAL_NVIC_SetPriority(USART2_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(USART2_IRQn);
+ /* USER CODE BEGIN USART2_MspInit 1 */
+
+ /* USER CODE END USART2_MspInit 1 */
+ }
+}
+
+void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
+{
+
+ if(uartHandle->Instance==USART2)
+ {
+ /* USER CODE BEGIN USART2_MspDeInit 0 */
+
+ /* USER CODE END USART2_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART2_CLK_DISABLE();
+
+ /**USART2 GPIO Configuration
+ PD5 ------> USART2_TX
+ PD6 ------> USART2_RX
+ */
+ HAL_GPIO_DeInit(GPIOD, GPIO_PIN_5|GPIO_PIN_6);
+
+ /* USART2 interrupt Deinit */
+ HAL_NVIC_DisableIRQ(USART2_IRQn);
+ /* USER CODE BEGIN USART2_MspDeInit 1 */
+
+ /* USER CODE END USART2_MspDeInit 1 */
+ }
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
diff --git a/Core/Startup/startup_stm32f107vctx.s b/Core/Startup/startup_stm32f107vctx.s
new file mode 100644
index 0000000..2d1b748
--- /dev/null
+++ b/Core/Startup/startup_stm32f107vctx.s
@@ -0,0 +1,472 @@
+/**
+ *************** (C) COPYRIGHT 2017 STMicroelectronics ************************
+ * @file startup_stm32f107xc.s
+ * @author MCD Application Team
+ * @brief STM32F107xC Devices vector table for Atollic toolchain.
+ * This module performs:
+ * - Set the initial SP
+ * - Set the initial PC == Reset_Handler,
+ * - Set the vector table entries with the exceptions ISR address
+ * - Configure the clock system
+ * - Branches to main in the C library (which eventually
+ * calls main()).
+ * After Reset the Cortex-M3 processor is in Thread mode,
+ * priority is Privileged, and the Stack is set to Main.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2017-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+ .syntax unified
+ .cpu cortex-m3
+ .fpu softvfp
+ .thumb
+
+.global g_pfnVectors
+.global Default_Handler
+
+/* start address for the initialization values of the .data section.
+defined in linker script */
+.word _sidata
+/* start address for the .data section. defined in linker script */
+.word _sdata
+/* end address for the .data section. defined in linker script */
+.word _edata
+/* start address for the .bss section. defined in linker script */
+.word _sbss
+/* end address for the .bss section. defined in linker script */
+.word _ebss
+
+.equ BootRAM, 0xF1E0F85F
+/**
+ * @brief This is the code that gets called when the processor first
+ * starts execution following a reset event. Only the absolutely
+ * necessary set is performed, after which the application
+ * supplied main() routine is called.
+ * @param None
+ * @retval : None
+*/
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+
+/* Call the clock system initialization function.*/
+ bl SystemInit
+
+/* Copy the data segment initializers from flash to SRAM */
+ ldr r0, =_sdata
+ ldr r1, =_edata
+ ldr r2, =_sidata
+ movs r3, #0
+ b LoopCopyDataInit
+
+CopyDataInit:
+ ldr r4, [r2, r3]
+ str r4, [r0, r3]
+ adds r3, r3, #4
+
+LoopCopyDataInit:
+ adds r4, r0, r3
+ cmp r4, r1
+ bcc CopyDataInit
+
+/* Zero fill the bss segment. */
+ ldr r2, =_sbss
+ ldr r4, =_ebss
+ movs r3, #0
+ b LoopFillZerobss
+
+FillZerobss:
+ str r3, [r2]
+ adds r2, r2, #4
+
+LoopFillZerobss:
+ cmp r2, r4
+ bcc FillZerobss
+
+
+/* Call static constructors */
+ bl __libc_init_array
+/* Call the application's entry point.*/
+ bl main
+ bx lr
+.size Reset_Handler, .-Reset_Handler
+
+/**
+ * @brief This is the code that gets called when the processor receives an
+ * unexpected interrupt. This simply enters an infinite loop, preserving
+ * the system state for examination by a debugger.
+ *
+ * @param None
+ * @retval : None
+*/
+ .section .text.Default_Handler,"ax",%progbits
+Default_Handler:
+Infinite_Loop:
+ b Infinite_Loop
+ .size Default_Handler, .-Default_Handler
+
+/******************************************************************************
+*
+* The minimal vector table for a Cortex M3. Note that the proper constructs
+* must be placed on this to ensure that it ends up at physical address
+* 0x0000.0000.
+*
+******************************************************************************/
+ .section .isr_vector,"a",%progbits
+ .type g_pfnVectors, %object
+ .size g_pfnVectors, .-g_pfnVectors
+
+
+g_pfnVectors:
+
+ .word _estack
+ .word Reset_Handler
+ .word NMI_Handler
+ .word HardFault_Handler
+ .word MemManage_Handler
+ .word BusFault_Handler
+ .word UsageFault_Handler
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word SVC_Handler
+ .word DebugMon_Handler
+ .word 0
+ .word PendSV_Handler
+ .word SysTick_Handler
+ .word WWDG_IRQHandler
+ .word PVD_IRQHandler
+ .word TAMPER_IRQHandler
+ .word RTC_IRQHandler
+ .word FLASH_IRQHandler
+ .word RCC_IRQHandler
+ .word EXTI0_IRQHandler
+ .word EXTI1_IRQHandler
+ .word EXTI2_IRQHandler
+ .word EXTI3_IRQHandler
+ .word EXTI4_IRQHandler
+ .word DMA1_Channel1_IRQHandler
+ .word DMA1_Channel2_IRQHandler
+ .word DMA1_Channel3_IRQHandler
+ .word DMA1_Channel4_IRQHandler
+ .word DMA1_Channel5_IRQHandler
+ .word DMA1_Channel6_IRQHandler
+ .word DMA1_Channel7_IRQHandler
+ .word ADC1_2_IRQHandler
+ .word CAN1_TX_IRQHandler
+ .word CAN1_RX0_IRQHandler
+ .word CAN1_RX1_IRQHandler
+ .word CAN1_SCE_IRQHandler
+ .word EXTI9_5_IRQHandler
+ .word TIM1_BRK_IRQHandler
+ .word TIM1_UP_IRQHandler
+ .word TIM1_TRG_COM_IRQHandler
+ .word TIM1_CC_IRQHandler
+ .word TIM2_IRQHandler
+ .word TIM3_IRQHandler
+ .word TIM4_IRQHandler
+ .word I2C1_EV_IRQHandler
+ .word I2C1_ER_IRQHandler
+ .word I2C2_EV_IRQHandler
+ .word I2C2_ER_IRQHandler
+ .word SPI1_IRQHandler
+ .word SPI2_IRQHandler
+ .word USART1_IRQHandler
+ .word USART2_IRQHandler
+ .word USART3_IRQHandler
+ .word EXTI15_10_IRQHandler
+ .word RTC_Alarm_IRQHandler
+ .word OTG_FS_WKUP_IRQHandler
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word TIM5_IRQHandler
+ .word SPI3_IRQHandler
+ .word UART4_IRQHandler
+ .word UART5_IRQHandler
+ .word TIM6_IRQHandler
+ .word TIM7_IRQHandler
+ .word DMA2_Channel1_IRQHandler
+ .word DMA2_Channel2_IRQHandler
+ .word DMA2_Channel3_IRQHandler
+ .word DMA2_Channel4_IRQHandler
+ .word DMA2_Channel5_IRQHandler
+ .word ETH_IRQHandler
+ .word ETH_WKUP_IRQHandler
+ .word CAN2_TX_IRQHandler
+ .word CAN2_RX0_IRQHandler
+ .word CAN2_RX1_IRQHandler
+ .word CAN2_SCE_IRQHandler
+ .word OTG_FS_IRQHandler
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word BootRAM /* @0x1E0. This is for boot in RAM mode for
+ STM32F10x Connectivity line Devices. */
+
+/*******************************************************************************
+*
+* Provide weak aliases for each Exception handler to the Default_Handler.
+* As they are weak aliases, any function with the same name will override
+* this definition.
+*
+*******************************************************************************/
+ .weak NMI_Handler
+ .thumb_set NMI_Handler,Default_Handler
+
+ .weak HardFault_Handler
+ .thumb_set HardFault_Handler,Default_Handler
+
+ .weak MemManage_Handler
+ .thumb_set MemManage_Handler,Default_Handler
+
+ .weak BusFault_Handler
+ .thumb_set BusFault_Handler,Default_Handler
+
+ .weak UsageFault_Handler
+ .thumb_set UsageFault_Handler,Default_Handler
+
+ .weak SVC_Handler
+ .thumb_set SVC_Handler,Default_Handler
+
+ .weak DebugMon_Handler
+ .thumb_set DebugMon_Handler,Default_Handler
+
+ .weak PendSV_Handler
+ .thumb_set PendSV_Handler,Default_Handler
+
+ .weak SysTick_Handler
+ .thumb_set SysTick_Handler,Default_Handler
+
+ .weak WWDG_IRQHandler
+ .thumb_set WWDG_IRQHandler,Default_Handler
+
+ .weak PVD_IRQHandler
+ .thumb_set PVD_IRQHandler,Default_Handler
+
+ .weak TAMPER_IRQHandler
+ .thumb_set TAMPER_IRQHandler,Default_Handler
+
+ .weak RTC_IRQHandler
+ .thumb_set RTC_IRQHandler,Default_Handler
+
+ .weak FLASH_IRQHandler
+ .thumb_set FLASH_IRQHandler,Default_Handler
+
+ .weak RCC_IRQHandler
+ .thumb_set RCC_IRQHandler,Default_Handler
+
+ .weak EXTI0_IRQHandler
+ .thumb_set EXTI0_IRQHandler,Default_Handler
+
+ .weak EXTI1_IRQHandler
+ .thumb_set EXTI1_IRQHandler,Default_Handler
+
+ .weak EXTI2_IRQHandler
+ .thumb_set EXTI2_IRQHandler,Default_Handler
+
+ .weak EXTI3_IRQHandler
+ .thumb_set EXTI3_IRQHandler,Default_Handler
+
+ .weak EXTI4_IRQHandler
+ .thumb_set EXTI4_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel1_IRQHandler
+ .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel2_IRQHandler
+ .thumb_set DMA1_Channel2_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel3_IRQHandler
+ .thumb_set DMA1_Channel3_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel4_IRQHandler
+ .thumb_set DMA1_Channel4_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel5_IRQHandler
+ .thumb_set DMA1_Channel5_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel6_IRQHandler
+ .thumb_set DMA1_Channel6_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel7_IRQHandler
+ .thumb_set DMA1_Channel7_IRQHandler,Default_Handler
+
+ .weak ADC1_2_IRQHandler
+ .thumb_set ADC1_2_IRQHandler,Default_Handler
+
+ .weak CAN1_TX_IRQHandler
+ .thumb_set CAN1_TX_IRQHandler,Default_Handler
+
+ .weak CAN1_RX0_IRQHandler
+ .thumb_set CAN1_RX0_IRQHandler,Default_Handler
+
+ .weak CAN1_RX1_IRQHandler
+ .thumb_set CAN1_RX1_IRQHandler,Default_Handler
+
+ .weak CAN1_SCE_IRQHandler
+ .thumb_set CAN1_SCE_IRQHandler,Default_Handler
+
+ .weak EXTI9_5_IRQHandler
+ .thumb_set EXTI9_5_IRQHandler,Default_Handler
+
+ .weak TIM1_BRK_IRQHandler
+ .thumb_set TIM1_BRK_IRQHandler,Default_Handler
+
+ .weak TIM1_UP_IRQHandler
+ .thumb_set TIM1_UP_IRQHandler,Default_Handler
+
+ .weak TIM1_TRG_COM_IRQHandler
+ .thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler
+
+ .weak TIM1_CC_IRQHandler
+ .thumb_set TIM1_CC_IRQHandler,Default_Handler
+
+ .weak TIM2_IRQHandler
+ .thumb_set TIM2_IRQHandler,Default_Handler
+
+ .weak TIM3_IRQHandler
+ .thumb_set TIM3_IRQHandler,Default_Handler
+
+ .weak TIM4_IRQHandler
+ .thumb_set TIM4_IRQHandler,Default_Handler
+
+ .weak I2C1_EV_IRQHandler
+ .thumb_set I2C1_EV_IRQHandler,Default_Handler
+
+ .weak I2C1_ER_IRQHandler
+ .thumb_set I2C1_ER_IRQHandler,Default_Handler
+
+ .weak I2C2_EV_IRQHandler
+ .thumb_set I2C2_EV_IRQHandler,Default_Handler
+
+ .weak I2C2_ER_IRQHandler
+ .thumb_set I2C2_ER_IRQHandler,Default_Handler
+
+ .weak SPI1_IRQHandler
+ .thumb_set SPI1_IRQHandler,Default_Handler
+
+ .weak SPI2_IRQHandler
+ .thumb_set SPI2_IRQHandler,Default_Handler
+
+ .weak USART1_IRQHandler
+ .thumb_set USART1_IRQHandler,Default_Handler
+
+ .weak USART2_IRQHandler
+ .thumb_set USART2_IRQHandler,Default_Handler
+
+ .weak USART3_IRQHandler
+ .thumb_set USART3_IRQHandler,Default_Handler
+
+ .weak EXTI15_10_IRQHandler
+ .thumb_set EXTI15_10_IRQHandler,Default_Handler
+
+ .weak RTC_Alarm_IRQHandler
+ .thumb_set RTC_Alarm_IRQHandler,Default_Handler
+
+ .weak OTG_FS_WKUP_IRQHandler
+ .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler
+
+ .weak TIM5_IRQHandler
+ .thumb_set TIM5_IRQHandler,Default_Handler
+
+ .weak SPI3_IRQHandler
+ .thumb_set SPI3_IRQHandler,Default_Handler
+
+ .weak UART4_IRQHandler
+ .thumb_set UART4_IRQHandler,Default_Handler
+
+ .weak UART5_IRQHandler
+ .thumb_set UART5_IRQHandler,Default_Handler
+
+ .weak TIM6_IRQHandler
+ .thumb_set TIM6_IRQHandler,Default_Handler
+
+ .weak TIM7_IRQHandler
+ .thumb_set TIM7_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel1_IRQHandler
+ .thumb_set DMA2_Channel1_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel2_IRQHandler
+ .thumb_set DMA2_Channel2_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel3_IRQHandler
+ .thumb_set DMA2_Channel3_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel4_IRQHandler
+ .thumb_set DMA2_Channel4_IRQHandler,Default_Handler
+
+ .weak DMA2_Channel5_IRQHandler
+ .thumb_set DMA2_Channel5_IRQHandler,Default_Handler
+
+ .weak ETH_IRQHandler
+ .thumb_set ETH_IRQHandler,Default_Handler
+
+ .weak ETH_WKUP_IRQHandler
+ .thumb_set ETH_WKUP_IRQHandler,Default_Handler
+
+ .weak CAN2_TX_IRQHandler
+ .thumb_set CAN2_TX_IRQHandler,Default_Handler
+
+ .weak CAN2_RX0_IRQHandler
+ .thumb_set CAN2_RX0_IRQHandler,Default_Handler
+
+ .weak CAN2_RX1_IRQHandler
+ .thumb_set CAN2_RX1_IRQHandler,Default_Handler
+
+ .weak CAN2_SCE_IRQHandler
+ .thumb_set CAN2_SCE_IRQHandler,Default_Handler
+
+ .weak OTG_FS_IRQHandler
+ .thumb_set OTG_FS_IRQHandler ,Default_Handler
+
diff --git a/Debug/Core/Src/adc.cyclo b/Debug/Core/Src/adc.cyclo
new file mode 100644
index 0000000..5946961
--- /dev/null
+++ b/Debug/Core/Src/adc.cyclo
@@ -0,0 +1,3 @@
+adc.c:30:6:MX_ADC1_Init 3
+adc.c:72:6:HAL_ADC_MspInit 2
+adc.c:105:6:HAL_ADC_MspDeInit 2
diff --git a/Debug/Core/Src/board.cyclo b/Debug/Core/Src/board.cyclo
new file mode 100644
index 0000000..b25922f
--- /dev/null
+++ b/Debug/Core/Src/board.cyclo
@@ -0,0 +1,8 @@
+board.c:18:6:GBT_Lock 2
+board.c:29:9:GBT_LockGetState 1
+board.c:35:6:RELAY_Write 3
+board.c:41:9:GetBoardTemp 1
+board.c:53:6:Init_Peripheral 1
+board.c:60:9:GBT_ReadTemp 1
+board.c:65:6:ADC_Select_Channel 2
+board.c:76:9:SW_GetAddr 4
diff --git a/Debug/Core/Src/can.cyclo b/Debug/Core/Src/can.cyclo
new file mode 100644
index 0000000..d2d4b86
--- /dev/null
+++ b/Debug/Core/Src/can.cyclo
@@ -0,0 +1,4 @@
+can.c:31:6:MX_CAN1_Init 2
+can.c:63:6:MX_CAN2_Init 2
+can.c:97:6:HAL_CAN_MspInit 5
+can.c:176:6:HAL_CAN_MspDeInit 5
diff --git a/Debug/Core/Src/charger_gbt.cyclo b/Debug/Core/Src/charger_gbt.cyclo
new file mode 100644
index 0000000..9c3adda
--- /dev/null
+++ b/Debug/Core/Src/charger_gbt.cyclo
@@ -0,0 +1,10 @@
+charger_gbt.c:44:6:GBT_Init 1
+charger_gbt.c:49:9:GBT_CC_GetState 9
+charger_gbt.c:72:7:GBT_CC_GetAdc 1
+charger_gbt.c:92:6:GBT_ChargerTask 52
+charger_gbt.c:319:6:GBT_SwitchState 14
+charger_gbt.c:340:10:GBT_StateTick 1
+charger_gbt.c:344:6:GBT_Delay 1
+charger_gbt.c:348:6:GBT_Stop 2
+charger_gbt.c:352:6:GBT_Stop1 1
+charger_gbt.c:358:6:GBT_Start 1
diff --git a/Debug/Core/Src/debug.cyclo b/Debug/Core/Src/debug.cyclo
new file mode 100644
index 0000000..57fac2c
--- /dev/null
+++ b/Debug/Core/Src/debug.cyclo
@@ -0,0 +1,6 @@
+core_cm3.h:1762:34:__NVIC_SystemReset 1
+debug.c:23:5:_write 1
+debug.c:30:6:debug_rx_interrupt 1
+debug.c:36:6:debug_init 1
+debug.c:46:6:parse_command 23
+debug.c:175:6:debug_task 2
diff --git a/Debug/Core/Src/edcan_handler_user.cyclo b/Debug/Core/Src/edcan_handler_user.cyclo
new file mode 100644
index 0000000..494a9d2
--- /dev/null
+++ b/Debug/Core/Src/edcan_handler_user.cyclo
@@ -0,0 +1,3 @@
+edcan_handler_user.c:94:6:EDCAN_ReadHandler 2
+edcan_handler_user.c:138:6:EDCAN_WriteUserRegister 13
+edcan_handler_user.c:191:9:EDCAN_GetUserRegisterValue 20
diff --git a/Debug/Core/Src/gbt_packet.cyclo b/Debug/Core/Src/gbt_packet.cyclo
new file mode 100644
index 0000000..48effad
--- /dev/null
+++ b/Debug/Core/Src/gbt_packet.cyclo
@@ -0,0 +1,7 @@
+gbt_packet.c:14:6:GBT_SendCTS 1
+gbt_packet.c:31:6:GBT_SendCML 1
+gbt_packet.c:47:6:GBT_SendCHM 1
+gbt_packet.c:57:6:GBT_SendCRM 1
+gbt_packet.c:72:6:GBT_SendCRO 1
+gbt_packet.c:81:6:GBT_SendCCS 1
+gbt_packet.c:99:6:GBT_SendCST 1
diff --git a/Debug/Core/Src/gpio.cyclo b/Debug/Core/Src/gpio.cyclo
new file mode 100644
index 0000000..c553c50
--- /dev/null
+++ b/Debug/Core/Src/gpio.cyclo
@@ -0,0 +1 @@
+gpio.c:42:6:MX_GPIO_Init 1
diff --git a/Debug/Core/Src/j1939.cyclo b/Debug/Core/Src/j1939.cyclo
new file mode 100644
index 0000000..4b6bd5b
--- /dev/null
+++ b/Debug/Core/Src/j1939.cyclo
@@ -0,0 +1,5 @@
+j1939.c:19:6:HAL_CAN_RxFifo0MsgPendingCallback 20
+j1939.c:104:6:GBT_CAN_ReInit 1
+j1939.c:111:6:J_SendPacket 1
+j1939.c:131:6:J_SendCTS 2
+j1939.c:149:6:J_SendACK 1
diff --git a/Debug/Core/Src/main.cyclo b/Debug/Core/Src/main.cyclo
new file mode 100644
index 0000000..ab33bc0
--- /dev/null
+++ b/Debug/Core/Src/main.cyclo
@@ -0,0 +1,33 @@
+edcan.c:61:6:HAL_CAN_RxFifo1MsgPendingCallback 5
+edcan.c:79:6:HAL_CAN_TxMailbox0CompleteCallback 2
+edcan.c:85:6:HAL_CAN_TxMailbox1CompleteCallback 2
+edcan.c:91:6:HAL_CAN_TxMailbox2CompleteCallback 2
+edcan.c:102:6:EDCAN_Init 1
+edcan.c:111:6:CAN_ReInit 1
+edcan.c:142:6:EDCAN_FilterInit 3
+edcan.c:211:6:EDCAN_SendPacketWrite 1
+edcan.c:320:6:EDCAN_SendPacketRead 1
+edcan.c:358:6:EDCAN_SendPacketReadRequest 1
+edcan.c:392:6:EDCAN_Loop 7
+edcan.c:424:6:EDCAN_EnterSilentMode 2
+edcan.c:437:6:EDCAN_SetSilentMode 2
+edcan_buffer.c:38:6:EDCAN_ExchangeTxBuffer 6
+edcan_buffer.c:78:6:EDCAN_TxBufferAdd 2
+edcan_buffer.c:90:6:EDCAN_TxBufferGet 2
+edcan_buffer.c:103:10:EDCAN_getTxBufferElementCount 1
+edcan_buffer.c:108:6:EDCAN_TxBufferPeekFirst 2
+edcan_buffer.c:119:6:EDCAN_TxBufferRemoveFirst 2
+edcan_buffer.c:132:6:EDCAN_RxBufferAdd 2
+edcan_buffer.c:144:6:EDCAN_RxBufferGet 2
+edcan_buffer.c:157:10:EDCAN_getRxBufferElementCount 1
+edcan_buffer.c:162:6:EDCAN_RxBufferPeekFirst 2
+edcan_buffer.c:173:6:EDCAN_RxBufferRemoveFirst 2
+edcan_buffer.c:185:6:EDCAN_ExchangeRxBuffer 6
+edcan_handler.c:41:6:EDCAN_WriteHandler 3
+edcan_handler.c:61:6:EDCAN_WriteSystemRegister 2
+edcan_handler.c:79:9:EDCAN_GetSystemRegisterValue 8
+edcan_handler.c:120:9:EDCAN_GetOwnRegisterValue 2
+edcan_handler.c:139:6:EDCAN_ReadRequestHandler 5
+main.c:75:5:main 1
+main.c:139:6:SystemClock_Config 4
+main.c:197:6:Error_Handler 1
diff --git a/Debug/Core/Src/soft_rtc.cyclo b/Debug/Core/Src/soft_rtc.cyclo
new file mode 100644
index 0000000..7abe607
--- /dev/null
+++ b/Debug/Core/Src/soft_rtc.cyclo
@@ -0,0 +1,6 @@
+soft_rtc.c:16:10:get_Current_Time 1
+soft_rtc.c:20:6:set_Time 2
+soft_rtc.c:25:9:to_bcd 1
+soft_rtc.c:29:6:unix_to_bcd 1
+soft_rtc.c:43:6:writeTimeReg 2
+soft_rtc.c:48:9:getTimeReg 5
diff --git a/Debug/Core/Src/stm32f1xx_hal_msp.cyclo b/Debug/Core/Src/stm32f1xx_hal_msp.cyclo
new file mode 100644
index 0000000..b101c83
--- /dev/null
+++ b/Debug/Core/Src/stm32f1xx_hal_msp.cyclo
@@ -0,0 +1 @@
+stm32f1xx_hal_msp.c:63:6:HAL_MspInit 1
diff --git a/Debug/Core/Src/stm32f1xx_it.cyclo b/Debug/Core/Src/stm32f1xx_it.cyclo
new file mode 100644
index 0000000..ac88678
--- /dev/null
+++ b/Debug/Core/Src/stm32f1xx_it.cyclo
@@ -0,0 +1,13 @@
+stm32f1xx_it.c:71:6:NMI_Handler 1
+stm32f1xx_it.c:86:6:HardFault_Handler 1
+stm32f1xx_it.c:101:6:MemManage_Handler 1
+stm32f1xx_it.c:116:6:BusFault_Handler 1
+stm32f1xx_it.c:131:6:UsageFault_Handler 1
+stm32f1xx_it.c:146:6:SVC_Handler 1
+stm32f1xx_it.c:159:6:DebugMon_Handler 1
+stm32f1xx_it.c:172:6:PendSV_Handler 1
+stm32f1xx_it.c:185:6:SysTick_Handler 1
+stm32f1xx_it.c:206:6:CAN1_RX0_IRQHandler 1
+stm32f1xx_it.c:220:6:USART2_IRQHandler 1
+stm32f1xx_it.c:234:6:CAN2_TX_IRQHandler 1
+stm32f1xx_it.c:248:6:CAN2_RX1_IRQHandler 1
diff --git a/Debug/Core/Src/subdir.mk b/Debug/Core/Src/subdir.mk
new file mode 100644
index 0000000..0cecad4
--- /dev/null
+++ b/Debug/Core/Src/subdir.mk
@@ -0,0 +1,75 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+# Toolchain: GNU Tools for STM32 (10.3-2021.10)
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+C_SRCS += \
+../Core/Src/adc.c \
+../Core/Src/board.c \
+../Core/Src/can.c \
+../Core/Src/charger_gbt.c \
+../Core/Src/debug.c \
+../Core/Src/edcan_handler_user.c \
+../Core/Src/gbt_packet.c \
+../Core/Src/gpio.c \
+../Core/Src/j1939.c \
+../Core/Src/main.c \
+../Core/Src/soft_rtc.c \
+../Core/Src/stm32f1xx_hal_msp.c \
+../Core/Src/stm32f1xx_it.c \
+../Core/Src/syscalls.c \
+../Core/Src/sysmem.c \
+../Core/Src/system_stm32f1xx.c \
+../Core/Src/usart.c
+
+OBJS += \
+./Core/Src/adc.o \
+./Core/Src/board.o \
+./Core/Src/can.o \
+./Core/Src/charger_gbt.o \
+./Core/Src/debug.o \
+./Core/Src/edcan_handler_user.o \
+./Core/Src/gbt_packet.o \
+./Core/Src/gpio.o \
+./Core/Src/j1939.o \
+./Core/Src/main.o \
+./Core/Src/soft_rtc.o \
+./Core/Src/stm32f1xx_hal_msp.o \
+./Core/Src/stm32f1xx_it.o \
+./Core/Src/syscalls.o \
+./Core/Src/sysmem.o \
+./Core/Src/system_stm32f1xx.o \
+./Core/Src/usart.o
+
+C_DEPS += \
+./Core/Src/adc.d \
+./Core/Src/board.d \
+./Core/Src/can.d \
+./Core/Src/charger_gbt.d \
+./Core/Src/debug.d \
+./Core/Src/edcan_handler_user.d \
+./Core/Src/gbt_packet.d \
+./Core/Src/gpio.d \
+./Core/Src/j1939.d \
+./Core/Src/main.d \
+./Core/Src/soft_rtc.d \
+./Core/Src/stm32f1xx_hal_msp.d \
+./Core/Src/stm32f1xx_it.d \
+./Core/Src/syscalls.d \
+./Core/Src/sysmem.d \
+./Core/Src/system_stm32f1xx.d \
+./Core/Src/usart.d
+
+
+# Each subdirectory must supply rules for building sources it contributes
+Core/Src/%.o Core/Src/%.su Core/Src/%.cyclo: ../Core/Src/%.c Core/Src/subdir.mk
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F107xC -c -I../Core/Inc -I/Users/colorbass/STM32CubeIDE/workspace_1.12.0/lib_EDCAN -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+
+clean: clean-Core-2f-Src
+
+clean-Core-2f-Src:
+ -$(RM) ./Core/Src/adc.cyclo ./Core/Src/adc.d ./Core/Src/adc.o ./Core/Src/adc.su ./Core/Src/board.cyclo ./Core/Src/board.d ./Core/Src/board.o ./Core/Src/board.su ./Core/Src/can.cyclo ./Core/Src/can.d ./Core/Src/can.o ./Core/Src/can.su ./Core/Src/charger_gbt.cyclo ./Core/Src/charger_gbt.d ./Core/Src/charger_gbt.o ./Core/Src/charger_gbt.su ./Core/Src/debug.cyclo ./Core/Src/debug.d ./Core/Src/debug.o ./Core/Src/debug.su ./Core/Src/edcan_handler_user.cyclo ./Core/Src/edcan_handler_user.d ./Core/Src/edcan_handler_user.o ./Core/Src/edcan_handler_user.su ./Core/Src/gbt_packet.cyclo ./Core/Src/gbt_packet.d ./Core/Src/gbt_packet.o ./Core/Src/gbt_packet.su ./Core/Src/gpio.cyclo ./Core/Src/gpio.d ./Core/Src/gpio.o ./Core/Src/gpio.su ./Core/Src/j1939.cyclo ./Core/Src/j1939.d ./Core/Src/j1939.o ./Core/Src/j1939.su ./Core/Src/main.cyclo ./Core/Src/main.d ./Core/Src/main.o ./Core/Src/main.su ./Core/Src/soft_rtc.cyclo ./Core/Src/soft_rtc.d ./Core/Src/soft_rtc.o ./Core/Src/soft_rtc.su ./Core/Src/stm32f1xx_hal_msp.cyclo ./Core/Src/stm32f1xx_hal_msp.d ./Core/Src/stm32f1xx_hal_msp.o ./Core/Src/stm32f1xx_hal_msp.su ./Core/Src/stm32f1xx_it.cyclo ./Core/Src/stm32f1xx_it.d ./Core/Src/stm32f1xx_it.o ./Core/Src/stm32f1xx_it.su ./Core/Src/syscalls.cyclo ./Core/Src/syscalls.d ./Core/Src/syscalls.o ./Core/Src/syscalls.su ./Core/Src/sysmem.cyclo ./Core/Src/sysmem.d ./Core/Src/sysmem.o ./Core/Src/sysmem.su ./Core/Src/system_stm32f1xx.cyclo ./Core/Src/system_stm32f1xx.d ./Core/Src/system_stm32f1xx.o ./Core/Src/system_stm32f1xx.su ./Core/Src/usart.cyclo ./Core/Src/usart.d ./Core/Src/usart.o ./Core/Src/usart.su
+
+.PHONY: clean-Core-2f-Src
+
diff --git a/Debug/Core/Src/syscalls.cyclo b/Debug/Core/Src/syscalls.cyclo
new file mode 100644
index 0000000..7283e9f
--- /dev/null
+++ b/Debug/Core/Src/syscalls.cyclo
@@ -0,0 +1,18 @@
+syscalls.c:44:6:initialise_monitor_handles 1
+syscalls.c:48:5:_getpid 1
+syscalls.c:53:5:_kill 1
+syscalls.c:61:6:_exit 1
+syscalls.c:67:27:_read 2
+syscalls.c:80:27:_write 2
+syscalls.c:92:5:_close 1
+syscalls.c:99:5:_fstat 1
+syscalls.c:106:5:_isatty 1
+syscalls.c:112:5:_lseek 1
+syscalls.c:120:5:_open 1
+syscalls.c:128:5:_wait 1
+syscalls.c:135:5:_unlink 1
+syscalls.c:142:5:_times 1
+syscalls.c:148:5:_stat 1
+syscalls.c:155:5:_link 1
+syscalls.c:163:5:_fork 1
+syscalls.c:169:5:_execve 1
diff --git a/Debug/Core/Src/sysmem.cyclo b/Debug/Core/Src/sysmem.cyclo
new file mode 100644
index 0000000..611be9f
--- /dev/null
+++ b/Debug/Core/Src/sysmem.cyclo
@@ -0,0 +1 @@
+sysmem.c:53:7:_sbrk 3
diff --git a/Debug/Core/Src/system_stm32f1xx.cyclo b/Debug/Core/Src/system_stm32f1xx.cyclo
new file mode 100644
index 0000000..29b8a79
--- /dev/null
+++ b/Debug/Core/Src/system_stm32f1xx.cyclo
@@ -0,0 +1,2 @@
+system_stm32f1xx.c:175:6:SystemInit 1
+system_stm32f1xx.c:224:6:SystemCoreClockUpdate 8
diff --git a/Debug/Core/Src/usart.cyclo b/Debug/Core/Src/usart.cyclo
new file mode 100644
index 0000000..2c53207
--- /dev/null
+++ b/Debug/Core/Src/usart.cyclo
@@ -0,0 +1,3 @@
+usart.c:31:6:MX_USART2_UART_Init 2
+usart.c:59:6:HAL_UART_MspInit 2
+usart.c:97:6:HAL_UART_MspDeInit 2
diff --git a/Debug/Core/Startup/subdir.mk b/Debug/Core/Startup/subdir.mk
new file mode 100644
index 0000000..09692e7
--- /dev/null
+++ b/Debug/Core/Startup/subdir.mk
@@ -0,0 +1,27 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+# Toolchain: GNU Tools for STM32 (10.3-2021.10)
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+S_SRCS += \
+../Core/Startup/startup_stm32f107vctx.s
+
+OBJS += \
+./Core/Startup/startup_stm32f107vctx.o
+
+S_DEPS += \
+./Core/Startup/startup_stm32f107vctx.d
+
+
+# Each subdirectory must supply rules for building sources it contributes
+Core/Startup/%.o: ../Core/Startup/%.s Core/Startup/subdir.mk
+ arm-none-eabi-gcc -mcpu=cortex-m3 -g3 -DDEBUG -c -I/Users/colorbass/STM32CubeIDE/workspace_1.12.0/lib_EDCAN -x assembler-with-cpp -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@" "$<"
+
+clean: clean-Core-2f-Startup
+
+clean-Core-2f-Startup:
+ -$(RM) ./Core/Startup/startup_stm32f107vctx.d ./Core/Startup/startup_stm32f107vctx.o
+
+.PHONY: clean-Core-2f-Startup
+
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.cyclo
new file mode 100644
index 0000000..f7e211b
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.cyclo
@@ -0,0 +1,25 @@
+stm32f1xx_hal.c:142:19:HAL_Init 1
+stm32f1xx_hal.c:175:19:HAL_DeInit 1
+stm32f1xx_hal.c:200:13:HAL_MspInit 1
+stm32f1xx_hal.c:211:13:HAL_MspDeInit 1
+stm32f1xx_hal.c:234:26:HAL_InitTick 3
+stm32f1xx_hal.c:293:13:HAL_IncTick 1
+stm32f1xx_hal.c:304:17:HAL_GetTick 1
+stm32f1xx_hal.c:313:10:HAL_GetTickPrio 1
+stm32f1xx_hal.c:322:19:HAL_SetTickFreq 3
+stm32f1xx_hal.c:354:21:HAL_GetTickFreq 1
+stm32f1xx_hal.c:370:13:HAL_Delay 3
+stm32f1xx_hal.c:396:13:HAL_SuspendTick 1
+stm32f1xx_hal.c:412:13:HAL_ResumeTick 1
+stm32f1xx_hal.c:422:10:HAL_GetHalVersion 1
+stm32f1xx_hal.c:438:10:HAL_GetREVID 1
+stm32f1xx_hal.c:454:10:HAL_GetDEVID 1
+stm32f1xx_hal.c:463:10:HAL_GetUIDw0 1
+stm32f1xx_hal.c:472:10:HAL_GetUIDw1 1
+stm32f1xx_hal.c:481:10:HAL_GetUIDw2 1
+stm32f1xx_hal.c:490:6:HAL_DBGMCU_EnableDBGSleepMode 1
+stm32f1xx_hal.c:506:6:HAL_DBGMCU_DisableDBGSleepMode 1
+stm32f1xx_hal.c:536:6:HAL_DBGMCU_EnableDBGStopMode 1
+stm32f1xx_hal.c:552:6:HAL_DBGMCU_DisableDBGStopMode 1
+stm32f1xx_hal.c:568:6:HAL_DBGMCU_EnableDBGStandbyMode 1
+stm32f1xx_hal.c:584:6:HAL_DBGMCU_DisableDBGStandbyMode 1
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.cyclo
new file mode 100644
index 0000000..6099d1c
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.cyclo
@@ -0,0 +1,27 @@
+stm32f1xx_hal_adc.c:421:19:HAL_ADC_Init 12
+stm32f1xx_hal_adc.c:639:19:HAL_ADC_DeInit 3
+stm32f1xx_hal_adc.c:787:13:HAL_ADC_MspInit 1
+stm32f1xx_hal_adc.c:801:13:HAL_ADC_MspDeInit 1
+stm32f1xx_hal_adc.c:1046:19:HAL_ADC_Start 13
+stm32f1xx_hal_adc.c:1159:19:HAL_ADC_Stop 3
+stm32f1xx_hal_adc.c:1203:19:HAL_ADC_PollForConversion 25
+stm32f1xx_hal_adc.c:1342:19:HAL_ADC_PollForEvent 6
+stm32f1xx_hal_adc.c:1395:19:HAL_ADC_Start_IT 13
+stm32f1xx_hal_adc.c:1506:19:HAL_ADC_Stop_IT 3
+stm32f1xx_hal_adc.c:1563:19:HAL_ADC_Start_DMA 14
+stm32f1xx_hal_adc.c:1704:19:HAL_ADC_Stop_DMA 5
+stm32f1xx_hal_adc.c:1772:10:HAL_ADC_GetValue 1
+stm32f1xx_hal_adc.c:1789:6:HAL_ADC_IRQHandler 17
+stm32f1xx_hal_adc.c:1916:13:HAL_ADC_ConvCpltCallback 1
+stm32f1xx_hal_adc.c:1930:13:HAL_ADC_ConvHalfCpltCallback 1
+stm32f1xx_hal_adc.c:1944:13:HAL_ADC_LevelOutOfWindowCallback 1
+stm32f1xx_hal_adc.c:1959:13:HAL_ADC_ErrorCallback 1
+stm32f1xx_hal_adc.c:2007:19:HAL_ADC_ConfigChannel 11
+stm32f1xx_hal_adc.c:2117:19:HAL_ADC_AnalogWDGConfig 4
+stm32f1xx_hal_adc.c:2204:10:HAL_ADC_GetState 1
+stm32f1xx_hal_adc.c:2215:10:HAL_ADC_GetError 1
+stm32f1xx_hal_adc.c:2239:19:ADC_Enable 6
+stm32f1xx_hal_adc.c:2298:19:ADC_ConversionStop_Disable 5
+stm32f1xx_hal_adc.c:2340:6:ADC_DMAConvCplt 5
+stm32f1xx_hal_adc.c:2387:6:ADC_DMAHalfConvCplt 1
+stm32f1xx_hal_adc.c:2405:6:ADC_DMAError 1
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.cyclo
new file mode 100644
index 0000000..0e37820
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.cyclo
@@ -0,0 +1,13 @@
+stm32f1xx_hal_adc_ex.c:126:19:HAL_ADCEx_Calibration_Start 10
+stm32f1xx_hal_adc_ex.c:239:19:HAL_ADCEx_InjectedStart 10
+stm32f1xx_hal_adc_ex.c:338:19:HAL_ADCEx_InjectedStop 5
+stm32f1xx_hal_adc_ex.c:391:19:HAL_ADCEx_InjectedPollForConversion 25
+stm32f1xx_hal_adc_ex.c:517:19:HAL_ADCEx_InjectedStart_IT 10
+stm32f1xx_hal_adc_ex.c:616:19:HAL_ADCEx_InjectedStop_IT 5
+stm32f1xx_hal_adc_ex.c:685:19:HAL_ADCEx_MultiModeStart_DMA 7
+stm32f1xx_hal_adc_ex.c:811:19:HAL_ADCEx_MultiModeStop_DMA 4
+stm32f1xx_hal_adc_ex.c:899:10:HAL_ADCEx_InjectedGetValue 5
+stm32f1xx_hal_adc_ex.c:936:10:HAL_ADCEx_MultiModeGetValue 2
+stm32f1xx_hal_adc_ex.c:968:13:HAL_ADCEx_InjectedConvCpltCallback 1
+stm32f1xx_hal_adc_ex.c:1010:19:HAL_ADCEx_InjectedConfigChannel 23
+stm32f1xx_hal_adc_ex.c:1271:19:HAL_ADCEx_MultiModeConfigChannel 5
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.cyclo
new file mode 100644
index 0000000..3d38890
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.cyclo
@@ -0,0 +1,36 @@
+stm32f1xx_hal_can.c:274:19:HAL_CAN_Init 13
+stm32f1xx_hal_can.c:459:19:HAL_CAN_DeInit 2
+stm32f1xx_hal_can.c:506:13:HAL_CAN_MspInit 1
+stm32f1xx_hal_can.c:522:13:HAL_CAN_MspDeInit 1
+stm32f1xx_hal_can.c:838:19:HAL_CAN_ConfigFilter 8
+stm32f1xx_hal_can.c:1004:19:HAL_CAN_Start 4
+stm32f1xx_hal_can.c:1056:19:HAL_CAN_Stop 4
+stm32f1xx_hal_can.c:1111:19:HAL_CAN_RequestSleep 3
+stm32f1xx_hal_can.c:1142:19:HAL_CAN_WakeUp 5
+stm32f1xx_hal_can.c:1191:10:HAL_CAN_IsSleepActive 4
+stm32f1xx_hal_can.c:1222:19:HAL_CAN_AddTxMessage 9
+stm32f1xx_hal_can.c:1330:19:HAL_CAN_AbortTxRequest 6
+stm32f1xx_hal_can.c:1379:10:HAL_CAN_GetTxMailboxesFreeLevel 6
+stm32f1xx_hal_can.c:1422:10:HAL_CAN_IsTxMessagePending 4
+stm32f1xx_hal_can.c:1454:10:HAL_CAN_GetTxTimestamp 3
+stm32f1xx_hal_can.c:1488:19:HAL_CAN_GetRxMessage 8
+stm32f1xx_hal_can.c:1578:10:HAL_CAN_GetRxFifoFillLevel 4
+stm32f1xx_hal_can.c:1631:19:HAL_CAN_ActivateNotification 3
+stm32f1xx_hal_can.c:1664:19:HAL_CAN_DeactivateNotification 3
+stm32f1xx_hal_can.c:1695:6:HAL_CAN_IRQHandler 51
+stm32f1xx_hal_can.c:2106:13:HAL_CAN_TxMailbox0CompleteCallback 1
+stm32f1xx_hal_can.c:2123:13:HAL_CAN_TxMailbox1CompleteCallback 1
+stm32f1xx_hal_can.c:2140:13:HAL_CAN_TxMailbox2CompleteCallback 1
+stm32f1xx_hal_can.c:2157:13:HAL_CAN_TxMailbox0AbortCallback 1
+stm32f1xx_hal_can.c:2174:13:HAL_CAN_TxMailbox1AbortCallback 1
+stm32f1xx_hal_can.c:2191:13:HAL_CAN_TxMailbox2AbortCallback 1
+stm32f1xx_hal_can.c:2208:13:HAL_CAN_RxFifo0MsgPendingCallback 1
+stm32f1xx_hal_can.c:2225:13:HAL_CAN_RxFifo0FullCallback 1
+stm32f1xx_hal_can.c:2242:13:HAL_CAN_RxFifo1MsgPendingCallback 1
+stm32f1xx_hal_can.c:2259:13:HAL_CAN_RxFifo1FullCallback 1
+stm32f1xx_hal_can.c:2276:13:HAL_CAN_SleepCallback 1
+stm32f1xx_hal_can.c:2292:13:HAL_CAN_WakeUpFromRxMsgCallback 1
+stm32f1xx_hal_can.c:2309:13:HAL_CAN_ErrorCallback 1
+stm32f1xx_hal_can.c:2346:22:HAL_CAN_GetState 5
+stm32f1xx_hal_can.c:2381:10:HAL_CAN_GetError 1
+stm32f1xx_hal_can.c:2393:19:HAL_CAN_ResetError 3
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.cyclo
new file mode 100644
index 0000000..7c3bb68
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.cyclo
@@ -0,0 +1,29 @@
+core_cm3.h:1480:22:__NVIC_SetPriorityGrouping 1
+core_cm3.h:1499:26:__NVIC_GetPriorityGrouping 1
+core_cm3.h:1511:22:__NVIC_EnableIRQ 2
+core_cm3.h:1547:22:__NVIC_DisableIRQ 2
+core_cm3.h:1566:26:__NVIC_GetPendingIRQ 2
+core_cm3.h:1585:22:__NVIC_SetPendingIRQ 2
+core_cm3.h:1600:22:__NVIC_ClearPendingIRQ 2
+core_cm3.h:1617:26:__NVIC_GetActive 2
+core_cm3.h:1639:22:__NVIC_SetPriority 2
+core_cm3.h:1661:26:__NVIC_GetPriority 2
+core_cm3.h:1686:26:NVIC_EncodePriority 2
+core_cm3.h:1713:22:NVIC_DecodePriority 2
+core_cm3.h:1762:34:__NVIC_SystemReset 1
+core_cm3.h:1834:26:SysTick_Config 2
+stm32f1xx_hal_cortex.c:143:6:HAL_NVIC_SetPriorityGrouping 1
+stm32f1xx_hal_cortex.c:165:6:HAL_NVIC_SetPriority 1
+stm32f1xx_hal_cortex.c:187:6:HAL_NVIC_EnableIRQ 1
+stm32f1xx_hal_cortex.c:203:6:HAL_NVIC_DisableIRQ 1
+stm32f1xx_hal_cortex.c:216:6:HAL_NVIC_SystemReset 0
+stm32f1xx_hal_cortex.c:229:10:HAL_SYSTICK_Config 1
+stm32f1xx_hal_cortex.c:344:10:HAL_NVIC_GetPriorityGrouping 1
+stm32f1xx_hal_cortex.c:371:6:HAL_NVIC_GetPriority 1
+stm32f1xx_hal_cortex.c:386:6:HAL_NVIC_SetPendingIRQ 1
+stm32f1xx_hal_cortex.c:404:10:HAL_NVIC_GetPendingIRQ 1
+stm32f1xx_hal_cortex.c:420:6:HAL_NVIC_ClearPendingIRQ 1
+stm32f1xx_hal_cortex.c:437:10:HAL_NVIC_GetActive 1
+stm32f1xx_hal_cortex.c:454:6:HAL_SYSTICK_CLKSourceConfig 2
+stm32f1xx_hal_cortex.c:472:6:HAL_SYSTICK_IRQHandler 1
+stm32f1xx_hal_cortex.c:481:13:HAL_SYSTICK_Callback 1
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.cyclo
new file mode 100644
index 0000000..3828986
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.cyclo
@@ -0,0 +1,13 @@
+stm32f1xx_hal_dma.c:143:19:HAL_DMA_Init 3
+stm32f1xx_hal_dma.c:220:19:HAL_DMA_DeInit 3
+stm32f1xx_hal_dma.c:319:19:HAL_DMA_Start 3
+stm32f1xx_hal_dma.c:362:19:HAL_DMA_Start_IT 4
+stm32f1xx_hal_dma.c:416:19:HAL_DMA_Abort 2
+stm32f1xx_hal_dma.c:457:19:HAL_DMA_Abort_IT 26
+stm32f1xx_hal_dma.c:502:19:HAL_DMA_PollForTransfer 102
+stm32f1xx_hal_dma.c:603:6:HAL_DMA_IRQHandler 58
+stm32f1xx_hal_dma.c:693:19:HAL_DMA_RegisterCallback 7
+stm32f1xx_hal_dma.c:744:19:HAL_DMA_UnRegisterCallback 8
+stm32f1xx_hal_dma.c:820:22:HAL_DMA_GetState 1
+stm32f1xx_hal_dma.c:832:10:HAL_DMA_GetError 1
+stm32f1xx_hal_dma.c:858:13:DMA_SetConfig 2
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.cyclo
new file mode 100644
index 0000000..7e53db2
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.cyclo
@@ -0,0 +1,9 @@
+stm32f1xx_hal_exti.c:143:19:HAL_EXTI_SetConfigLine 9
+stm32f1xx_hal_exti.c:238:19:HAL_EXTI_GetConfigLine 9
+stm32f1xx_hal_exti.c:317:19:HAL_EXTI_ClearConfigLine 4
+stm32f1xx_hal_exti.c:370:19:HAL_EXTI_RegisterCallback 2
+stm32f1xx_hal_exti.c:395:19:HAL_EXTI_GetHandle 2
+stm32f1xx_hal_exti.c:435:6:HAL_EXTI_IRQHandler 3
+stm32f1xx_hal_exti.c:467:10:HAL_EXTI_GetPending 1
+stm32f1xx_hal_exti.c:499:6:HAL_EXTI_ClearPending 1
+stm32f1xx_hal_exti.c:523:6:HAL_EXTI_GenerateSWI 1
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.cyclo
new file mode 100644
index 0000000..c985347
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.cyclo
@@ -0,0 +1,14 @@
+stm32f1xx_hal_flash.c:168:19:HAL_FLASH_Program 7
+stm32f1xx_hal_flash.c:267:19:HAL_FLASH_Program_IT 4
+stm32f1xx_hal_flash.c:332:6:HAL_FLASH_IRQHandler 12
+stm32f1xx_hal_flash.c:606:13:HAL_FLASH_EndOfOperationCallback 1
+stm32f1xx_hal_flash.c:624:13:HAL_FLASH_OperationErrorCallback 1
+stm32f1xx_hal_flash.c:657:19:HAL_FLASH_Unlock 3
+stm32f1xx_hal_flash.c:695:19:HAL_FLASH_Lock 1
+stm32f1xx_hal_flash.c:712:19:HAL_FLASH_OB_Unlock 2
+stm32f1xx_hal_flash.c:732:19:HAL_FLASH_OB_Lock 1
+stm32f1xx_hal_flash.c:745:6:HAL_FLASH_OB_Launch 1
+stm32f1xx_hal_flash.c:774:10:HAL_FLASH_GetError 1
+stm32f1xx_hal_flash.c:797:13:FLASH_Program_HalfWord 1
+stm32f1xx_hal_flash.c:826:19:FLASH_WaitForLastOperation 9
+stm32f1xx_hal_flash.c:914:13:FLASH_SetErrorCode 5
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.cyclo
new file mode 100644
index 0000000..bb7d7db
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.cyclo
@@ -0,0 +1,16 @@
+stm32f1xx_hal_flash_ex.c:159:19:HAL_FLASHEx_Erase 7
+stm32f1xx_hal_flash_ex.c:319:19:HAL_FLASHEx_Erase_IT 4
+stm32f1xx_hal_flash_ex.c:397:19:HAL_FLASHEx_OBErase 3
+stm32f1xx_hal_flash_ex.c:446:19:HAL_FLASHEx_OBProgram 11
+stm32f1xx_hal_flash_ex.c:527:6:HAL_FLASHEx_OBGetConfig 1
+stm32f1xx_hal_flash_ex.c:549:10:HAL_FLASHEx_OBGetUserData 2
+stm32f1xx_hal_flash_ex.c:595:13:FLASH_MassErase 1
+stm32f1xx_hal_flash_ex.c:644:26:FLASH_OB_EnableWRP 10
+stm32f1xx_hal_flash_ex.c:767:26:FLASH_OB_DisableWRP 10
+stm32f1xx_hal_flash_ex.c:886:26:FLASH_OB_RDP_LevelConfig 3
+stm32f1xx_hal_flash_ex.c:937:26:FLASH_OB_UserConfig 2
+stm32f1xx_hal_flash_ex.c:988:26:FLASH_OB_ProgramData 2
+stm32f1xx_hal_flash_ex.c:1021:17:FLASH_OB_GetWRP 1
+stm32f1xx_hal_flash_ex.c:1034:17:FLASH_OB_GetRDP 2
+stm32f1xx_hal_flash_ex.c:1060:16:FLASH_OB_GetUser 1
+stm32f1xx_hal_flash_ex.c:1089:6:FLASH_PageErase 1
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.cyclo
new file mode 100644
index 0000000..c104373
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.cyclo
@@ -0,0 +1,8 @@
+stm32f1xx_hal_gpio.c:178:6:HAL_GPIO_Init 34
+stm32f1xx_hal_gpio.c:351:6:HAL_GPIO_DeInit 10
+stm32f1xx_hal_gpio.c:431:15:HAL_GPIO_ReadPin 2
+stm32f1xx_hal_gpio.c:465:6:HAL_GPIO_WritePin 2
+stm32f1xx_hal_gpio.c:487:6:HAL_GPIO_TogglePin 1
+stm32f1xx_hal_gpio.c:511:19:HAL_GPIO_LockPin 2
+stm32f1xx_hal_gpio.c:546:6:HAL_GPIO_EXTI_IRQHandler 2
+stm32f1xx_hal_gpio.c:561:13:HAL_GPIO_EXTI_Callback 1
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.cyclo
new file mode 100644
index 0000000..00d21f4
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.cyclo
@@ -0,0 +1,3 @@
+stm32f1xx_hal_gpio_ex.c:81:6:HAL_GPIOEx_ConfigEventout 1
+stm32f1xx_hal_gpio_ex.c:95:6:HAL_GPIOEx_EnableEventout 1
+stm32f1xx_hal_gpio_ex.c:104:6:HAL_GPIOEx_DisableEventout 1
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.cyclo
new file mode 100644
index 0000000..10ca28a
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.cyclo
@@ -0,0 +1,18 @@
+stm32f1xx_hal_pwr.c:117:13:PWR_OverloadWfe 1
+stm32f1xx_hal_pwr.c:156:6:HAL_PWR_DeInit 1
+stm32f1xx_hal_pwr.c:169:6:HAL_PWR_EnableBkUpAccess 1
+stm32f1xx_hal_pwr.c:182:6:HAL_PWR_DisableBkUpAccess 1
+stm32f1xx_hal_pwr.c:316:6:HAL_PWR_ConfigPVD 5
+stm32f1xx_hal_pwr.c:359:6:HAL_PWR_EnablePVD 1
+stm32f1xx_hal_pwr.c:369:6:HAL_PWR_DisablePVD 1
+stm32f1xx_hal_pwr.c:382:6:HAL_PWR_EnableWakeUpPin 1
+stm32f1xx_hal_pwr.c:397:6:HAL_PWR_DisableWakeUpPin 1
+stm32f1xx_hal_pwr.c:417:6:HAL_PWR_EnterSLEEPMode 2
+stm32f1xx_hal_pwr.c:463:6:HAL_PWR_EnterSTOPMode 2
+stm32f1xx_hal_pwr.c:503:6:HAL_PWR_EnterSTANDBYMode 1
+stm32f1xx_hal_pwr.c:528:6:HAL_PWR_EnableSleepOnExit 1
+stm32f1xx_hal_pwr.c:541:6:HAL_PWR_DisableSleepOnExit 1
+stm32f1xx_hal_pwr.c:554:6:HAL_PWR_EnableSEVOnPend 1
+stm32f1xx_hal_pwr.c:567:6:HAL_PWR_DisableSEVOnPend 1
+stm32f1xx_hal_pwr.c:580:6:HAL_PWR_PVD_IRQHandler 2
+stm32f1xx_hal_pwr.c:597:13:HAL_PWR_PVDCallback 1
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.cyclo
new file mode 100644
index 0000000..95d9036
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.cyclo
@@ -0,0 +1,15 @@
+stm32f1xx_hal_rcc.c:202:19:HAL_RCC_DeInit 14
+stm32f1xx_hal_rcc.c:347:19:HAL_RCC_OscConfig 73
+stm32f1xx_hal_rcc.c:813:19:HAL_RCC_ClockConfig 19
+stm32f1xx_hal_rcc.c:1002:6:HAL_RCC_MCOConfig 1
+stm32f1xx_hal_rcc.c:1039:6:HAL_RCC_EnableCSS 1
+stm32f1xx_hal_rcc.c:1048:6:HAL_RCC_DisableCSS 1
+stm32f1xx_hal_rcc.c:1082:10:HAL_RCC_GetSysClockFreq 6
+stm32f1xx_hal_rcc.c:1176:10:HAL_RCC_GetHCLKFreq 1
+stm32f1xx_hal_rcc.c:1187:10:HAL_RCC_GetPCLK1Freq 1
+stm32f1xx_hal_rcc.c:1199:10:HAL_RCC_GetPCLK2Freq 1
+stm32f1xx_hal_rcc.c:1212:6:HAL_RCC_GetOscConfig 9
+stm32f1xx_hal_rcc.c:1312:6:HAL_RCC_GetClockConfig 1
+stm32f1xx_hal_rcc.c:1347:6:HAL_RCC_NMI_IRQHandler 2
+stm32f1xx_hal_rcc.c:1365:13:RCC_Delay 2
+stm32f1xx_hal_rcc.c:1379:13:HAL_RCC_CSSCallback 1
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.cyclo
new file mode 100644
index 0000000..08fa8ab
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.cyclo
@@ -0,0 +1,7 @@
+stm32f1xx_hal_rcc_ex.c:100:19:HAL_RCCEx_PeriphCLKConfig 25
+stm32f1xx_hal_rcc_ex.c:294:6:HAL_RCCEx_GetPeriphCLKConfig 1
+stm32f1xx_hal_rcc_ex.c:387:10:HAL_RCCEx_GetPeriphCLKFreq 21
+stm32f1xx_hal_rcc_ex.c:613:19:HAL_RCCEx_EnablePLLI2S 9
+stm32f1xx_hal_rcc_ex.c:683:19:HAL_RCCEx_DisablePLLI2S 5
+stm32f1xx_hal_rcc_ex.c:739:19:HAL_RCCEx_EnablePLL2 10
+stm32f1xx_hal_rcc_ex.c:810:19:HAL_RCCEx_DisablePLL2 6
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.cyclo
new file mode 100644
index 0000000..e69de29
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.cyclo
new file mode 100644
index 0000000..e69de29
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.cyclo b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.cyclo
new file mode 100644
index 0000000..7869aa7
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.cyclo
@@ -0,0 +1,61 @@
+stm32f1xx_hal_uart.c:352:19:HAL_UART_Init 3
+stm32f1xx_hal_uart.c:429:19:HAL_HalfDuplex_Init 3
+stm32f1xx_hal_uart.c:504:19:HAL_LIN_Init 3
+stm32f1xx_hal_uart.c:587:19:HAL_MultiProcessor_Init 3
+stm32f1xx_hal_uart.c:666:19:HAL_UART_DeInit 2
+stm32f1xx_hal_uart.c:711:13:HAL_UART_MspInit 1
+stm32f1xx_hal_uart.c:726:13:HAL_UART_MspDeInit 1
+stm32f1xx_hal_uart.c:1136:19:HAL_UART_Transmit 11
+stm32f1xx_hal_uart.c:1224:19:HAL_UART_Receive 13
+stm32f1xx_hal_uart.c:1315:19:HAL_UART_Transmit_IT 5
+stm32f1xx_hal_uart.c:1360:19:HAL_UART_Receive_IT 5
+stm32f1xx_hal_uart.c:1395:19:HAL_UART_Transmit_DMA 5
+stm32f1xx_hal_uart.c:1463:19:HAL_UART_Receive_DMA 5
+stm32f1xx_hal_uart.c:1493:19:HAL_UART_DMAPause 6
+stm32f1xx_hal_uart.c:1530:19:HAL_UART_DMAResume 4
+stm32f1xx_hal_uart.c:1566:19:HAL_UART_DMAStop 7
+stm32f1xx_hal_uart.c:1621:19:HAL_UARTEx_ReceiveToIdle 18
+stm32f1xx_hal_uart.c:1747:19:HAL_UARTEx_ReceiveToIdle_IT 7
+stm32f1xx_hal_uart.c:1808:19:HAL_UARTEx_ReceiveToIdle_DMA 7
+stm32f1xx_hal_uart.c:1865:19:HAL_UART_Abort 10
+stm32f1xx_hal_uart.c:1954:19:HAL_UART_AbortTransmit 5
+stm32f1xx_hal_uart.c:2005:19:HAL_UART_AbortReceive 6
+stm32f1xx_hal_uart.c:2066:19:HAL_UART_Abort_IT 13
+stm32f1xx_hal_uart.c:2201:19:HAL_UART_AbortTransmit_IT 4
+stm32f1xx_hal_uart.c:2278:19:HAL_UART_AbortReceive_IT 5
+stm32f1xx_hal_uart.c:2356:6:HAL_UART_IRQHandler 37
+stm32f1xx_hal_uart.c:2586:13:HAL_UART_TxCpltCallback 1
+stm32f1xx_hal_uart.c:2601:13:HAL_UART_TxHalfCpltCallback 1
+stm32f1xx_hal_uart.c:2616:13:HAL_UART_RxCpltCallback 1
+stm32f1xx_hal_uart.c:2631:13:HAL_UART_RxHalfCpltCallback 1
+stm32f1xx_hal_uart.c:2646:13:HAL_UART_ErrorCallback 1
+stm32f1xx_hal_uart.c:2660:13:HAL_UART_AbortCpltCallback 1
+stm32f1xx_hal_uart.c:2675:13:HAL_UART_AbortTransmitCpltCallback 1
+stm32f1xx_hal_uart.c:2690:13:HAL_UART_AbortReceiveCpltCallback 1
+stm32f1xx_hal_uart.c:2707:13:HAL_UARTEx_RxEventCallback 1
+stm32f1xx_hal_uart.c:2747:19:HAL_LIN_SendBreak 2
+stm32f1xx_hal_uart.c:2774:19:HAL_MultiProcessor_EnterMuteMode 2
+stm32f1xx_hal_uart.c:2801:19:HAL_MultiProcessor_ExitMuteMode 2
+stm32f1xx_hal_uart.c:2828:19:HAL_HalfDuplex_EnableTransmitter 2
+stm32f1xx_hal_uart.c:2863:19:HAL_HalfDuplex_EnableReceiver 2
+stm32f1xx_hal_uart.c:2920:23:HAL_UART_GetState 1
+stm32f1xx_hal_uart.c:2935:10:HAL_UART_GetError 1
+stm32f1xx_hal_uart.c:2980:13:UART_DMATransmitCplt 2
+stm32f1xx_hal_uart.c:3015:13:UART_DMATxHalfCplt 1
+stm32f1xx_hal_uart.c:3034:13:UART_DMAReceiveCplt 4
+stm32f1xx_hal_uart.c:3091:13:UART_DMARxHalfCplt 2
+stm32f1xx_hal_uart.c:3126:13:UART_DMAError 5
+stm32f1xx_hal_uart.c:3167:26:UART_WaitOnFlagUntilTimeout 5
+stm32f1xx_hal_uart.c:3205:19:UART_Start_Receive_IT 1
+stm32f1xx_hal_uart.c:3240:19:UART_Start_Receive_DMA 1
+stm32f1xx_hal_uart.c:3290:13:UART_EndTxTransfer 1
+stm32f1xx_hal_uart.c:3304:13:UART_EndRxTransfer 2
+stm32f1xx_hal_uart.c:3328:13:UART_DMAAbortOnError 1
+stm32f1xx_hal_uart.c:3352:13:UART_DMATxAbortCallback 3
+stm32f1xx_hal_uart.c:3398:13:UART_DMARxAbortCallback 3
+stm32f1xx_hal_uart.c:3444:13:UART_DMATxOnlyAbortCallback 1
+stm32f1xx_hal_uart.c:3472:13:UART_DMARxOnlyAbortCallback 1
+stm32f1xx_hal_uart.c:3498:26:UART_Transmit_IT 5
+stm32f1xx_hal_uart.c:3538:26:UART_EndTransmit_IT 1
+stm32f1xx_hal_uart.c:3563:26:UART_Receive_IT 10
+stm32f1xx_hal_uart.c:3661:13:UART_SetConfig 2
diff --git a/Debug/Drivers/STM32F1xx_HAL_Driver/Src/subdir.mk b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/subdir.mk
new file mode 100644
index 0000000..f1c53e6
--- /dev/null
+++ b/Debug/Drivers/STM32F1xx_HAL_Driver/Src/subdir.mk
@@ -0,0 +1,75 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+# Toolchain: GNU Tools for STM32 (10.3-2021.10)
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+C_SRCS += \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \
+../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c
+
+OBJS += \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.o \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.o
+
+C_DEPS += \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.d \
+./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.d
+
+
+# Each subdirectory must supply rules for building sources it contributes
+Drivers/STM32F1xx_HAL_Driver/Src/%.o Drivers/STM32F1xx_HAL_Driver/Src/%.su Drivers/STM32F1xx_HAL_Driver/Src/%.cyclo: ../Drivers/STM32F1xx_HAL_Driver/Src/%.c Drivers/STM32F1xx_HAL_Driver/Src/subdir.mk
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F107xC -c -I../Core/Inc -I/Users/colorbass/STM32CubeIDE/workspace_1.12.0/lib_EDCAN -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+
+clean: clean-Drivers-2f-STM32F1xx_HAL_Driver-2f-Src
+
+clean-Drivers-2f-STM32F1xx_HAL_Driver-2f-Src:
+ -$(RM) ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.su ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.cyclo ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.d ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.o ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.su
+
+.PHONY: clean-Drivers-2f-STM32F1xx_HAL_Driver-2f-Src
+
diff --git a/Debug/GbTModuleSW.list b/Debug/GbTModuleSW.list
new file mode 100644
index 0000000..3c956da
--- /dev/null
+++ b/Debug/GbTModuleSW.list
@@ -0,0 +1,21096 @@
+
+GbTModuleSW.elf: file format elf32-littlearm
+
+Sections:
+Idx Name Size VMA LMA File off Algn
+ 0 .isr_vector 000001e4 08000000 08000000 00010000 2**0
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 1 .text 000087f8 080001e4 080001e4 000101e4 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, CODE
+ 2 .rodata 00000588 080089dc 080089dc 000189dc 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 3 .ARM.extab 00000000 08008f64 08008f64 00020070 2**0
+ CONTENTS
+ 4 .ARM 00000008 08008f64 08008f64 00018f64 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 5 .preinit_array 00000000 08008f6c 08008f6c 00020070 2**0
+ CONTENTS, ALLOC, LOAD, DATA
+ 6 .init_array 00000004 08008f6c 08008f6c 00018f6c 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 7 .fini_array 00000004 08008f70 08008f70 00018f70 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 8 .data 00000070 20000000 08008f74 00020000 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 9 .bss 00003118 20000070 08008fe4 00020070 2**2
+ ALLOC
+ 10 ._user_heap_stack 00000600 20003188 08008fe4 00023188 2**0
+ ALLOC
+ 11 .ARM.attributes 00000029 00000000 00000000 00020070 2**0
+ CONTENTS, READONLY
+ 12 .debug_info 0000f213 00000000 00000000 00020099 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 13 .debug_abbrev 00003561 00000000 00000000 0002f2ac 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 14 .debug_aranges 00000de0 00000000 00000000 00032810 2**3
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 15 .debug_ranges 00000c58 00000000 00000000 000335f0 2**3
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 16 .debug_macro 000228d6 00000000 00000000 00034248 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 17 .debug_line 00012c76 00000000 00000000 00056b1e 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 18 .debug_str 000bcad8 00000000 00000000 00069794 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 19 .comment 00000050 00000000 00000000 0012626c 2**0
+ CONTENTS, READONLY
+ 20 .debug_frame 00004234 00000000 00000000 001262bc 2**2
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+
+Disassembly of section .text:
+
+080001e4 <__do_global_dtors_aux>:
+ 80001e4: b510 push {r4, lr}
+ 80001e6: 4c05 ldr r4, [pc, #20] ; (80001fc <__do_global_dtors_aux+0x18>)
+ 80001e8: 7823 ldrb r3, [r4, #0]
+ 80001ea: b933 cbnz r3, 80001fa <__do_global_dtors_aux+0x16>
+ 80001ec: 4b04 ldr r3, [pc, #16] ; (8000200 <__do_global_dtors_aux+0x1c>)
+ 80001ee: b113 cbz r3, 80001f6 <__do_global_dtors_aux+0x12>
+ 80001f0: 4804 ldr r0, [pc, #16] ; (8000204 <__do_global_dtors_aux+0x20>)
+ 80001f2: f3af 8000 nop.w
+ 80001f6: 2301 movs r3, #1
+ 80001f8: 7023 strb r3, [r4, #0]
+ 80001fa: bd10 pop {r4, pc}
+ 80001fc: 20000070 .word 0x20000070
+ 8000200: 00000000 .word 0x00000000
+ 8000204: 080089c4 .word 0x080089c4
+
+08000208 :
+ 8000208: b508 push {r3, lr}
+ 800020a: 4b03 ldr r3, [pc, #12] ; (8000218 )
+ 800020c: b11b cbz r3, 8000216
+ 800020e: 4903 ldr r1, [pc, #12] ; (800021c )
+ 8000210: 4803 ldr r0, [pc, #12] ; (8000220 )
+ 8000212: f3af 8000 nop.w
+ 8000216: bd08 pop {r3, pc}
+ 8000218: 00000000 .word 0x00000000
+ 800021c: 20000074 .word 0x20000074
+ 8000220: 080089c4 .word 0x080089c4
+
+08000224 <__aeabi_drsub>:
+ 8000224: f081 4100 eor.w r1, r1, #2147483648 ; 0x80000000
+ 8000228: e002 b.n 8000230 <__adddf3>
+ 800022a: bf00 nop
+
+0800022c <__aeabi_dsub>:
+ 800022c: f083 4300 eor.w r3, r3, #2147483648 ; 0x80000000
+
+08000230 <__adddf3>:
+ 8000230: b530 push {r4, r5, lr}
+ 8000232: ea4f 0441 mov.w r4, r1, lsl #1
+ 8000236: ea4f 0543 mov.w r5, r3, lsl #1
+ 800023a: ea94 0f05 teq r4, r5
+ 800023e: bf08 it eq
+ 8000240: ea90 0f02 teqeq r0, r2
+ 8000244: bf1f itttt ne
+ 8000246: ea54 0c00 orrsne.w ip, r4, r0
+ 800024a: ea55 0c02 orrsne.w ip, r5, r2
+ 800024e: ea7f 5c64 mvnsne.w ip, r4, asr #21
+ 8000252: ea7f 5c65 mvnsne.w ip, r5, asr #21
+ 8000256: f000 80e2 beq.w 800041e <__adddf3+0x1ee>
+ 800025a: ea4f 5454 mov.w r4, r4, lsr #21
+ 800025e: ebd4 5555 rsbs r5, r4, r5, lsr #21
+ 8000262: bfb8 it lt
+ 8000264: 426d neglt r5, r5
+ 8000266: dd0c ble.n 8000282 <__adddf3+0x52>
+ 8000268: 442c add r4, r5
+ 800026a: ea80 0202 eor.w r2, r0, r2
+ 800026e: ea81 0303 eor.w r3, r1, r3
+ 8000272: ea82 0000 eor.w r0, r2, r0
+ 8000276: ea83 0101 eor.w r1, r3, r1
+ 800027a: ea80 0202 eor.w r2, r0, r2
+ 800027e: ea81 0303 eor.w r3, r1, r3
+ 8000282: 2d36 cmp r5, #54 ; 0x36
+ 8000284: bf88 it hi
+ 8000286: bd30 pophi {r4, r5, pc}
+ 8000288: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
+ 800028c: ea4f 3101 mov.w r1, r1, lsl #12
+ 8000290: f44f 1c80 mov.w ip, #1048576 ; 0x100000
+ 8000294: ea4c 3111 orr.w r1, ip, r1, lsr #12
+ 8000298: d002 beq.n 80002a0 <__adddf3+0x70>
+ 800029a: 4240 negs r0, r0
+ 800029c: eb61 0141 sbc.w r1, r1, r1, lsl #1
+ 80002a0: f013 4f00 tst.w r3, #2147483648 ; 0x80000000
+ 80002a4: ea4f 3303 mov.w r3, r3, lsl #12
+ 80002a8: ea4c 3313 orr.w r3, ip, r3, lsr #12
+ 80002ac: d002 beq.n 80002b4 <__adddf3+0x84>
+ 80002ae: 4252 negs r2, r2
+ 80002b0: eb63 0343 sbc.w r3, r3, r3, lsl #1
+ 80002b4: ea94 0f05 teq r4, r5
+ 80002b8: f000 80a7 beq.w 800040a <__adddf3+0x1da>
+ 80002bc: f1a4 0401 sub.w r4, r4, #1
+ 80002c0: f1d5 0e20 rsbs lr, r5, #32
+ 80002c4: db0d blt.n 80002e2 <__adddf3+0xb2>
+ 80002c6: fa02 fc0e lsl.w ip, r2, lr
+ 80002ca: fa22 f205 lsr.w r2, r2, r5
+ 80002ce: 1880 adds r0, r0, r2
+ 80002d0: f141 0100 adc.w r1, r1, #0
+ 80002d4: fa03 f20e lsl.w r2, r3, lr
+ 80002d8: 1880 adds r0, r0, r2
+ 80002da: fa43 f305 asr.w r3, r3, r5
+ 80002de: 4159 adcs r1, r3
+ 80002e0: e00e b.n 8000300 <__adddf3+0xd0>
+ 80002e2: f1a5 0520 sub.w r5, r5, #32
+ 80002e6: f10e 0e20 add.w lr, lr, #32
+ 80002ea: 2a01 cmp r2, #1
+ 80002ec: fa03 fc0e lsl.w ip, r3, lr
+ 80002f0: bf28 it cs
+ 80002f2: f04c 0c02 orrcs.w ip, ip, #2
+ 80002f6: fa43 f305 asr.w r3, r3, r5
+ 80002fa: 18c0 adds r0, r0, r3
+ 80002fc: eb51 71e3 adcs.w r1, r1, r3, asr #31
+ 8000300: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
+ 8000304: d507 bpl.n 8000316 <__adddf3+0xe6>
+ 8000306: f04f 0e00 mov.w lr, #0
+ 800030a: f1dc 0c00 rsbs ip, ip, #0
+ 800030e: eb7e 0000 sbcs.w r0, lr, r0
+ 8000312: eb6e 0101 sbc.w r1, lr, r1
+ 8000316: f5b1 1f80 cmp.w r1, #1048576 ; 0x100000
+ 800031a: d31b bcc.n 8000354 <__adddf3+0x124>
+ 800031c: f5b1 1f00 cmp.w r1, #2097152 ; 0x200000
+ 8000320: d30c bcc.n 800033c <__adddf3+0x10c>
+ 8000322: 0849 lsrs r1, r1, #1
+ 8000324: ea5f 0030 movs.w r0, r0, rrx
+ 8000328: ea4f 0c3c mov.w ip, ip, rrx
+ 800032c: f104 0401 add.w r4, r4, #1
+ 8000330: ea4f 5244 mov.w r2, r4, lsl #21
+ 8000334: f512 0f80 cmn.w r2, #4194304 ; 0x400000
+ 8000338: f080 809a bcs.w 8000470 <__adddf3+0x240>
+ 800033c: f1bc 4f00 cmp.w ip, #2147483648 ; 0x80000000
+ 8000340: bf08 it eq
+ 8000342: ea5f 0c50 movseq.w ip, r0, lsr #1
+ 8000346: f150 0000 adcs.w r0, r0, #0
+ 800034a: eb41 5104 adc.w r1, r1, r4, lsl #20
+ 800034e: ea41 0105 orr.w r1, r1, r5
+ 8000352: bd30 pop {r4, r5, pc}
+ 8000354: ea5f 0c4c movs.w ip, ip, lsl #1
+ 8000358: 4140 adcs r0, r0
+ 800035a: eb41 0101 adc.w r1, r1, r1
+ 800035e: 3c01 subs r4, #1
+ 8000360: bf28 it cs
+ 8000362: f5b1 1f80 cmpcs.w r1, #1048576 ; 0x100000
+ 8000366: d2e9 bcs.n 800033c <__adddf3+0x10c>
+ 8000368: f091 0f00 teq r1, #0
+ 800036c: bf04 itt eq
+ 800036e: 4601 moveq r1, r0
+ 8000370: 2000 moveq r0, #0
+ 8000372: fab1 f381 clz r3, r1
+ 8000376: bf08 it eq
+ 8000378: 3320 addeq r3, #32
+ 800037a: f1a3 030b sub.w r3, r3, #11
+ 800037e: f1b3 0220 subs.w r2, r3, #32
+ 8000382: da0c bge.n 800039e <__adddf3+0x16e>
+ 8000384: 320c adds r2, #12
+ 8000386: dd08 ble.n 800039a <__adddf3+0x16a>
+ 8000388: f102 0c14 add.w ip, r2, #20
+ 800038c: f1c2 020c rsb r2, r2, #12
+ 8000390: fa01 f00c lsl.w r0, r1, ip
+ 8000394: fa21 f102 lsr.w r1, r1, r2
+ 8000398: e00c b.n 80003b4 <__adddf3+0x184>
+ 800039a: f102 0214 add.w r2, r2, #20
+ 800039e: bfd8 it le
+ 80003a0: f1c2 0c20 rsble ip, r2, #32
+ 80003a4: fa01 f102 lsl.w r1, r1, r2
+ 80003a8: fa20 fc0c lsr.w ip, r0, ip
+ 80003ac: bfdc itt le
+ 80003ae: ea41 010c orrle.w r1, r1, ip
+ 80003b2: 4090 lslle r0, r2
+ 80003b4: 1ae4 subs r4, r4, r3
+ 80003b6: bfa2 ittt ge
+ 80003b8: eb01 5104 addge.w r1, r1, r4, lsl #20
+ 80003bc: 4329 orrge r1, r5
+ 80003be: bd30 popge {r4, r5, pc}
+ 80003c0: ea6f 0404 mvn.w r4, r4
+ 80003c4: 3c1f subs r4, #31
+ 80003c6: da1c bge.n 8000402 <__adddf3+0x1d2>
+ 80003c8: 340c adds r4, #12
+ 80003ca: dc0e bgt.n 80003ea <__adddf3+0x1ba>
+ 80003cc: f104 0414 add.w r4, r4, #20
+ 80003d0: f1c4 0220 rsb r2, r4, #32
+ 80003d4: fa20 f004 lsr.w r0, r0, r4
+ 80003d8: fa01 f302 lsl.w r3, r1, r2
+ 80003dc: ea40 0003 orr.w r0, r0, r3
+ 80003e0: fa21 f304 lsr.w r3, r1, r4
+ 80003e4: ea45 0103 orr.w r1, r5, r3
+ 80003e8: bd30 pop {r4, r5, pc}
+ 80003ea: f1c4 040c rsb r4, r4, #12
+ 80003ee: f1c4 0220 rsb r2, r4, #32
+ 80003f2: fa20 f002 lsr.w r0, r0, r2
+ 80003f6: fa01 f304 lsl.w r3, r1, r4
+ 80003fa: ea40 0003 orr.w r0, r0, r3
+ 80003fe: 4629 mov r1, r5
+ 8000400: bd30 pop {r4, r5, pc}
+ 8000402: fa21 f004 lsr.w r0, r1, r4
+ 8000406: 4629 mov r1, r5
+ 8000408: bd30 pop {r4, r5, pc}
+ 800040a: f094 0f00 teq r4, #0
+ 800040e: f483 1380 eor.w r3, r3, #1048576 ; 0x100000
+ 8000412: bf06 itte eq
+ 8000414: f481 1180 eoreq.w r1, r1, #1048576 ; 0x100000
+ 8000418: 3401 addeq r4, #1
+ 800041a: 3d01 subne r5, #1
+ 800041c: e74e b.n 80002bc <__adddf3+0x8c>
+ 800041e: ea7f 5c64 mvns.w ip, r4, asr #21
+ 8000422: bf18 it ne
+ 8000424: ea7f 5c65 mvnsne.w ip, r5, asr #21
+ 8000428: d029 beq.n 800047e <__adddf3+0x24e>
+ 800042a: ea94 0f05 teq r4, r5
+ 800042e: bf08 it eq
+ 8000430: ea90 0f02 teqeq r0, r2
+ 8000434: d005 beq.n 8000442 <__adddf3+0x212>
+ 8000436: ea54 0c00 orrs.w ip, r4, r0
+ 800043a: bf04 itt eq
+ 800043c: 4619 moveq r1, r3
+ 800043e: 4610 moveq r0, r2
+ 8000440: bd30 pop {r4, r5, pc}
+ 8000442: ea91 0f03 teq r1, r3
+ 8000446: bf1e ittt ne
+ 8000448: 2100 movne r1, #0
+ 800044a: 2000 movne r0, #0
+ 800044c: bd30 popne {r4, r5, pc}
+ 800044e: ea5f 5c54 movs.w ip, r4, lsr #21
+ 8000452: d105 bne.n 8000460 <__adddf3+0x230>
+ 8000454: 0040 lsls r0, r0, #1
+ 8000456: 4149 adcs r1, r1
+ 8000458: bf28 it cs
+ 800045a: f041 4100 orrcs.w r1, r1, #2147483648 ; 0x80000000
+ 800045e: bd30 pop {r4, r5, pc}
+ 8000460: f514 0480 adds.w r4, r4, #4194304 ; 0x400000
+ 8000464: bf3c itt cc
+ 8000466: f501 1180 addcc.w r1, r1, #1048576 ; 0x100000
+ 800046a: bd30 popcc {r4, r5, pc}
+ 800046c: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
+ 8000470: f045 41fe orr.w r1, r5, #2130706432 ; 0x7f000000
+ 8000474: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000
+ 8000478: f04f 0000 mov.w r0, #0
+ 800047c: bd30 pop {r4, r5, pc}
+ 800047e: ea7f 5c64 mvns.w ip, r4, asr #21
+ 8000482: bf1a itte ne
+ 8000484: 4619 movne r1, r3
+ 8000486: 4610 movne r0, r2
+ 8000488: ea7f 5c65 mvnseq.w ip, r5, asr #21
+ 800048c: bf1c itt ne
+ 800048e: 460b movne r3, r1
+ 8000490: 4602 movne r2, r0
+ 8000492: ea50 3401 orrs.w r4, r0, r1, lsl #12
+ 8000496: bf06 itte eq
+ 8000498: ea52 3503 orrseq.w r5, r2, r3, lsl #12
+ 800049c: ea91 0f03 teqeq r1, r3
+ 80004a0: f441 2100 orrne.w r1, r1, #524288 ; 0x80000
+ 80004a4: bd30 pop {r4, r5, pc}
+ 80004a6: bf00 nop
+
+080004a8 <__aeabi_ui2d>:
+ 80004a8: f090 0f00 teq r0, #0
+ 80004ac: bf04 itt eq
+ 80004ae: 2100 moveq r1, #0
+ 80004b0: 4770 bxeq lr
+ 80004b2: b530 push {r4, r5, lr}
+ 80004b4: f44f 6480 mov.w r4, #1024 ; 0x400
+ 80004b8: f104 0432 add.w r4, r4, #50 ; 0x32
+ 80004bc: f04f 0500 mov.w r5, #0
+ 80004c0: f04f 0100 mov.w r1, #0
+ 80004c4: e750 b.n 8000368 <__adddf3+0x138>
+ 80004c6: bf00 nop
+
+080004c8 <__aeabi_i2d>:
+ 80004c8: f090 0f00 teq r0, #0
+ 80004cc: bf04 itt eq
+ 80004ce: 2100 moveq r1, #0
+ 80004d0: 4770 bxeq lr
+ 80004d2: b530 push {r4, r5, lr}
+ 80004d4: f44f 6480 mov.w r4, #1024 ; 0x400
+ 80004d8: f104 0432 add.w r4, r4, #50 ; 0x32
+ 80004dc: f010 4500 ands.w r5, r0, #2147483648 ; 0x80000000
+ 80004e0: bf48 it mi
+ 80004e2: 4240 negmi r0, r0
+ 80004e4: f04f 0100 mov.w r1, #0
+ 80004e8: e73e b.n 8000368 <__adddf3+0x138>
+ 80004ea: bf00 nop
+
+080004ec <__aeabi_f2d>:
+ 80004ec: 0042 lsls r2, r0, #1
+ 80004ee: ea4f 01e2 mov.w r1, r2, asr #3
+ 80004f2: ea4f 0131 mov.w r1, r1, rrx
+ 80004f6: ea4f 7002 mov.w r0, r2, lsl #28
+ 80004fa: bf1f itttt ne
+ 80004fc: f012 437f andsne.w r3, r2, #4278190080 ; 0xff000000
+ 8000500: f093 4f7f teqne r3, #4278190080 ; 0xff000000
+ 8000504: f081 5160 eorne.w r1, r1, #939524096 ; 0x38000000
+ 8000508: 4770 bxne lr
+ 800050a: f032 427f bics.w r2, r2, #4278190080 ; 0xff000000
+ 800050e: bf08 it eq
+ 8000510: 4770 bxeq lr
+ 8000512: f093 4f7f teq r3, #4278190080 ; 0xff000000
+ 8000516: bf04 itt eq
+ 8000518: f441 2100 orreq.w r1, r1, #524288 ; 0x80000
+ 800051c: 4770 bxeq lr
+ 800051e: b530 push {r4, r5, lr}
+ 8000520: f44f 7460 mov.w r4, #896 ; 0x380
+ 8000524: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
+ 8000528: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000
+ 800052c: e71c b.n 8000368 <__adddf3+0x138>
+ 800052e: bf00 nop
+
+08000530 <__aeabi_ul2d>:
+ 8000530: ea50 0201 orrs.w r2, r0, r1
+ 8000534: bf08 it eq
+ 8000536: 4770 bxeq lr
+ 8000538: b530 push {r4, r5, lr}
+ 800053a: f04f 0500 mov.w r5, #0
+ 800053e: e00a b.n 8000556 <__aeabi_l2d+0x16>
+
+08000540 <__aeabi_l2d>:
+ 8000540: ea50 0201 orrs.w r2, r0, r1
+ 8000544: bf08 it eq
+ 8000546: 4770 bxeq lr
+ 8000548: b530 push {r4, r5, lr}
+ 800054a: f011 4500 ands.w r5, r1, #2147483648 ; 0x80000000
+ 800054e: d502 bpl.n 8000556 <__aeabi_l2d+0x16>
+ 8000550: 4240 negs r0, r0
+ 8000552: eb61 0141 sbc.w r1, r1, r1, lsl #1
+ 8000556: f44f 6480 mov.w r4, #1024 ; 0x400
+ 800055a: f104 0432 add.w r4, r4, #50 ; 0x32
+ 800055e: ea5f 5c91 movs.w ip, r1, lsr #22
+ 8000562: f43f aed8 beq.w 8000316 <__adddf3+0xe6>
+ 8000566: f04f 0203 mov.w r2, #3
+ 800056a: ea5f 0cdc movs.w ip, ip, lsr #3
+ 800056e: bf18 it ne
+ 8000570: 3203 addne r2, #3
+ 8000572: ea5f 0cdc movs.w ip, ip, lsr #3
+ 8000576: bf18 it ne
+ 8000578: 3203 addne r2, #3
+ 800057a: eb02 02dc add.w r2, r2, ip, lsr #3
+ 800057e: f1c2 0320 rsb r3, r2, #32
+ 8000582: fa00 fc03 lsl.w ip, r0, r3
+ 8000586: fa20 f002 lsr.w r0, r0, r2
+ 800058a: fa01 fe03 lsl.w lr, r1, r3
+ 800058e: ea40 000e orr.w r0, r0, lr
+ 8000592: fa21 f102 lsr.w r1, r1, r2
+ 8000596: 4414 add r4, r2
+ 8000598: e6bd b.n 8000316 <__adddf3+0xe6>
+ 800059a: bf00 nop
+
+0800059c <__aeabi_frsub>:
+ 800059c: f080 4000 eor.w r0, r0, #2147483648 ; 0x80000000
+ 80005a0: e002 b.n 80005a8 <__addsf3>
+ 80005a2: bf00 nop
+
+080005a4 <__aeabi_fsub>:
+ 80005a4: f081 4100 eor.w r1, r1, #2147483648 ; 0x80000000
+
+080005a8 <__addsf3>:
+ 80005a8: 0042 lsls r2, r0, #1
+ 80005aa: bf1f itttt ne
+ 80005ac: ea5f 0341 movsne.w r3, r1, lsl #1
+ 80005b0: ea92 0f03 teqne r2, r3
+ 80005b4: ea7f 6c22 mvnsne.w ip, r2, asr #24
+ 80005b8: ea7f 6c23 mvnsne.w ip, r3, asr #24
+ 80005bc: d06a beq.n 8000694 <__addsf3+0xec>
+ 80005be: ea4f 6212 mov.w r2, r2, lsr #24
+ 80005c2: ebd2 6313 rsbs r3, r2, r3, lsr #24
+ 80005c6: bfc1 itttt gt
+ 80005c8: 18d2 addgt r2, r2, r3
+ 80005ca: 4041 eorgt r1, r0
+ 80005cc: 4048 eorgt r0, r1
+ 80005ce: 4041 eorgt r1, r0
+ 80005d0: bfb8 it lt
+ 80005d2: 425b neglt r3, r3
+ 80005d4: 2b19 cmp r3, #25
+ 80005d6: bf88 it hi
+ 80005d8: 4770 bxhi lr
+ 80005da: f010 4f00 tst.w r0, #2147483648 ; 0x80000000
+ 80005de: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 80005e2: f020 407f bic.w r0, r0, #4278190080 ; 0xff000000
+ 80005e6: bf18 it ne
+ 80005e8: 4240 negne r0, r0
+ 80005ea: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
+ 80005ee: f441 0100 orr.w r1, r1, #8388608 ; 0x800000
+ 80005f2: f021 417f bic.w r1, r1, #4278190080 ; 0xff000000
+ 80005f6: bf18 it ne
+ 80005f8: 4249 negne r1, r1
+ 80005fa: ea92 0f03 teq r2, r3
+ 80005fe: d03f beq.n 8000680 <__addsf3+0xd8>
+ 8000600: f1a2 0201 sub.w r2, r2, #1
+ 8000604: fa41 fc03 asr.w ip, r1, r3
+ 8000608: eb10 000c adds.w r0, r0, ip
+ 800060c: f1c3 0320 rsb r3, r3, #32
+ 8000610: fa01 f103 lsl.w r1, r1, r3
+ 8000614: f000 4300 and.w r3, r0, #2147483648 ; 0x80000000
+ 8000618: d502 bpl.n 8000620 <__addsf3+0x78>
+ 800061a: 4249 negs r1, r1
+ 800061c: eb60 0040 sbc.w r0, r0, r0, lsl #1
+ 8000620: f5b0 0f00 cmp.w r0, #8388608 ; 0x800000
+ 8000624: d313 bcc.n 800064e <__addsf3+0xa6>
+ 8000626: f1b0 7f80 cmp.w r0, #16777216 ; 0x1000000
+ 800062a: d306 bcc.n 800063a <__addsf3+0x92>
+ 800062c: 0840 lsrs r0, r0, #1
+ 800062e: ea4f 0131 mov.w r1, r1, rrx
+ 8000632: f102 0201 add.w r2, r2, #1
+ 8000636: 2afe cmp r2, #254 ; 0xfe
+ 8000638: d251 bcs.n 80006de <__addsf3+0x136>
+ 800063a: f1b1 4f00 cmp.w r1, #2147483648 ; 0x80000000
+ 800063e: eb40 50c2 adc.w r0, r0, r2, lsl #23
+ 8000642: bf08 it eq
+ 8000644: f020 0001 biceq.w r0, r0, #1
+ 8000648: ea40 0003 orr.w r0, r0, r3
+ 800064c: 4770 bx lr
+ 800064e: 0049 lsls r1, r1, #1
+ 8000650: eb40 0000 adc.w r0, r0, r0
+ 8000654: 3a01 subs r2, #1
+ 8000656: bf28 it cs
+ 8000658: f5b0 0f00 cmpcs.w r0, #8388608 ; 0x800000
+ 800065c: d2ed bcs.n 800063a <__addsf3+0x92>
+ 800065e: fab0 fc80 clz ip, r0
+ 8000662: f1ac 0c08 sub.w ip, ip, #8
+ 8000666: ebb2 020c subs.w r2, r2, ip
+ 800066a: fa00 f00c lsl.w r0, r0, ip
+ 800066e: bfaa itet ge
+ 8000670: eb00 50c2 addge.w r0, r0, r2, lsl #23
+ 8000674: 4252 neglt r2, r2
+ 8000676: 4318 orrge r0, r3
+ 8000678: bfbc itt lt
+ 800067a: 40d0 lsrlt r0, r2
+ 800067c: 4318 orrlt r0, r3
+ 800067e: 4770 bx lr
+ 8000680: f092 0f00 teq r2, #0
+ 8000684: f481 0100 eor.w r1, r1, #8388608 ; 0x800000
+ 8000688: bf06 itte eq
+ 800068a: f480 0000 eoreq.w r0, r0, #8388608 ; 0x800000
+ 800068e: 3201 addeq r2, #1
+ 8000690: 3b01 subne r3, #1
+ 8000692: e7b5 b.n 8000600 <__addsf3+0x58>
+ 8000694: ea4f 0341 mov.w r3, r1, lsl #1
+ 8000698: ea7f 6c22 mvns.w ip, r2, asr #24
+ 800069c: bf18 it ne
+ 800069e: ea7f 6c23 mvnsne.w ip, r3, asr #24
+ 80006a2: d021 beq.n 80006e8 <__addsf3+0x140>
+ 80006a4: ea92 0f03 teq r2, r3
+ 80006a8: d004 beq.n 80006b4 <__addsf3+0x10c>
+ 80006aa: f092 0f00 teq r2, #0
+ 80006ae: bf08 it eq
+ 80006b0: 4608 moveq r0, r1
+ 80006b2: 4770 bx lr
+ 80006b4: ea90 0f01 teq r0, r1
+ 80006b8: bf1c itt ne
+ 80006ba: 2000 movne r0, #0
+ 80006bc: 4770 bxne lr
+ 80006be: f012 4f7f tst.w r2, #4278190080 ; 0xff000000
+ 80006c2: d104 bne.n 80006ce <__addsf3+0x126>
+ 80006c4: 0040 lsls r0, r0, #1
+ 80006c6: bf28 it cs
+ 80006c8: f040 4000 orrcs.w r0, r0, #2147483648 ; 0x80000000
+ 80006cc: 4770 bx lr
+ 80006ce: f112 7200 adds.w r2, r2, #33554432 ; 0x2000000
+ 80006d2: bf3c itt cc
+ 80006d4: f500 0000 addcc.w r0, r0, #8388608 ; 0x800000
+ 80006d8: 4770 bxcc lr
+ 80006da: f000 4300 and.w r3, r0, #2147483648 ; 0x80000000
+ 80006de: f043 40fe orr.w r0, r3, #2130706432 ; 0x7f000000
+ 80006e2: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 80006e6: 4770 bx lr
+ 80006e8: ea7f 6222 mvns.w r2, r2, asr #24
+ 80006ec: bf16 itet ne
+ 80006ee: 4608 movne r0, r1
+ 80006f0: ea7f 6323 mvnseq.w r3, r3, asr #24
+ 80006f4: 4601 movne r1, r0
+ 80006f6: 0242 lsls r2, r0, #9
+ 80006f8: bf06 itte eq
+ 80006fa: ea5f 2341 movseq.w r3, r1, lsl #9
+ 80006fe: ea90 0f01 teqeq r0, r1
+ 8000702: f440 0080 orrne.w r0, r0, #4194304 ; 0x400000
+ 8000706: 4770 bx lr
+
+08000708 <__aeabi_ui2f>:
+ 8000708: f04f 0300 mov.w r3, #0
+ 800070c: e004 b.n 8000718 <__aeabi_i2f+0x8>
+ 800070e: bf00 nop
+
+08000710 <__aeabi_i2f>:
+ 8000710: f010 4300 ands.w r3, r0, #2147483648 ; 0x80000000
+ 8000714: bf48 it mi
+ 8000716: 4240 negmi r0, r0
+ 8000718: ea5f 0c00 movs.w ip, r0
+ 800071c: bf08 it eq
+ 800071e: 4770 bxeq lr
+ 8000720: f043 4396 orr.w r3, r3, #1258291200 ; 0x4b000000
+ 8000724: 4601 mov r1, r0
+ 8000726: f04f 0000 mov.w r0, #0
+ 800072a: e01c b.n 8000766 <__aeabi_l2f+0x2a>
+
+0800072c <__aeabi_ul2f>:
+ 800072c: ea50 0201 orrs.w r2, r0, r1
+ 8000730: bf08 it eq
+ 8000732: 4770 bxeq lr
+ 8000734: f04f 0300 mov.w r3, #0
+ 8000738: e00a b.n 8000750 <__aeabi_l2f+0x14>
+ 800073a: bf00 nop
+
+0800073c <__aeabi_l2f>:
+ 800073c: ea50 0201 orrs.w r2, r0, r1
+ 8000740: bf08 it eq
+ 8000742: 4770 bxeq lr
+ 8000744: f011 4300 ands.w r3, r1, #2147483648 ; 0x80000000
+ 8000748: d502 bpl.n 8000750 <__aeabi_l2f+0x14>
+ 800074a: 4240 negs r0, r0
+ 800074c: eb61 0141 sbc.w r1, r1, r1, lsl #1
+ 8000750: ea5f 0c01 movs.w ip, r1
+ 8000754: bf02 ittt eq
+ 8000756: 4684 moveq ip, r0
+ 8000758: 4601 moveq r1, r0
+ 800075a: 2000 moveq r0, #0
+ 800075c: f043 43b6 orr.w r3, r3, #1526726656 ; 0x5b000000
+ 8000760: bf08 it eq
+ 8000762: f1a3 5380 subeq.w r3, r3, #268435456 ; 0x10000000
+ 8000766: f5a3 0300 sub.w r3, r3, #8388608 ; 0x800000
+ 800076a: fabc f28c clz r2, ip
+ 800076e: 3a08 subs r2, #8
+ 8000770: eba3 53c2 sub.w r3, r3, r2, lsl #23
+ 8000774: db10 blt.n 8000798 <__aeabi_l2f+0x5c>
+ 8000776: fa01 fc02 lsl.w ip, r1, r2
+ 800077a: 4463 add r3, ip
+ 800077c: fa00 fc02 lsl.w ip, r0, r2
+ 8000780: f1c2 0220 rsb r2, r2, #32
+ 8000784: f1bc 4f00 cmp.w ip, #2147483648 ; 0x80000000
+ 8000788: fa20 f202 lsr.w r2, r0, r2
+ 800078c: eb43 0002 adc.w r0, r3, r2
+ 8000790: bf08 it eq
+ 8000792: f020 0001 biceq.w r0, r0, #1
+ 8000796: 4770 bx lr
+ 8000798: f102 0220 add.w r2, r2, #32
+ 800079c: fa01 fc02 lsl.w ip, r1, r2
+ 80007a0: f1c2 0220 rsb r2, r2, #32
+ 80007a4: ea50 004c orrs.w r0, r0, ip, lsl #1
+ 80007a8: fa21 f202 lsr.w r2, r1, r2
+ 80007ac: eb43 0002 adc.w r0, r3, r2
+ 80007b0: bf08 it eq
+ 80007b2: ea20 70dc biceq.w r0, r0, ip, lsr #31
+ 80007b6: 4770 bx lr
+
+080007b8 <__aeabi_fmul>:
+ 80007b8: f04f 0cff mov.w ip, #255 ; 0xff
+ 80007bc: ea1c 52d0 ands.w r2, ip, r0, lsr #23
+ 80007c0: bf1e ittt ne
+ 80007c2: ea1c 53d1 andsne.w r3, ip, r1, lsr #23
+ 80007c6: ea92 0f0c teqne r2, ip
+ 80007ca: ea93 0f0c teqne r3, ip
+ 80007ce: d06f beq.n 80008b0 <__aeabi_fmul+0xf8>
+ 80007d0: 441a add r2, r3
+ 80007d2: ea80 0c01 eor.w ip, r0, r1
+ 80007d6: 0240 lsls r0, r0, #9
+ 80007d8: bf18 it ne
+ 80007da: ea5f 2141 movsne.w r1, r1, lsl #9
+ 80007de: d01e beq.n 800081e <__aeabi_fmul+0x66>
+ 80007e0: f04f 6300 mov.w r3, #134217728 ; 0x8000000
+ 80007e4: ea43 1050 orr.w r0, r3, r0, lsr #5
+ 80007e8: ea43 1151 orr.w r1, r3, r1, lsr #5
+ 80007ec: fba0 3101 umull r3, r1, r0, r1
+ 80007f0: f00c 4000 and.w r0, ip, #2147483648 ; 0x80000000
+ 80007f4: f5b1 0f00 cmp.w r1, #8388608 ; 0x800000
+ 80007f8: bf3e ittt cc
+ 80007fa: 0049 lslcc r1, r1, #1
+ 80007fc: ea41 71d3 orrcc.w r1, r1, r3, lsr #31
+ 8000800: 005b lslcc r3, r3, #1
+ 8000802: ea40 0001 orr.w r0, r0, r1
+ 8000806: f162 027f sbc.w r2, r2, #127 ; 0x7f
+ 800080a: 2afd cmp r2, #253 ; 0xfd
+ 800080c: d81d bhi.n 800084a <__aeabi_fmul+0x92>
+ 800080e: f1b3 4f00 cmp.w r3, #2147483648 ; 0x80000000
+ 8000812: eb40 50c2 adc.w r0, r0, r2, lsl #23
+ 8000816: bf08 it eq
+ 8000818: f020 0001 biceq.w r0, r0, #1
+ 800081c: 4770 bx lr
+ 800081e: f090 0f00 teq r0, #0
+ 8000822: f00c 4c00 and.w ip, ip, #2147483648 ; 0x80000000
+ 8000826: bf08 it eq
+ 8000828: 0249 lsleq r1, r1, #9
+ 800082a: ea4c 2050 orr.w r0, ip, r0, lsr #9
+ 800082e: ea40 2051 orr.w r0, r0, r1, lsr #9
+ 8000832: 3a7f subs r2, #127 ; 0x7f
+ 8000834: bfc2 ittt gt
+ 8000836: f1d2 03ff rsbsgt r3, r2, #255 ; 0xff
+ 800083a: ea40 50c2 orrgt.w r0, r0, r2, lsl #23
+ 800083e: 4770 bxgt lr
+ 8000840: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 8000844: f04f 0300 mov.w r3, #0
+ 8000848: 3a01 subs r2, #1
+ 800084a: dc5d bgt.n 8000908 <__aeabi_fmul+0x150>
+ 800084c: f112 0f19 cmn.w r2, #25
+ 8000850: bfdc itt le
+ 8000852: f000 4000 andle.w r0, r0, #2147483648 ; 0x80000000
+ 8000856: 4770 bxle lr
+ 8000858: f1c2 0200 rsb r2, r2, #0
+ 800085c: 0041 lsls r1, r0, #1
+ 800085e: fa21 f102 lsr.w r1, r1, r2
+ 8000862: f1c2 0220 rsb r2, r2, #32
+ 8000866: fa00 fc02 lsl.w ip, r0, r2
+ 800086a: ea5f 0031 movs.w r0, r1, rrx
+ 800086e: f140 0000 adc.w r0, r0, #0
+ 8000872: ea53 034c orrs.w r3, r3, ip, lsl #1
+ 8000876: bf08 it eq
+ 8000878: ea20 70dc biceq.w r0, r0, ip, lsr #31
+ 800087c: 4770 bx lr
+ 800087e: f092 0f00 teq r2, #0
+ 8000882: f000 4c00 and.w ip, r0, #2147483648 ; 0x80000000
+ 8000886: bf02 ittt eq
+ 8000888: 0040 lsleq r0, r0, #1
+ 800088a: f410 0f00 tsteq.w r0, #8388608 ; 0x800000
+ 800088e: 3a01 subeq r2, #1
+ 8000890: d0f9 beq.n 8000886 <__aeabi_fmul+0xce>
+ 8000892: ea40 000c orr.w r0, r0, ip
+ 8000896: f093 0f00 teq r3, #0
+ 800089a: f001 4c00 and.w ip, r1, #2147483648 ; 0x80000000
+ 800089e: bf02 ittt eq
+ 80008a0: 0049 lsleq r1, r1, #1
+ 80008a2: f411 0f00 tsteq.w r1, #8388608 ; 0x800000
+ 80008a6: 3b01 subeq r3, #1
+ 80008a8: d0f9 beq.n 800089e <__aeabi_fmul+0xe6>
+ 80008aa: ea41 010c orr.w r1, r1, ip
+ 80008ae: e78f b.n 80007d0 <__aeabi_fmul+0x18>
+ 80008b0: ea0c 53d1 and.w r3, ip, r1, lsr #23
+ 80008b4: ea92 0f0c teq r2, ip
+ 80008b8: bf18 it ne
+ 80008ba: ea93 0f0c teqne r3, ip
+ 80008be: d00a beq.n 80008d6 <__aeabi_fmul+0x11e>
+ 80008c0: f030 4c00 bics.w ip, r0, #2147483648 ; 0x80000000
+ 80008c4: bf18 it ne
+ 80008c6: f031 4c00 bicsne.w ip, r1, #2147483648 ; 0x80000000
+ 80008ca: d1d8 bne.n 800087e <__aeabi_fmul+0xc6>
+ 80008cc: ea80 0001 eor.w r0, r0, r1
+ 80008d0: f000 4000 and.w r0, r0, #2147483648 ; 0x80000000
+ 80008d4: 4770 bx lr
+ 80008d6: f090 0f00 teq r0, #0
+ 80008da: bf17 itett ne
+ 80008dc: f090 4f00 teqne r0, #2147483648 ; 0x80000000
+ 80008e0: 4608 moveq r0, r1
+ 80008e2: f091 0f00 teqne r1, #0
+ 80008e6: f091 4f00 teqne r1, #2147483648 ; 0x80000000
+ 80008ea: d014 beq.n 8000916 <__aeabi_fmul+0x15e>
+ 80008ec: ea92 0f0c teq r2, ip
+ 80008f0: d101 bne.n 80008f6 <__aeabi_fmul+0x13e>
+ 80008f2: 0242 lsls r2, r0, #9
+ 80008f4: d10f bne.n 8000916 <__aeabi_fmul+0x15e>
+ 80008f6: ea93 0f0c teq r3, ip
+ 80008fa: d103 bne.n 8000904 <__aeabi_fmul+0x14c>
+ 80008fc: 024b lsls r3, r1, #9
+ 80008fe: bf18 it ne
+ 8000900: 4608 movne r0, r1
+ 8000902: d108 bne.n 8000916 <__aeabi_fmul+0x15e>
+ 8000904: ea80 0001 eor.w r0, r0, r1
+ 8000908: f000 4000 and.w r0, r0, #2147483648 ; 0x80000000
+ 800090c: f040 40fe orr.w r0, r0, #2130706432 ; 0x7f000000
+ 8000910: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 8000914: 4770 bx lr
+ 8000916: f040 40fe orr.w r0, r0, #2130706432 ; 0x7f000000
+ 800091a: f440 0040 orr.w r0, r0, #12582912 ; 0xc00000
+ 800091e: 4770 bx lr
+
+08000920 <__aeabi_fdiv>:
+ 8000920: f04f 0cff mov.w ip, #255 ; 0xff
+ 8000924: ea1c 52d0 ands.w r2, ip, r0, lsr #23
+ 8000928: bf1e ittt ne
+ 800092a: ea1c 53d1 andsne.w r3, ip, r1, lsr #23
+ 800092e: ea92 0f0c teqne r2, ip
+ 8000932: ea93 0f0c teqne r3, ip
+ 8000936: d069 beq.n 8000a0c <__aeabi_fdiv+0xec>
+ 8000938: eba2 0203 sub.w r2, r2, r3
+ 800093c: ea80 0c01 eor.w ip, r0, r1
+ 8000940: 0249 lsls r1, r1, #9
+ 8000942: ea4f 2040 mov.w r0, r0, lsl #9
+ 8000946: d037 beq.n 80009b8 <__aeabi_fdiv+0x98>
+ 8000948: f04f 5380 mov.w r3, #268435456 ; 0x10000000
+ 800094c: ea43 1111 orr.w r1, r3, r1, lsr #4
+ 8000950: ea43 1310 orr.w r3, r3, r0, lsr #4
+ 8000954: f00c 4000 and.w r0, ip, #2147483648 ; 0x80000000
+ 8000958: 428b cmp r3, r1
+ 800095a: bf38 it cc
+ 800095c: 005b lslcc r3, r3, #1
+ 800095e: f142 027d adc.w r2, r2, #125 ; 0x7d
+ 8000962: f44f 0c00 mov.w ip, #8388608 ; 0x800000
+ 8000966: 428b cmp r3, r1
+ 8000968: bf24 itt cs
+ 800096a: 1a5b subcs r3, r3, r1
+ 800096c: ea40 000c orrcs.w r0, r0, ip
+ 8000970: ebb3 0f51 cmp.w r3, r1, lsr #1
+ 8000974: bf24 itt cs
+ 8000976: eba3 0351 subcs.w r3, r3, r1, lsr #1
+ 800097a: ea40 005c orrcs.w r0, r0, ip, lsr #1
+ 800097e: ebb3 0f91 cmp.w r3, r1, lsr #2
+ 8000982: bf24 itt cs
+ 8000984: eba3 0391 subcs.w r3, r3, r1, lsr #2
+ 8000988: ea40 009c orrcs.w r0, r0, ip, lsr #2
+ 800098c: ebb3 0fd1 cmp.w r3, r1, lsr #3
+ 8000990: bf24 itt cs
+ 8000992: eba3 03d1 subcs.w r3, r3, r1, lsr #3
+ 8000996: ea40 00dc orrcs.w r0, r0, ip, lsr #3
+ 800099a: 011b lsls r3, r3, #4
+ 800099c: bf18 it ne
+ 800099e: ea5f 1c1c movsne.w ip, ip, lsr #4
+ 80009a2: d1e0 bne.n 8000966 <__aeabi_fdiv+0x46>
+ 80009a4: 2afd cmp r2, #253 ; 0xfd
+ 80009a6: f63f af50 bhi.w 800084a <__aeabi_fmul+0x92>
+ 80009aa: 428b cmp r3, r1
+ 80009ac: eb40 50c2 adc.w r0, r0, r2, lsl #23
+ 80009b0: bf08 it eq
+ 80009b2: f020 0001 biceq.w r0, r0, #1
+ 80009b6: 4770 bx lr
+ 80009b8: f00c 4c00 and.w ip, ip, #2147483648 ; 0x80000000
+ 80009bc: ea4c 2050 orr.w r0, ip, r0, lsr #9
+ 80009c0: 327f adds r2, #127 ; 0x7f
+ 80009c2: bfc2 ittt gt
+ 80009c4: f1d2 03ff rsbsgt r3, r2, #255 ; 0xff
+ 80009c8: ea40 50c2 orrgt.w r0, r0, r2, lsl #23
+ 80009cc: 4770 bxgt lr
+ 80009ce: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 80009d2: f04f 0300 mov.w r3, #0
+ 80009d6: 3a01 subs r2, #1
+ 80009d8: e737 b.n 800084a <__aeabi_fmul+0x92>
+ 80009da: f092 0f00 teq r2, #0
+ 80009de: f000 4c00 and.w ip, r0, #2147483648 ; 0x80000000
+ 80009e2: bf02 ittt eq
+ 80009e4: 0040 lsleq r0, r0, #1
+ 80009e6: f410 0f00 tsteq.w r0, #8388608 ; 0x800000
+ 80009ea: 3a01 subeq r2, #1
+ 80009ec: d0f9 beq.n 80009e2 <__aeabi_fdiv+0xc2>
+ 80009ee: ea40 000c orr.w r0, r0, ip
+ 80009f2: f093 0f00 teq r3, #0
+ 80009f6: f001 4c00 and.w ip, r1, #2147483648 ; 0x80000000
+ 80009fa: bf02 ittt eq
+ 80009fc: 0049 lsleq r1, r1, #1
+ 80009fe: f411 0f00 tsteq.w r1, #8388608 ; 0x800000
+ 8000a02: 3b01 subeq r3, #1
+ 8000a04: d0f9 beq.n 80009fa <__aeabi_fdiv+0xda>
+ 8000a06: ea41 010c orr.w r1, r1, ip
+ 8000a0a: e795 b.n 8000938 <__aeabi_fdiv+0x18>
+ 8000a0c: ea0c 53d1 and.w r3, ip, r1, lsr #23
+ 8000a10: ea92 0f0c teq r2, ip
+ 8000a14: d108 bne.n 8000a28 <__aeabi_fdiv+0x108>
+ 8000a16: 0242 lsls r2, r0, #9
+ 8000a18: f47f af7d bne.w 8000916 <__aeabi_fmul+0x15e>
+ 8000a1c: ea93 0f0c teq r3, ip
+ 8000a20: f47f af70 bne.w 8000904 <__aeabi_fmul+0x14c>
+ 8000a24: 4608 mov r0, r1
+ 8000a26: e776 b.n 8000916 <__aeabi_fmul+0x15e>
+ 8000a28: ea93 0f0c teq r3, ip
+ 8000a2c: d104 bne.n 8000a38 <__aeabi_fdiv+0x118>
+ 8000a2e: 024b lsls r3, r1, #9
+ 8000a30: f43f af4c beq.w 80008cc <__aeabi_fmul+0x114>
+ 8000a34: 4608 mov r0, r1
+ 8000a36: e76e b.n 8000916 <__aeabi_fmul+0x15e>
+ 8000a38: f030 4c00 bics.w ip, r0, #2147483648 ; 0x80000000
+ 8000a3c: bf18 it ne
+ 8000a3e: f031 4c00 bicsne.w ip, r1, #2147483648 ; 0x80000000
+ 8000a42: d1ca bne.n 80009da <__aeabi_fdiv+0xba>
+ 8000a44: f030 4200 bics.w r2, r0, #2147483648 ; 0x80000000
+ 8000a48: f47f af5c bne.w 8000904 <__aeabi_fmul+0x14c>
+ 8000a4c: f031 4300 bics.w r3, r1, #2147483648 ; 0x80000000
+ 8000a50: f47f af3c bne.w 80008cc <__aeabi_fmul+0x114>
+ 8000a54: e75f b.n 8000916 <__aeabi_fmul+0x15e>
+ 8000a56: bf00 nop
+
+08000a58 <__gesf2>:
+ 8000a58: f04f 3cff mov.w ip, #4294967295 ; 0xffffffff
+ 8000a5c: e006 b.n 8000a6c <__cmpsf2+0x4>
+ 8000a5e: bf00 nop
+
+08000a60 <__lesf2>:
+ 8000a60: f04f 0c01 mov.w ip, #1
+ 8000a64: e002 b.n 8000a6c <__cmpsf2+0x4>
+ 8000a66: bf00 nop
+
+08000a68 <__cmpsf2>:
+ 8000a68: f04f 0c01 mov.w ip, #1
+ 8000a6c: f84d cd04 str.w ip, [sp, #-4]!
+ 8000a70: ea4f 0240 mov.w r2, r0, lsl #1
+ 8000a74: ea4f 0341 mov.w r3, r1, lsl #1
+ 8000a78: ea7f 6c22 mvns.w ip, r2, asr #24
+ 8000a7c: bf18 it ne
+ 8000a7e: ea7f 6c23 mvnsne.w ip, r3, asr #24
+ 8000a82: d011 beq.n 8000aa8 <__cmpsf2+0x40>
+ 8000a84: b001 add sp, #4
+ 8000a86: ea52 0c53 orrs.w ip, r2, r3, lsr #1
+ 8000a8a: bf18 it ne
+ 8000a8c: ea90 0f01 teqne r0, r1
+ 8000a90: bf58 it pl
+ 8000a92: ebb2 0003 subspl.w r0, r2, r3
+ 8000a96: bf88 it hi
+ 8000a98: 17c8 asrhi r0, r1, #31
+ 8000a9a: bf38 it cc
+ 8000a9c: ea6f 70e1 mvncc.w r0, r1, asr #31
+ 8000aa0: bf18 it ne
+ 8000aa2: f040 0001 orrne.w r0, r0, #1
+ 8000aa6: 4770 bx lr
+ 8000aa8: ea7f 6c22 mvns.w ip, r2, asr #24
+ 8000aac: d102 bne.n 8000ab4 <__cmpsf2+0x4c>
+ 8000aae: ea5f 2c40 movs.w ip, r0, lsl #9
+ 8000ab2: d105 bne.n 8000ac0 <__cmpsf2+0x58>
+ 8000ab4: ea7f 6c23 mvns.w ip, r3, asr #24
+ 8000ab8: d1e4 bne.n 8000a84 <__cmpsf2+0x1c>
+ 8000aba: ea5f 2c41 movs.w ip, r1, lsl #9
+ 8000abe: d0e1 beq.n 8000a84 <__cmpsf2+0x1c>
+ 8000ac0: f85d 0b04 ldr.w r0, [sp], #4
+ 8000ac4: 4770 bx lr
+ 8000ac6: bf00 nop
+
+08000ac8 <__aeabi_cfrcmple>:
+ 8000ac8: 4684 mov ip, r0
+ 8000aca: 4608 mov r0, r1
+ 8000acc: 4661 mov r1, ip
+ 8000ace: e7ff b.n 8000ad0 <__aeabi_cfcmpeq>
+
+08000ad0 <__aeabi_cfcmpeq>:
+ 8000ad0: b50f push {r0, r1, r2, r3, lr}
+ 8000ad2: f7ff ffc9 bl 8000a68 <__cmpsf2>
+ 8000ad6: 2800 cmp r0, #0
+ 8000ad8: bf48 it mi
+ 8000ada: f110 0f00 cmnmi.w r0, #0
+ 8000ade: bd0f pop {r0, r1, r2, r3, pc}
+
+08000ae0 <__aeabi_fcmpeq>:
+ 8000ae0: f84d ed08 str.w lr, [sp, #-8]!
+ 8000ae4: f7ff fff4 bl 8000ad0 <__aeabi_cfcmpeq>
+ 8000ae8: bf0c ite eq
+ 8000aea: 2001 moveq r0, #1
+ 8000aec: 2000 movne r0, #0
+ 8000aee: f85d fb08 ldr.w pc, [sp], #8
+ 8000af2: bf00 nop
+
+08000af4 <__aeabi_fcmplt>:
+ 8000af4: f84d ed08 str.w lr, [sp, #-8]!
+ 8000af8: f7ff ffea bl 8000ad0 <__aeabi_cfcmpeq>
+ 8000afc: bf34 ite cc
+ 8000afe: 2001 movcc r0, #1
+ 8000b00: 2000 movcs r0, #0
+ 8000b02: f85d fb08 ldr.w pc, [sp], #8
+ 8000b06: bf00 nop
+
+08000b08 <__aeabi_fcmple>:
+ 8000b08: f84d ed08 str.w lr, [sp, #-8]!
+ 8000b0c: f7ff ffe0 bl 8000ad0 <__aeabi_cfcmpeq>
+ 8000b10: bf94 ite ls
+ 8000b12: 2001 movls r0, #1
+ 8000b14: 2000 movhi r0, #0
+ 8000b16: f85d fb08 ldr.w pc, [sp], #8
+ 8000b1a: bf00 nop
+
+08000b1c <__aeabi_fcmpge>:
+ 8000b1c: f84d ed08 str.w lr, [sp, #-8]!
+ 8000b20: f7ff ffd2 bl 8000ac8 <__aeabi_cfrcmple>
+ 8000b24: bf94 ite ls
+ 8000b26: 2001 movls r0, #1
+ 8000b28: 2000 movhi r0, #0
+ 8000b2a: f85d fb08 ldr.w pc, [sp], #8
+ 8000b2e: bf00 nop
+
+08000b30 <__aeabi_fcmpgt>:
+ 8000b30: f84d ed08 str.w lr, [sp, #-8]!
+ 8000b34: f7ff ffc8 bl 8000ac8 <__aeabi_cfrcmple>
+ 8000b38: bf34 ite cc
+ 8000b3a: 2001 movcc r0, #1
+ 8000b3c: 2000 movcs r0, #0
+ 8000b3e: f85d fb08 ldr.w pc, [sp], #8
+ 8000b42: bf00 nop
+
+08000b44 <__aeabi_ldivmod>:
+ 8000b44: b97b cbnz r3, 8000b66 <__aeabi_ldivmod+0x22>
+ 8000b46: b972 cbnz r2, 8000b66 <__aeabi_ldivmod+0x22>
+ 8000b48: 2900 cmp r1, #0
+ 8000b4a: bfbe ittt lt
+ 8000b4c: 2000 movlt r0, #0
+ 8000b4e: f04f 4100 movlt.w r1, #2147483648 ; 0x80000000
+ 8000b52: e006 blt.n 8000b62 <__aeabi_ldivmod+0x1e>
+ 8000b54: bf08 it eq
+ 8000b56: 2800 cmpeq r0, #0
+ 8000b58: bf1c itt ne
+ 8000b5a: f06f 4100 mvnne.w r1, #2147483648 ; 0x80000000
+ 8000b5e: f04f 30ff movne.w r0, #4294967295 ; 0xffffffff
+ 8000b62: f000 b9c1 b.w 8000ee8 <__aeabi_idiv0>
+ 8000b66: f1ad 0c08 sub.w ip, sp, #8
+ 8000b6a: e96d ce04 strd ip, lr, [sp, #-16]!
+ 8000b6e: 2900 cmp r1, #0
+ 8000b70: db09 blt.n 8000b86 <__aeabi_ldivmod+0x42>
+ 8000b72: 2b00 cmp r3, #0
+ 8000b74: db1a blt.n 8000bac <__aeabi_ldivmod+0x68>
+ 8000b76: f000 f84d bl 8000c14 <__udivmoddi4>
+ 8000b7a: f8dd e004 ldr.w lr, [sp, #4]
+ 8000b7e: e9dd 2302 ldrd r2, r3, [sp, #8]
+ 8000b82: b004 add sp, #16
+ 8000b84: 4770 bx lr
+ 8000b86: 4240 negs r0, r0
+ 8000b88: eb61 0141 sbc.w r1, r1, r1, lsl #1
+ 8000b8c: 2b00 cmp r3, #0
+ 8000b8e: db1b blt.n 8000bc8 <__aeabi_ldivmod+0x84>
+ 8000b90: f000 f840 bl 8000c14 <__udivmoddi4>
+ 8000b94: f8dd e004 ldr.w lr, [sp, #4]
+ 8000b98: e9dd 2302 ldrd r2, r3, [sp, #8]
+ 8000b9c: b004 add sp, #16
+ 8000b9e: 4240 negs r0, r0
+ 8000ba0: eb61 0141 sbc.w r1, r1, r1, lsl #1
+ 8000ba4: 4252 negs r2, r2
+ 8000ba6: eb63 0343 sbc.w r3, r3, r3, lsl #1
+ 8000baa: 4770 bx lr
+ 8000bac: 4252 negs r2, r2
+ 8000bae: eb63 0343 sbc.w r3, r3, r3, lsl #1
+ 8000bb2: f000 f82f bl 8000c14 <__udivmoddi4>
+ 8000bb6: f8dd e004 ldr.w lr, [sp, #4]
+ 8000bba: e9dd 2302 ldrd r2, r3, [sp, #8]
+ 8000bbe: b004 add sp, #16
+ 8000bc0: 4240 negs r0, r0
+ 8000bc2: eb61 0141 sbc.w r1, r1, r1, lsl #1
+ 8000bc6: 4770 bx lr
+ 8000bc8: 4252 negs r2, r2
+ 8000bca: eb63 0343 sbc.w r3, r3, r3, lsl #1
+ 8000bce: f000 f821 bl 8000c14 <__udivmoddi4>
+ 8000bd2: f8dd e004 ldr.w lr, [sp, #4]
+ 8000bd6: e9dd 2302 ldrd r2, r3, [sp, #8]
+ 8000bda: b004 add sp, #16
+ 8000bdc: 4252 negs r2, r2
+ 8000bde: eb63 0343 sbc.w r3, r3, r3, lsl #1
+ 8000be2: 4770 bx lr
+
+08000be4 <__aeabi_uldivmod>:
+ 8000be4: b953 cbnz r3, 8000bfc <__aeabi_uldivmod+0x18>
+ 8000be6: b94a cbnz r2, 8000bfc <__aeabi_uldivmod+0x18>
+ 8000be8: 2900 cmp r1, #0
+ 8000bea: bf08 it eq
+ 8000bec: 2800 cmpeq r0, #0
+ 8000bee: bf1c itt ne
+ 8000bf0: f04f 31ff movne.w r1, #4294967295 ; 0xffffffff
+ 8000bf4: f04f 30ff movne.w r0, #4294967295 ; 0xffffffff
+ 8000bf8: f000 b976 b.w 8000ee8 <__aeabi_idiv0>
+ 8000bfc: f1ad 0c08 sub.w ip, sp, #8
+ 8000c00: e96d ce04 strd ip, lr, [sp, #-16]!
+ 8000c04: f000 f806 bl 8000c14 <__udivmoddi4>
+ 8000c08: f8dd e004 ldr.w lr, [sp, #4]
+ 8000c0c: e9dd 2302 ldrd r2, r3, [sp, #8]
+ 8000c10: b004 add sp, #16
+ 8000c12: 4770 bx lr
+
+08000c14 <__udivmoddi4>:
+ 8000c14: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
+ 8000c18: 9e08 ldr r6, [sp, #32]
+ 8000c1a: 460d mov r5, r1
+ 8000c1c: 4604 mov r4, r0
+ 8000c1e: 4688 mov r8, r1
+ 8000c20: 2b00 cmp r3, #0
+ 8000c22: d14d bne.n 8000cc0 <__udivmoddi4+0xac>
+ 8000c24: 428a cmp r2, r1
+ 8000c26: 4694 mov ip, r2
+ 8000c28: d968 bls.n 8000cfc <__udivmoddi4+0xe8>
+ 8000c2a: fab2 f282 clz r2, r2
+ 8000c2e: b152 cbz r2, 8000c46 <__udivmoddi4+0x32>
+ 8000c30: fa01 f302 lsl.w r3, r1, r2
+ 8000c34: f1c2 0120 rsb r1, r2, #32
+ 8000c38: fa20 f101 lsr.w r1, r0, r1
+ 8000c3c: fa0c fc02 lsl.w ip, ip, r2
+ 8000c40: ea41 0803 orr.w r8, r1, r3
+ 8000c44: 4094 lsls r4, r2
+ 8000c46: ea4f 411c mov.w r1, ip, lsr #16
+ 8000c4a: fbb8 f7f1 udiv r7, r8, r1
+ 8000c4e: fa1f fe8c uxth.w lr, ip
+ 8000c52: fb01 8817 mls r8, r1, r7, r8
+ 8000c56: fb07 f00e mul.w r0, r7, lr
+ 8000c5a: 0c23 lsrs r3, r4, #16
+ 8000c5c: ea43 4308 orr.w r3, r3, r8, lsl #16
+ 8000c60: 4298 cmp r0, r3
+ 8000c62: d90a bls.n 8000c7a <__udivmoddi4+0x66>
+ 8000c64: eb1c 0303 adds.w r3, ip, r3
+ 8000c68: f107 35ff add.w r5, r7, #4294967295 ; 0xffffffff
+ 8000c6c: f080 811e bcs.w 8000eac <__udivmoddi4+0x298>
+ 8000c70: 4298 cmp r0, r3
+ 8000c72: f240 811b bls.w 8000eac <__udivmoddi4+0x298>
+ 8000c76: 3f02 subs r7, #2
+ 8000c78: 4463 add r3, ip
+ 8000c7a: 1a1b subs r3, r3, r0
+ 8000c7c: fbb3 f0f1 udiv r0, r3, r1
+ 8000c80: fb01 3310 mls r3, r1, r0, r3
+ 8000c84: fb00 fe0e mul.w lr, r0, lr
+ 8000c88: b2a4 uxth r4, r4
+ 8000c8a: ea44 4403 orr.w r4, r4, r3, lsl #16
+ 8000c8e: 45a6 cmp lr, r4
+ 8000c90: d90a bls.n 8000ca8 <__udivmoddi4+0x94>
+ 8000c92: eb1c 0404 adds.w r4, ip, r4
+ 8000c96: f100 33ff add.w r3, r0, #4294967295 ; 0xffffffff
+ 8000c9a: f080 8109 bcs.w 8000eb0 <__udivmoddi4+0x29c>
+ 8000c9e: 45a6 cmp lr, r4
+ 8000ca0: f240 8106 bls.w 8000eb0 <__udivmoddi4+0x29c>
+ 8000ca4: 4464 add r4, ip
+ 8000ca6: 3802 subs r0, #2
+ 8000ca8: 2100 movs r1, #0
+ 8000caa: eba4 040e sub.w r4, r4, lr
+ 8000cae: ea40 4007 orr.w r0, r0, r7, lsl #16
+ 8000cb2: b11e cbz r6, 8000cbc <__udivmoddi4+0xa8>
+ 8000cb4: 2300 movs r3, #0
+ 8000cb6: 40d4 lsrs r4, r2
+ 8000cb8: e9c6 4300 strd r4, r3, [r6]
+ 8000cbc: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
+ 8000cc0: 428b cmp r3, r1
+ 8000cc2: d908 bls.n 8000cd6 <__udivmoddi4+0xc2>
+ 8000cc4: 2e00 cmp r6, #0
+ 8000cc6: f000 80ee beq.w 8000ea6 <__udivmoddi4+0x292>
+ 8000cca: 2100 movs r1, #0
+ 8000ccc: e9c6 0500 strd r0, r5, [r6]
+ 8000cd0: 4608 mov r0, r1
+ 8000cd2: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
+ 8000cd6: fab3 f183 clz r1, r3
+ 8000cda: 2900 cmp r1, #0
+ 8000cdc: d14a bne.n 8000d74 <__udivmoddi4+0x160>
+ 8000cde: 42ab cmp r3, r5
+ 8000ce0: d302 bcc.n 8000ce8 <__udivmoddi4+0xd4>
+ 8000ce2: 4282 cmp r2, r0
+ 8000ce4: f200 80fc bhi.w 8000ee0 <__udivmoddi4+0x2cc>
+ 8000ce8: 1a84 subs r4, r0, r2
+ 8000cea: eb65 0303 sbc.w r3, r5, r3
+ 8000cee: 2001 movs r0, #1
+ 8000cf0: 4698 mov r8, r3
+ 8000cf2: 2e00 cmp r6, #0
+ 8000cf4: d0e2 beq.n 8000cbc <__udivmoddi4+0xa8>
+ 8000cf6: e9c6 4800 strd r4, r8, [r6]
+ 8000cfa: e7df b.n 8000cbc <__udivmoddi4+0xa8>
+ 8000cfc: b902 cbnz r2, 8000d00 <__udivmoddi4+0xec>
+ 8000cfe: deff udf #255 ; 0xff
+ 8000d00: fab2 f282 clz r2, r2
+ 8000d04: 2a00 cmp r2, #0
+ 8000d06: f040 8091 bne.w 8000e2c <__udivmoddi4+0x218>
+ 8000d0a: eba1 000c sub.w r0, r1, ip
+ 8000d0e: 2101 movs r1, #1
+ 8000d10: ea4f 471c mov.w r7, ip, lsr #16
+ 8000d14: fa1f fe8c uxth.w lr, ip
+ 8000d18: fbb0 f3f7 udiv r3, r0, r7
+ 8000d1c: fb07 0013 mls r0, r7, r3, r0
+ 8000d20: 0c25 lsrs r5, r4, #16
+ 8000d22: ea45 4500 orr.w r5, r5, r0, lsl #16
+ 8000d26: fb0e f003 mul.w r0, lr, r3
+ 8000d2a: 42a8 cmp r0, r5
+ 8000d2c: d908 bls.n 8000d40 <__udivmoddi4+0x12c>
+ 8000d2e: eb1c 0505 adds.w r5, ip, r5
+ 8000d32: f103 38ff add.w r8, r3, #4294967295 ; 0xffffffff
+ 8000d36: d202 bcs.n 8000d3e <__udivmoddi4+0x12a>
+ 8000d38: 42a8 cmp r0, r5
+ 8000d3a: f200 80ce bhi.w 8000eda <__udivmoddi4+0x2c6>
+ 8000d3e: 4643 mov r3, r8
+ 8000d40: 1a2d subs r5, r5, r0
+ 8000d42: fbb5 f0f7 udiv r0, r5, r7
+ 8000d46: fb07 5510 mls r5, r7, r0, r5
+ 8000d4a: fb0e fe00 mul.w lr, lr, r0
+ 8000d4e: b2a4 uxth r4, r4
+ 8000d50: ea44 4405 orr.w r4, r4, r5, lsl #16
+ 8000d54: 45a6 cmp lr, r4
+ 8000d56: d908 bls.n 8000d6a <__udivmoddi4+0x156>
+ 8000d58: eb1c 0404 adds.w r4, ip, r4
+ 8000d5c: f100 35ff add.w r5, r0, #4294967295 ; 0xffffffff
+ 8000d60: d202 bcs.n 8000d68 <__udivmoddi4+0x154>
+ 8000d62: 45a6 cmp lr, r4
+ 8000d64: f200 80b6 bhi.w 8000ed4 <__udivmoddi4+0x2c0>
+ 8000d68: 4628 mov r0, r5
+ 8000d6a: eba4 040e sub.w r4, r4, lr
+ 8000d6e: ea40 4003 orr.w r0, r0, r3, lsl #16
+ 8000d72: e79e b.n 8000cb2 <__udivmoddi4+0x9e>
+ 8000d74: f1c1 0720 rsb r7, r1, #32
+ 8000d78: 408b lsls r3, r1
+ 8000d7a: fa22 fc07 lsr.w ip, r2, r7
+ 8000d7e: ea4c 0c03 orr.w ip, ip, r3
+ 8000d82: fa25 fa07 lsr.w sl, r5, r7
+ 8000d86: ea4f 491c mov.w r9, ip, lsr #16
+ 8000d8a: fbba f8f9 udiv r8, sl, r9
+ 8000d8e: fa20 f307 lsr.w r3, r0, r7
+ 8000d92: fb09 aa18 mls sl, r9, r8, sl
+ 8000d96: 408d lsls r5, r1
+ 8000d98: fa1f fe8c uxth.w lr, ip
+ 8000d9c: 431d orrs r5, r3
+ 8000d9e: fa00 f301 lsl.w r3, r0, r1
+ 8000da2: fb08 f00e mul.w r0, r8, lr
+ 8000da6: 0c2c lsrs r4, r5, #16
+ 8000da8: ea44 440a orr.w r4, r4, sl, lsl #16
+ 8000dac: 42a0 cmp r0, r4
+ 8000dae: fa02 f201 lsl.w r2, r2, r1
+ 8000db2: d90b bls.n 8000dcc <__udivmoddi4+0x1b8>
+ 8000db4: eb1c 0404 adds.w r4, ip, r4
+ 8000db8: f108 3aff add.w sl, r8, #4294967295 ; 0xffffffff
+ 8000dbc: f080 8088 bcs.w 8000ed0 <__udivmoddi4+0x2bc>
+ 8000dc0: 42a0 cmp r0, r4
+ 8000dc2: f240 8085 bls.w 8000ed0 <__udivmoddi4+0x2bc>
+ 8000dc6: f1a8 0802 sub.w r8, r8, #2
+ 8000dca: 4464 add r4, ip
+ 8000dcc: 1a24 subs r4, r4, r0
+ 8000dce: fbb4 f0f9 udiv r0, r4, r9
+ 8000dd2: fb09 4410 mls r4, r9, r0, r4
+ 8000dd6: fb00 fe0e mul.w lr, r0, lr
+ 8000dda: b2ad uxth r5, r5
+ 8000ddc: ea45 4404 orr.w r4, r5, r4, lsl #16
+ 8000de0: 45a6 cmp lr, r4
+ 8000de2: d908 bls.n 8000df6 <__udivmoddi4+0x1e2>
+ 8000de4: eb1c 0404 adds.w r4, ip, r4
+ 8000de8: f100 35ff add.w r5, r0, #4294967295 ; 0xffffffff
+ 8000dec: d26c bcs.n 8000ec8 <__udivmoddi4+0x2b4>
+ 8000dee: 45a6 cmp lr, r4
+ 8000df0: d96a bls.n 8000ec8 <__udivmoddi4+0x2b4>
+ 8000df2: 3802 subs r0, #2
+ 8000df4: 4464 add r4, ip
+ 8000df6: ea40 4008 orr.w r0, r0, r8, lsl #16
+ 8000dfa: fba0 9502 umull r9, r5, r0, r2
+ 8000dfe: eba4 040e sub.w r4, r4, lr
+ 8000e02: 42ac cmp r4, r5
+ 8000e04: 46c8 mov r8, r9
+ 8000e06: 46ae mov lr, r5
+ 8000e08: d356 bcc.n 8000eb8 <__udivmoddi4+0x2a4>
+ 8000e0a: d053 beq.n 8000eb4 <__udivmoddi4+0x2a0>
+ 8000e0c: 2e00 cmp r6, #0
+ 8000e0e: d069 beq.n 8000ee4 <__udivmoddi4+0x2d0>
+ 8000e10: ebb3 0208 subs.w r2, r3, r8
+ 8000e14: eb64 040e sbc.w r4, r4, lr
+ 8000e18: fa22 f301 lsr.w r3, r2, r1
+ 8000e1c: fa04 f707 lsl.w r7, r4, r7
+ 8000e20: 431f orrs r7, r3
+ 8000e22: 40cc lsrs r4, r1
+ 8000e24: e9c6 7400 strd r7, r4, [r6]
+ 8000e28: 2100 movs r1, #0
+ 8000e2a: e747 b.n 8000cbc <__udivmoddi4+0xa8>
+ 8000e2c: fa0c fc02 lsl.w ip, ip, r2
+ 8000e30: f1c2 0120 rsb r1, r2, #32
+ 8000e34: fa25 f301 lsr.w r3, r5, r1
+ 8000e38: ea4f 471c mov.w r7, ip, lsr #16
+ 8000e3c: fa20 f101 lsr.w r1, r0, r1
+ 8000e40: 4095 lsls r5, r2
+ 8000e42: 430d orrs r5, r1
+ 8000e44: fbb3 f1f7 udiv r1, r3, r7
+ 8000e48: fb07 3311 mls r3, r7, r1, r3
+ 8000e4c: fa1f fe8c uxth.w lr, ip
+ 8000e50: 0c28 lsrs r0, r5, #16
+ 8000e52: ea40 4003 orr.w r0, r0, r3, lsl #16
+ 8000e56: fb01 f30e mul.w r3, r1, lr
+ 8000e5a: 4283 cmp r3, r0
+ 8000e5c: fa04 f402 lsl.w r4, r4, r2
+ 8000e60: d908 bls.n 8000e74 <__udivmoddi4+0x260>
+ 8000e62: eb1c 0000 adds.w r0, ip, r0
+ 8000e66: f101 38ff add.w r8, r1, #4294967295 ; 0xffffffff
+ 8000e6a: d22f bcs.n 8000ecc <__udivmoddi4+0x2b8>
+ 8000e6c: 4283 cmp r3, r0
+ 8000e6e: d92d bls.n 8000ecc <__udivmoddi4+0x2b8>
+ 8000e70: 3902 subs r1, #2
+ 8000e72: 4460 add r0, ip
+ 8000e74: 1ac0 subs r0, r0, r3
+ 8000e76: fbb0 f3f7 udiv r3, r0, r7
+ 8000e7a: fb07 0013 mls r0, r7, r3, r0
+ 8000e7e: b2ad uxth r5, r5
+ 8000e80: ea45 4500 orr.w r5, r5, r0, lsl #16
+ 8000e84: fb03 f00e mul.w r0, r3, lr
+ 8000e88: 42a8 cmp r0, r5
+ 8000e8a: d908 bls.n 8000e9e <__udivmoddi4+0x28a>
+ 8000e8c: eb1c 0505 adds.w r5, ip, r5
+ 8000e90: f103 38ff add.w r8, r3, #4294967295 ; 0xffffffff
+ 8000e94: d216 bcs.n 8000ec4 <__udivmoddi4+0x2b0>
+ 8000e96: 42a8 cmp r0, r5
+ 8000e98: d914 bls.n 8000ec4 <__udivmoddi4+0x2b0>
+ 8000e9a: 3b02 subs r3, #2
+ 8000e9c: 4465 add r5, ip
+ 8000e9e: 1a28 subs r0, r5, r0
+ 8000ea0: ea43 4101 orr.w r1, r3, r1, lsl #16
+ 8000ea4: e738 b.n 8000d18 <__udivmoddi4+0x104>
+ 8000ea6: 4631 mov r1, r6
+ 8000ea8: 4630 mov r0, r6
+ 8000eaa: e707 b.n 8000cbc <__udivmoddi4+0xa8>
+ 8000eac: 462f mov r7, r5
+ 8000eae: e6e4 b.n 8000c7a <__udivmoddi4+0x66>
+ 8000eb0: 4618 mov r0, r3
+ 8000eb2: e6f9 b.n 8000ca8 <__udivmoddi4+0x94>
+ 8000eb4: 454b cmp r3, r9
+ 8000eb6: d2a9 bcs.n 8000e0c <__udivmoddi4+0x1f8>
+ 8000eb8: ebb9 0802 subs.w r8, r9, r2
+ 8000ebc: eb65 0e0c sbc.w lr, r5, ip
+ 8000ec0: 3801 subs r0, #1
+ 8000ec2: e7a3 b.n 8000e0c <__udivmoddi4+0x1f8>
+ 8000ec4: 4643 mov r3, r8
+ 8000ec6: e7ea b.n 8000e9e <__udivmoddi4+0x28a>
+ 8000ec8: 4628 mov r0, r5
+ 8000eca: e794 b.n 8000df6 <__udivmoddi4+0x1e2>
+ 8000ecc: 4641 mov r1, r8
+ 8000ece: e7d1 b.n 8000e74 <__udivmoddi4+0x260>
+ 8000ed0: 46d0 mov r8, sl
+ 8000ed2: e77b b.n 8000dcc <__udivmoddi4+0x1b8>
+ 8000ed4: 4464 add r4, ip
+ 8000ed6: 3802 subs r0, #2
+ 8000ed8: e747 b.n 8000d6a <__udivmoddi4+0x156>
+ 8000eda: 3b02 subs r3, #2
+ 8000edc: 4465 add r5, ip
+ 8000ede: e72f b.n 8000d40 <__udivmoddi4+0x12c>
+ 8000ee0: 4608 mov r0, r1
+ 8000ee2: e706 b.n 8000cf2 <__udivmoddi4+0xde>
+ 8000ee4: 4631 mov r1, r6
+ 8000ee6: e6e9 b.n 8000cbc <__udivmoddi4+0xa8>
+
+08000ee8 <__aeabi_idiv0>:
+ 8000ee8: 4770 bx lr
+ 8000eea: bf00 nop
+
+08000eec :
+
+ADC_HandleTypeDef hadc1;
+
+/* ADC1 init function */
+void MX_ADC1_Init(void)
+{
+ 8000eec: b580 push {r7, lr}
+ 8000eee: b084 sub sp, #16
+ 8000ef0: af00 add r7, sp, #0
+
+ /* USER CODE BEGIN ADC1_Init 0 */
+
+ /* USER CODE END ADC1_Init 0 */
+
+ ADC_ChannelConfTypeDef sConfig = {0};
+ 8000ef2: 1d3b adds r3, r7, #4
+ 8000ef4: 2200 movs r2, #0
+ 8000ef6: 601a str r2, [r3, #0]
+ 8000ef8: 605a str r2, [r3, #4]
+ 8000efa: 609a str r2, [r3, #8]
+
+ /* USER CODE END ADC1_Init 1 */
+
+ /** Common config
+ */
+ hadc1.Instance = ADC1;
+ 8000efc: 4b18 ldr r3, [pc, #96] ; (8000f60 )
+ 8000efe: 4a19 ldr r2, [pc, #100] ; (8000f64 )
+ 8000f00: 601a str r2, [r3, #0]
+ hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE;
+ 8000f02: 4b17 ldr r3, [pc, #92] ; (8000f60 )
+ 8000f04: 2200 movs r2, #0
+ 8000f06: 609a str r2, [r3, #8]
+ hadc1.Init.ContinuousConvMode = DISABLE;
+ 8000f08: 4b15 ldr r3, [pc, #84] ; (8000f60 )
+ 8000f0a: 2200 movs r2, #0
+ 8000f0c: 731a strb r2, [r3, #12]
+ hadc1.Init.DiscontinuousConvMode = DISABLE;
+ 8000f0e: 4b14 ldr r3, [pc, #80] ; (8000f60 )
+ 8000f10: 2200 movs r2, #0
+ 8000f12: 751a strb r2, [r3, #20]
+ hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
+ 8000f14: 4b12 ldr r3, [pc, #72] ; (8000f60 )
+ 8000f16: f44f 2260 mov.w r2, #917504 ; 0xe0000
+ 8000f1a: 61da str r2, [r3, #28]
+ hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
+ 8000f1c: 4b10 ldr r3, [pc, #64] ; (8000f60 )
+ 8000f1e: 2200 movs r2, #0
+ 8000f20: 605a str r2, [r3, #4]
+ hadc1.Init.NbrOfConversion = 1;
+ 8000f22: 4b0f ldr r3, [pc, #60] ; (8000f60 )
+ 8000f24: 2201 movs r2, #1
+ 8000f26: 611a str r2, [r3, #16]
+ if (HAL_ADC_Init(&hadc1) != HAL_OK)
+ 8000f28: 480d ldr r0, [pc, #52] ; (8000f60 )
+ 8000f2a: f002 fec7 bl 8003cbc
+ 8000f2e: 4603 mov r3, r0
+ 8000f30: 2b00 cmp r3, #0
+ 8000f32: d001 beq.n 8000f38
+ {
+ Error_Handler();
+ 8000f34: f002 fb44 bl 80035c0
+ }
+
+ /** Configure Regular Channel
+ */
+ sConfig.Channel = ADC_CHANNEL_8;
+ 8000f38: 2308 movs r3, #8
+ 8000f3a: 607b str r3, [r7, #4]
+ sConfig.Rank = ADC_REGULAR_RANK_1;
+ 8000f3c: 2301 movs r3, #1
+ 8000f3e: 60bb str r3, [r7, #8]
+ sConfig.SamplingTime = ADC_SAMPLETIME_1CYCLE_5;
+ 8000f40: 2300 movs r3, #0
+ 8000f42: 60fb str r3, [r7, #12]
+ if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
+ 8000f44: 1d3b adds r3, r7, #4
+ 8000f46: 4619 mov r1, r3
+ 8000f48: 4805 ldr r0, [pc, #20] ; (8000f60 )
+ 8000f4a: f003 f97b bl 8004244
+ 8000f4e: 4603 mov r3, r0
+ 8000f50: 2b00 cmp r3, #0
+ 8000f52: d001 beq.n 8000f58
+ {
+ Error_Handler();
+ 8000f54: f002 fb34 bl 80035c0
+ }
+ /* USER CODE BEGIN ADC1_Init 2 */
+
+ /* USER CODE END ADC1_Init 2 */
+
+}
+ 8000f58: bf00 nop
+ 8000f5a: 3710 adds r7, #16
+ 8000f5c: 46bd mov sp, r7
+ 8000f5e: bd80 pop {r7, pc}
+ 8000f60: 2000008c .word 0x2000008c
+ 8000f64: 40012400 .word 0x40012400
+
+08000f68 :
+
+void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle)
+{
+ 8000f68: b580 push {r7, lr}
+ 8000f6a: b08a sub sp, #40 ; 0x28
+ 8000f6c: af00 add r7, sp, #0
+ 8000f6e: 6078 str r0, [r7, #4]
+
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ 8000f70: f107 0318 add.w r3, r7, #24
+ 8000f74: 2200 movs r2, #0
+ 8000f76: 601a str r2, [r3, #0]
+ 8000f78: 605a str r2, [r3, #4]
+ 8000f7a: 609a str r2, [r3, #8]
+ 8000f7c: 60da str r2, [r3, #12]
+ if(adcHandle->Instance==ADC1)
+ 8000f7e: 687b ldr r3, [r7, #4]
+ 8000f80: 681b ldr r3, [r3, #0]
+ 8000f82: 4a1f ldr r2, [pc, #124] ; (8001000 )
+ 8000f84: 4293 cmp r3, r2
+ 8000f86: d137 bne.n 8000ff8
+ {
+ /* USER CODE BEGIN ADC1_MspInit 0 */
+
+ /* USER CODE END ADC1_MspInit 0 */
+ /* ADC1 clock enable */
+ __HAL_RCC_ADC1_CLK_ENABLE();
+ 8000f88: 4b1e ldr r3, [pc, #120] ; (8001004 )
+ 8000f8a: 699b ldr r3, [r3, #24]
+ 8000f8c: 4a1d ldr r2, [pc, #116] ; (8001004 )
+ 8000f8e: f443 7300 orr.w r3, r3, #512 ; 0x200
+ 8000f92: 6193 str r3, [r2, #24]
+ 8000f94: 4b1b ldr r3, [pc, #108] ; (8001004 )
+ 8000f96: 699b ldr r3, [r3, #24]
+ 8000f98: f403 7300 and.w r3, r3, #512 ; 0x200
+ 8000f9c: 617b str r3, [r7, #20]
+ 8000f9e: 697b ldr r3, [r7, #20]
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ 8000fa0: 4b18 ldr r3, [pc, #96] ; (8001004 )
+ 8000fa2: 699b ldr r3, [r3, #24]
+ 8000fa4: 4a17 ldr r2, [pc, #92] ; (8001004 )
+ 8000fa6: f043 0304 orr.w r3, r3, #4
+ 8000faa: 6193 str r3, [r2, #24]
+ 8000fac: 4b15 ldr r3, [pc, #84] ; (8001004 )
+ 8000fae: 699b ldr r3, [r3, #24]
+ 8000fb0: f003 0304 and.w r3, r3, #4
+ 8000fb4: 613b str r3, [r7, #16]
+ 8000fb6: 693b ldr r3, [r7, #16]
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ 8000fb8: 4b12 ldr r3, [pc, #72] ; (8001004 )
+ 8000fba: 699b ldr r3, [r3, #24]
+ 8000fbc: 4a11 ldr r2, [pc, #68] ; (8001004 )
+ 8000fbe: f043 0308 orr.w r3, r3, #8
+ 8000fc2: 6193 str r3, [r2, #24]
+ 8000fc4: 4b0f ldr r3, [pc, #60] ; (8001004 )
+ 8000fc6: 699b ldr r3, [r3, #24]
+ 8000fc8: f003 0308 and.w r3, r3, #8
+ 8000fcc: 60fb str r3, [r7, #12]
+ 8000fce: 68fb ldr r3, [r7, #12]
+ /**ADC1 GPIO Configuration
+ PA6 ------> ADC1_IN6
+ PB0 ------> ADC1_IN8
+ PB1 ------> ADC1_IN9
+ */
+ GPIO_InitStruct.Pin = ADC_CC1_Pin;
+ 8000fd0: 2340 movs r3, #64 ; 0x40
+ 8000fd2: 61bb str r3, [r7, #24]
+ GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
+ 8000fd4: 2303 movs r3, #3
+ 8000fd6: 61fb str r3, [r7, #28]
+ HAL_GPIO_Init(ADC_CC1_GPIO_Port, &GPIO_InitStruct);
+ 8000fd8: f107 0318 add.w r3, r7, #24
+ 8000fdc: 4619 mov r1, r3
+ 8000fde: 480a ldr r0, [pc, #40] ; (8001008 )
+ 8000fe0: f004 fc6c bl 80058bc
+
+ GPIO_InitStruct.Pin = ADC_NTC1_Pin|ADC_NTC2_Pin;
+ 8000fe4: 2303 movs r3, #3
+ 8000fe6: 61bb str r3, [r7, #24]
+ GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
+ 8000fe8: 2303 movs r3, #3
+ 8000fea: 61fb str r3, [r7, #28]
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+ 8000fec: f107 0318 add.w r3, r7, #24
+ 8000ff0: 4619 mov r1, r3
+ 8000ff2: 4806 ldr r0, [pc, #24] ; (800100c )
+ 8000ff4: f004 fc62 bl 80058bc
+
+ /* USER CODE BEGIN ADC1_MspInit 1 */
+
+ /* USER CODE END ADC1_MspInit 1 */
+ }
+}
+ 8000ff8: bf00 nop
+ 8000ffa: 3728 adds r7, #40 ; 0x28
+ 8000ffc: 46bd mov sp, r7
+ 8000ffe: bd80 pop {r7, pc}
+ 8001000: 40012400 .word 0x40012400
+ 8001004: 40021000 .word 0x40021000
+ 8001008: 40010800 .word 0x40010800
+ 800100c: 40010c00 .word 0x40010c00
+
+08001010 :
+//TEMP READ
+//LOCK_FB
+//GBT_TEMP_SENSORS
+//USB
+
+void GBT_Lock(uint8_t state){
+ 8001010: b580 push {r7, lr}
+ 8001012: b082 sub sp, #8
+ 8001014: af00 add r7, sp, #0
+ 8001016: 4603 mov r3, r0
+ 8001018: 71fb strb r3, [r7, #7]
+ if(state){//LOCK
+ 800101a: 79fb ldrb r3, [r7, #7]
+ 800101c: 2b00 cmp r3, #0
+ 800101e: d00d beq.n 800103c
+ HAL_GPIO_WritePin(LOCK_A_GPIO_Port, LOCK_A_Pin, 1);
+ 8001020: 2201 movs r2, #1
+ 8001022: 2110 movs r1, #16
+ 8001024: 480e ldr r0, [pc, #56] ; (8001060 )
+ 8001026: f004 fde4 bl 8005bf2
+ HAL_Delay(50);
+ 800102a: 2032 movs r0, #50 ; 0x32
+ 800102c: f002 fe22 bl 8003c74
+ HAL_GPIO_WritePin(LOCK_A_GPIO_Port, LOCK_A_Pin, 0);
+ 8001030: 2200 movs r2, #0
+ 8001032: 2110 movs r1, #16
+ 8001034: 480a ldr r0, [pc, #40] ; (8001060 )
+ 8001036: f004 fddc bl 8005bf2
+ }else{ //UNLOCK
+ HAL_GPIO_WritePin(LOCK_B_GPIO_Port, LOCK_B_Pin, 1);
+ HAL_Delay(50);
+ HAL_GPIO_WritePin(LOCK_B_GPIO_Port, LOCK_B_Pin, 0);
+ }
+}
+ 800103a: e00c b.n 8001056
+ HAL_GPIO_WritePin(LOCK_B_GPIO_Port, LOCK_B_Pin, 1);
+ 800103c: 2201 movs r2, #1
+ 800103e: 2120 movs r1, #32
+ 8001040: 4807 ldr r0, [pc, #28] ; (8001060 )
+ 8001042: f004 fdd6 bl 8005bf2
+ HAL_Delay(50);
+ 8001046: 2032 movs r0, #50 ; 0x32
+ 8001048: f002 fe14 bl 8003c74
+ HAL_GPIO_WritePin(LOCK_B_GPIO_Port, LOCK_B_Pin, 0);
+ 800104c: 2200 movs r2, #0
+ 800104e: 2120 movs r1, #32
+ 8001050: 4803 ldr r0, [pc, #12] ; (8001060 )
+ 8001052: f004 fdce bl 8005bf2
+}
+ 8001056: bf00 nop
+ 8001058: 3708 adds r7, #8
+ 800105a: 46bd mov sp, r7
+ 800105c: bd80 pop {r7, pc}
+ 800105e: bf00 nop
+ 8001060: 40011000 .word 0x40011000
+
+08001064 :
+uint8_t GBT_LockGetState(){
+ 8001064: b580 push {r7, lr}
+ 8001066: af00 add r7, sp, #0
+ return HAL_GPIO_ReadPin(LOCK_FB_GPIO_Port, LOCK_FB_Pin);
+ 8001068: f44f 7100 mov.w r1, #512 ; 0x200
+ 800106c: 4802 ldr r0, [pc, #8] ; (8001078 )
+ 800106e: f004 fda9 bl 8005bc4
+ 8001072: 4603 mov r3, r0
+
+}
+ 8001074: 4618 mov r0, r3
+ 8001076: bd80 pop {r7, pc}
+ 8001078: 40011800 .word 0x40011800
+
+0800107c :
+
+
+void RELAY_Write(relay_t num, uint8_t state){
+ 800107c: b580 push {r7, lr}
+ 800107e: b082 sub sp, #8
+ 8001080: af00 add r7, sp, #0
+ 8001082: 4603 mov r3, r0
+ 8001084: 460a mov r2, r1
+ 8001086: 71fb strb r3, [r7, #7]
+ 8001088: 4613 mov r3, r2
+ 800108a: 71bb strb r3, [r7, #6]
+ if(num==RELAY_AUX)HAL_GPIO_WritePin(RELAY_AUX_GPIO_Port, RELAY_AUX_Pin, state);
+ 800108c: 79fb ldrb r3, [r7, #7]
+ 800108e: 2b00 cmp r3, #0
+ 8001090: d105 bne.n 800109e
+ 8001092: 79bb ldrb r3, [r7, #6]
+ 8001094: 461a mov r2, r3
+ 8001096: 2110 movs r1, #16
+ 8001098: 4808 ldr r0, [pc, #32] ; (80010bc )
+ 800109a: f004 fdaa bl 8005bf2
+ if(num==RELAY_CC)HAL_GPIO_WritePin(RELAY_CC_GPIO_Port, RELAY_CC_Pin, state);
+ 800109e: 79fb ldrb r3, [r7, #7]
+ 80010a0: 2b01 cmp r3, #1
+ 80010a2: d106 bne.n 80010b2
+ 80010a4: 79bb ldrb r3, [r7, #6]
+ 80010a6: 461a mov r2, r3
+ 80010a8: f44f 4100 mov.w r1, #32768 ; 0x8000
+ 80010ac: 4804 ldr r0, [pc, #16] ; (80010c0 )
+ 80010ae: f004 fda0 bl 8005bf2
+
+}
+ 80010b2: bf00 nop
+ 80010b4: 3708 adds r7, #8
+ 80010b6: 46bd mov sp, r7
+ 80010b8: bd80 pop {r7, pc}
+ 80010ba: bf00 nop
+ 80010bc: 40010c00 .word 0x40010c00
+ 80010c0: 40011800 .word 0x40011800
+
+080010c4 :
+//
+// HAL_ADC_Stop(&hadc1); // stop adc
+ return 0;
+}
+
+void Init_Peripheral(){
+ 80010c4: b580 push {r7, lr}
+ 80010c6: af00 add r7, sp, #0
+ HAL_ADCEx_Calibration_Start(&hadc1);
+ 80010c8: 4806 ldr r0, [pc, #24] ; (80010e4 )
+ 80010ca: f003 fa4f bl 800456c
+ RELAY_Write(RELAY_AUX, 0);
+ 80010ce: 2100 movs r1, #0
+ 80010d0: 2000 movs r0, #0
+ 80010d2: f7ff ffd3 bl 800107c
+ RELAY_Write(RELAY_CC, 1);
+ 80010d6: 2101 movs r1, #1
+ 80010d8: 2001 movs r0, #1
+ 80010da: f7ff ffcf bl 800107c
+
+}
+ 80010de: bf00 nop
+ 80010e0: bd80 pop {r7, pc}
+ 80010e2: bf00 nop
+ 80010e4: 2000008c .word 0x2000008c
+
+080010e8 :
+uint8_t GBT_ReadTemp(){
+ //TODO
+ return 0;
+}
+
+void ADC_Select_Channel(uint32_t ch) {
+ 80010e8: b580 push {r7, lr}
+ 80010ea: b086 sub sp, #24
+ 80010ec: af00 add r7, sp, #0
+ 80010ee: 6078 str r0, [r7, #4]
+ ADC_ChannelConfTypeDef conf = {
+ 80010f0: 687b ldr r3, [r7, #4]
+ 80010f2: 60fb str r3, [r7, #12]
+ 80010f4: 2301 movs r3, #1
+ 80010f6: 613b str r3, [r7, #16]
+ 80010f8: 2303 movs r3, #3
+ 80010fa: 617b str r3, [r7, #20]
+ .Channel = ch,
+ .Rank = 1,
+ .SamplingTime = ADC_SAMPLETIME_28CYCLES_5,
+ };
+ if (HAL_ADC_ConfigChannel(&hadc1, &conf) != HAL_OK) {
+ 80010fc: f107 030c add.w r3, r7, #12
+ 8001100: 4619 mov r1, r3
+ 8001102: 4806 ldr r0, [pc, #24] ; (800111c )
+ 8001104: f003 f89e bl 8004244
+ 8001108: 4603 mov r3, r0
+ 800110a: 2b00 cmp r3, #0
+ 800110c: d001 beq.n 8001112
+ Error_Handler();
+ 800110e: f002 fa57 bl 80035c0
+ }
+}
+ 8001112: bf00 nop
+ 8001114: 3718 adds r7, #24
+ 8001116: 46bd mov sp, r7
+ 8001118: bd80 pop {r7, pc}
+ 800111a: bf00 nop
+ 800111c: 2000008c .word 0x2000008c
+
+08001120 :
+CAN_HandleTypeDef hcan1;
+CAN_HandleTypeDef hcan2;
+
+/* CAN1 init function */
+void MX_CAN1_Init(void)
+{
+ 8001120: b580 push {r7, lr}
+ 8001122: af00 add r7, sp, #0
+ /* USER CODE END CAN1_Init 0 */
+
+ /* USER CODE BEGIN CAN1_Init 1 */
+
+ /* USER CODE END CAN1_Init 1 */
+ hcan1.Instance = CAN1;
+ 8001124: 4b17 ldr r3, [pc, #92] ; (8001184 )
+ 8001126: 4a18 ldr r2, [pc, #96] ; (8001188 )
+ 8001128: 601a str r2, [r3, #0]
+ hcan1.Init.Prescaler = 8;
+ 800112a: 4b16 ldr r3, [pc, #88] ; (8001184 )
+ 800112c: 2208 movs r2, #8
+ 800112e: 605a str r2, [r3, #4]
+ hcan1.Init.Mode = CAN_MODE_NORMAL;
+ 8001130: 4b14 ldr r3, [pc, #80] ; (8001184 )
+ 8001132: 2200 movs r2, #0
+ 8001134: 609a str r2, [r3, #8]
+ hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
+ 8001136: 4b13 ldr r3, [pc, #76] ; (8001184 )
+ 8001138: 2200 movs r2, #0
+ 800113a: 60da str r2, [r3, #12]
+ hcan1.Init.TimeSeg1 = CAN_BS1_15TQ;
+ 800113c: 4b11 ldr r3, [pc, #68] ; (8001184 )
+ 800113e: f44f 2260 mov.w r2, #917504 ; 0xe0000
+ 8001142: 611a str r2, [r3, #16]
+ hcan1.Init.TimeSeg2 = CAN_BS2_2TQ;
+ 8001144: 4b0f ldr r3, [pc, #60] ; (8001184 )
+ 8001146: f44f 1280 mov.w r2, #1048576 ; 0x100000
+ 800114a: 615a str r2, [r3, #20]
+ hcan1.Init.TimeTriggeredMode = DISABLE;
+ 800114c: 4b0d ldr r3, [pc, #52] ; (8001184 )
+ 800114e: 2200 movs r2, #0
+ 8001150: 761a strb r2, [r3, #24]
+ hcan1.Init.AutoBusOff = ENABLE;
+ 8001152: 4b0c ldr r3, [pc, #48] ; (8001184 )
+ 8001154: 2201 movs r2, #1
+ 8001156: 765a strb r2, [r3, #25]
+ hcan1.Init.AutoWakeUp = ENABLE;
+ 8001158: 4b0a ldr r3, [pc, #40] ; (8001184 )
+ 800115a: 2201 movs r2, #1
+ 800115c: 769a strb r2, [r3, #26]
+ hcan1.Init.AutoRetransmission = DISABLE;
+ 800115e: 4b09 ldr r3, [pc, #36] ; (8001184 )
+ 8001160: 2200 movs r2, #0
+ 8001162: 76da strb r2, [r3, #27]
+ hcan1.Init.ReceiveFifoLocked = DISABLE;
+ 8001164: 4b07 ldr r3, [pc, #28] ; (8001184 )
+ 8001166: 2200 movs r2, #0
+ 8001168: 771a strb r2, [r3, #28]
+ hcan1.Init.TransmitFifoPriority = ENABLE;
+ 800116a: 4b06 ldr r3, [pc, #24] ; (8001184 )
+ 800116c: 2201 movs r2, #1
+ 800116e: 775a strb r2, [r3, #29]
+ if (HAL_CAN_Init(&hcan1) != HAL_OK)
+ 8001170: 4804 ldr r0, [pc, #16] ; (8001184 )
+ 8001172: f003 faa7 bl 80046c4
+ 8001176: 4603 mov r3, r0
+ 8001178: 2b00 cmp r3, #0
+ 800117a: d001 beq.n 8001180
+ {
+ Error_Handler();
+ 800117c: f002 fa20 bl 80035c0
+ }
+ /* USER CODE BEGIN CAN1_Init 2 */
+
+ /* USER CODE END CAN1_Init 2 */
+
+}
+ 8001180: bf00 nop
+ 8001182: bd80 pop {r7, pc}
+ 8001184: 200000bc .word 0x200000bc
+ 8001188: 40006400 .word 0x40006400
+
+0800118c :
+/* CAN2 init function */
+void MX_CAN2_Init(void)
+{
+ 800118c: b580 push {r7, lr}
+ 800118e: af00 add r7, sp, #0
+ /* USER CODE END CAN2_Init 0 */
+
+ /* USER CODE BEGIN CAN2_Init 1 */
+
+ /* USER CODE END CAN2_Init 1 */
+ hcan2.Instance = CAN2;
+ 8001190: 4b17 ldr r3, [pc, #92] ; (80011f0 )
+ 8001192: 4a18 ldr r2, [pc, #96] ; (80011f4 )
+ 8001194: 601a str r2, [r3, #0]
+ hcan2.Init.Prescaler = 16;
+ 8001196: 4b16 ldr r3, [pc, #88] ; (80011f0 )
+ 8001198: 2210 movs r2, #16
+ 800119a: 605a str r2, [r3, #4]
+ hcan2.Init.Mode = CAN_MODE_NORMAL;
+ 800119c: 4b14 ldr r3, [pc, #80] ; (80011f0 )
+ 800119e: 2200 movs r2, #0
+ 80011a0: 609a str r2, [r3, #8]
+ hcan2.Init.SyncJumpWidth = CAN_SJW_1TQ;
+ 80011a2: 4b13 ldr r3, [pc, #76] ; (80011f0 )
+ 80011a4: 2200 movs r2, #0
+ 80011a6: 60da str r2, [r3, #12]
+ hcan2.Init.TimeSeg1 = CAN_BS1_15TQ;
+ 80011a8: 4b11 ldr r3, [pc, #68] ; (80011f0 )
+ 80011aa: f44f 2260 mov.w r2, #917504 ; 0xe0000
+ 80011ae: 611a str r2, [r3, #16]
+ hcan2.Init.TimeSeg2 = CAN_BS2_2TQ;
+ 80011b0: 4b0f ldr r3, [pc, #60] ; (80011f0 )
+ 80011b2: f44f 1280 mov.w r2, #1048576 ; 0x100000
+ 80011b6: 615a str r2, [r3, #20]
+ hcan2.Init.TimeTriggeredMode = DISABLE;
+ 80011b8: 4b0d ldr r3, [pc, #52] ; (80011f0 )
+ 80011ba: 2200 movs r2, #0
+ 80011bc: 761a strb r2, [r3, #24]
+ hcan2.Init.AutoBusOff = ENABLE;
+ 80011be: 4b0c ldr r3, [pc, #48] ; (80011f0 )
+ 80011c0: 2201 movs r2, #1
+ 80011c2: 765a strb r2, [r3, #25]
+ hcan2.Init.AutoWakeUp = ENABLE;
+ 80011c4: 4b0a ldr r3, [pc, #40] ; (80011f0 )
+ 80011c6: 2201 movs r2, #1
+ 80011c8: 769a strb r2, [r3, #26]
+ hcan2.Init.AutoRetransmission = DISABLE;
+ 80011ca: 4b09 ldr r3, [pc, #36] ; (80011f0 )
+ 80011cc: 2200 movs r2, #0
+ 80011ce: 76da strb r2, [r3, #27]
+ hcan2.Init.ReceiveFifoLocked = DISABLE;
+ 80011d0: 4b07 ldr r3, [pc, #28] ; (80011f0 )
+ 80011d2: 2200 movs r2, #0
+ 80011d4: 771a strb r2, [r3, #28]
+ hcan2.Init.TransmitFifoPriority = ENABLE;
+ 80011d6: 4b06 ldr r3, [pc, #24] ; (80011f0 )
+ 80011d8: 2201 movs r2, #1
+ 80011da: 775a strb r2, [r3, #29]
+ if (HAL_CAN_Init(&hcan2) != HAL_OK)
+ 80011dc: 4804 ldr r0, [pc, #16] ; (80011f0 )
+ 80011de: f003 fa71 bl 80046c4
+ 80011e2: 4603 mov r3, r0
+ 80011e4: 2b00 cmp r3, #0
+ 80011e6: d001 beq.n 80011ec
+ {
+ Error_Handler();
+ 80011e8: f002 f9ea bl 80035c0
+ }
+ /* USER CODE BEGIN CAN2_Init 2 */
+
+ /* USER CODE END CAN2_Init 2 */
+
+}
+ 80011ec: bf00 nop
+ 80011ee: bd80 pop {r7, pc}
+ 80011f0: 200000e4 .word 0x200000e4
+ 80011f4: 40006800 .word 0x40006800
+
+080011f8 :
+
+static uint32_t HAL_RCC_CAN1_CLK_ENABLED=0;
+
+void HAL_CAN_MspInit(CAN_HandleTypeDef* canHandle)
+{
+ 80011f8: b580 push {r7, lr}
+ 80011fa: b08e sub sp, #56 ; 0x38
+ 80011fc: af00 add r7, sp, #0
+ 80011fe: 6078 str r0, [r7, #4]
+
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ 8001200: f107 0320 add.w r3, r7, #32
+ 8001204: 2200 movs r2, #0
+ 8001206: 601a str r2, [r3, #0]
+ 8001208: 605a str r2, [r3, #4]
+ 800120a: 609a str r2, [r3, #8]
+ 800120c: 60da str r2, [r3, #12]
+ if(canHandle->Instance==CAN1)
+ 800120e: 687b ldr r3, [r7, #4]
+ 8001210: 681b ldr r3, [r3, #0]
+ 8001212: 4a61 ldr r2, [pc, #388] ; (8001398 )
+ 8001214: 4293 cmp r3, r2
+ 8001216: d153 bne.n 80012c0
+ {
+ /* USER CODE BEGIN CAN1_MspInit 0 */
+
+ /* USER CODE END CAN1_MspInit 0 */
+ /* CAN1 clock enable */
+ HAL_RCC_CAN1_CLK_ENABLED++;
+ 8001218: 4b60 ldr r3, [pc, #384] ; (800139c )
+ 800121a: 681b ldr r3, [r3, #0]
+ 800121c: 3301 adds r3, #1
+ 800121e: 4a5f ldr r2, [pc, #380] ; (800139c )
+ 8001220: 6013 str r3, [r2, #0]
+ if(HAL_RCC_CAN1_CLK_ENABLED==1){
+ 8001222: 4b5e ldr r3, [pc, #376] ; (800139c )
+ 8001224: 681b ldr r3, [r3, #0]
+ 8001226: 2b01 cmp r3, #1
+ 8001228: d10b bne.n 8001242
+ __HAL_RCC_CAN1_CLK_ENABLE();
+ 800122a: 4b5d ldr r3, [pc, #372] ; (80013a0 )
+ 800122c: 69db ldr r3, [r3, #28]
+ 800122e: 4a5c ldr r2, [pc, #368] ; (80013a0 )
+ 8001230: f043 7300 orr.w r3, r3, #33554432 ; 0x2000000
+ 8001234: 61d3 str r3, [r2, #28]
+ 8001236: 4b5a ldr r3, [pc, #360] ; (80013a0 )
+ 8001238: 69db ldr r3, [r3, #28]
+ 800123a: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
+ 800123e: 61fb str r3, [r7, #28]
+ 8001240: 69fb ldr r3, [r7, #28]
+ }
+
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+ 8001242: 4b57 ldr r3, [pc, #348] ; (80013a0 )
+ 8001244: 699b ldr r3, [r3, #24]
+ 8001246: 4a56 ldr r2, [pc, #344] ; (80013a0 )
+ 8001248: f043 0320 orr.w r3, r3, #32
+ 800124c: 6193 str r3, [r2, #24]
+ 800124e: 4b54 ldr r3, [pc, #336] ; (80013a0 )
+ 8001250: 699b ldr r3, [r3, #24]
+ 8001252: f003 0320 and.w r3, r3, #32
+ 8001256: 61bb str r3, [r7, #24]
+ 8001258: 69bb ldr r3, [r7, #24]
+ /**CAN1 GPIO Configuration
+ PD0 ------> CAN1_RX
+ PD1 ------> CAN1_TX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_0;
+ 800125a: 2301 movs r3, #1
+ 800125c: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ 800125e: 2300 movs r3, #0
+ 8001260: 627b str r3, [r7, #36] ; 0x24
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 8001262: 2300 movs r3, #0
+ 8001264: 62bb str r3, [r7, #40] ; 0x28
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+ 8001266: f107 0320 add.w r3, r7, #32
+ 800126a: 4619 mov r1, r3
+ 800126c: 484d ldr r0, [pc, #308] ; (80013a4 )
+ 800126e: f004 fb25 bl 80058bc
+
+ GPIO_InitStruct.Pin = GPIO_PIN_1;
+ 8001272: 2302 movs r3, #2
+ 8001274: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ 8001276: 2302 movs r3, #2
+ 8001278: 627b str r3, [r7, #36] ; 0x24
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ 800127a: 2303 movs r3, #3
+ 800127c: 62fb str r3, [r7, #44] ; 0x2c
+ HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
+ 800127e: f107 0320 add.w r3, r7, #32
+ 8001282: 4619 mov r1, r3
+ 8001284: 4847 ldr r0, [pc, #284] ; (80013a4 )
+ 8001286: f004 fb19 bl 80058bc
+
+ __HAL_AFIO_REMAP_CAN1_3();
+ 800128a: 4b47 ldr r3, [pc, #284] ; (80013a8 )
+ 800128c: 685b ldr r3, [r3, #4]
+ 800128e: 633b str r3, [r7, #48] ; 0x30
+ 8001290: 6b3b ldr r3, [r7, #48] ; 0x30
+ 8001292: f423 43c0 bic.w r3, r3, #24576 ; 0x6000
+ 8001296: 633b str r3, [r7, #48] ; 0x30
+ 8001298: 6b3b ldr r3, [r7, #48] ; 0x30
+ 800129a: f043 63e0 orr.w r3, r3, #117440512 ; 0x7000000
+ 800129e: 633b str r3, [r7, #48] ; 0x30
+ 80012a0: 6b3b ldr r3, [r7, #48] ; 0x30
+ 80012a2: f443 43c0 orr.w r3, r3, #24576 ; 0x6000
+ 80012a6: 633b str r3, [r7, #48] ; 0x30
+ 80012a8: 4a3f ldr r2, [pc, #252] ; (80013a8 )
+ 80012aa: 6b3b ldr r3, [r7, #48] ; 0x30
+ 80012ac: 6053 str r3, [r2, #4]
+
+ /* CAN1 interrupt Init */
+ HAL_NVIC_SetPriority(CAN1_RX0_IRQn, 0, 0);
+ 80012ae: 2200 movs r2, #0
+ 80012b0: 2100 movs r1, #0
+ 80012b2: 2014 movs r0, #20
+ 80012b4: f004 f989 bl 80055ca
+ HAL_NVIC_EnableIRQ(CAN1_RX0_IRQn);
+ 80012b8: 2014 movs r0, #20
+ 80012ba: f004 f9a2 bl 8005602
+ HAL_NVIC_EnableIRQ(CAN2_RX1_IRQn);
+ /* USER CODE BEGIN CAN2_MspInit 1 */
+
+ /* USER CODE END CAN2_MspInit 1 */
+ }
+}
+ 80012be: e067 b.n 8001390
+ else if(canHandle->Instance==CAN2)
+ 80012c0: 687b ldr r3, [r7, #4]
+ 80012c2: 681b ldr r3, [r3, #0]
+ 80012c4: 4a39 ldr r2, [pc, #228] ; (80013ac )
+ 80012c6: 4293 cmp r3, r2
+ 80012c8: d162 bne.n 8001390
+ __HAL_RCC_CAN2_CLK_ENABLE();
+ 80012ca: 4b35 ldr r3, [pc, #212] ; (80013a0 )
+ 80012cc: 69db ldr r3, [r3, #28]
+ 80012ce: 4a34 ldr r2, [pc, #208] ; (80013a0 )
+ 80012d0: f043 6380 orr.w r3, r3, #67108864 ; 0x4000000
+ 80012d4: 61d3 str r3, [r2, #28]
+ 80012d6: 4b32 ldr r3, [pc, #200] ; (80013a0 )
+ 80012d8: 69db ldr r3, [r3, #28]
+ 80012da: f003 6380 and.w r3, r3, #67108864 ; 0x4000000
+ 80012de: 617b str r3, [r7, #20]
+ 80012e0: 697b ldr r3, [r7, #20]
+ HAL_RCC_CAN1_CLK_ENABLED++;
+ 80012e2: 4b2e ldr r3, [pc, #184] ; (800139c )
+ 80012e4: 681b ldr r3, [r3, #0]
+ 80012e6: 3301 adds r3, #1
+ 80012e8: 4a2c ldr r2, [pc, #176] ; (800139c )
+ 80012ea: 6013 str r3, [r2, #0]
+ if(HAL_RCC_CAN1_CLK_ENABLED==1){
+ 80012ec: 4b2b ldr r3, [pc, #172] ; (800139c )
+ 80012ee: 681b ldr r3, [r3, #0]
+ 80012f0: 2b01 cmp r3, #1
+ 80012f2: d10b bne.n 800130c
+ __HAL_RCC_CAN1_CLK_ENABLE();
+ 80012f4: 4b2a ldr r3, [pc, #168] ; (80013a0 )
+ 80012f6: 69db ldr r3, [r3, #28]
+ 80012f8: 4a29 ldr r2, [pc, #164] ; (80013a0 )
+ 80012fa: f043 7300 orr.w r3, r3, #33554432 ; 0x2000000
+ 80012fe: 61d3 str r3, [r2, #28]
+ 8001300: 4b27 ldr r3, [pc, #156] ; (80013a0 )
+ 8001302: 69db ldr r3, [r3, #28]
+ 8001304: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
+ 8001308: 613b str r3, [r7, #16]
+ 800130a: 693b ldr r3, [r7, #16]
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ 800130c: 4b24 ldr r3, [pc, #144] ; (80013a0 )
+ 800130e: 699b ldr r3, [r3, #24]
+ 8001310: 4a23 ldr r2, [pc, #140] ; (80013a0 )
+ 8001312: f043 0308 orr.w r3, r3, #8
+ 8001316: 6193 str r3, [r2, #24]
+ 8001318: 4b21 ldr r3, [pc, #132] ; (80013a0 )
+ 800131a: 699b ldr r3, [r3, #24]
+ 800131c: f003 0308 and.w r3, r3, #8
+ 8001320: 60fb str r3, [r7, #12]
+ 8001322: 68fb ldr r3, [r7, #12]
+ GPIO_InitStruct.Pin = GPIO_PIN_5;
+ 8001324: 2320 movs r3, #32
+ 8001326: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ 8001328: 2300 movs r3, #0
+ 800132a: 627b str r3, [r7, #36] ; 0x24
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ 800132c: 2300 movs r3, #0
+ 800132e: 62bb str r3, [r7, #40] ; 0x28
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+ 8001330: f107 0320 add.w r3, r7, #32
+ 8001334: 4619 mov r1, r3
+ 8001336: 481e ldr r0, [pc, #120] ; (80013b0 )
+ 8001338: f004 fac0 bl 80058bc
+ GPIO_InitStruct.Pin = GPIO_PIN_6;
+ 800133c: 2340 movs r3, #64 ; 0x40
+ 800133e: 623b str r3, [r7, #32]
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ 8001340: 2302 movs r3, #2
+ 8001342: 627b str r3, [r7, #36] ; 0x24
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ 8001344: 2303 movs r3, #3
+ 8001346: 62fb str r3, [r7, #44] ; 0x2c
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+ 8001348: f107 0320 add.w r3, r7, #32
+ 800134c: 4619 mov r1, r3
+ 800134e: 4818 ldr r0, [pc, #96] ; (80013b0 )
+ 8001350: f004 fab4 bl 80058bc
+ __HAL_AFIO_REMAP_CAN2_ENABLE();
+ 8001354: 4b14 ldr r3, [pc, #80] ; (80013a8 )
+ 8001356: 685b ldr r3, [r3, #4]
+ 8001358: 637b str r3, [r7, #52] ; 0x34
+ 800135a: 6b7b ldr r3, [r7, #52] ; 0x34
+ 800135c: f043 63e0 orr.w r3, r3, #117440512 ; 0x7000000
+ 8001360: 637b str r3, [r7, #52] ; 0x34
+ 8001362: 6b7b ldr r3, [r7, #52] ; 0x34
+ 8001364: f443 0380 orr.w r3, r3, #4194304 ; 0x400000
+ 8001368: 637b str r3, [r7, #52] ; 0x34
+ 800136a: 4a0f ldr r2, [pc, #60] ; (80013a8 )
+ 800136c: 6b7b ldr r3, [r7, #52] ; 0x34
+ 800136e: 6053 str r3, [r2, #4]
+ HAL_NVIC_SetPriority(CAN2_TX_IRQn, 0, 0);
+ 8001370: 2200 movs r2, #0
+ 8001372: 2100 movs r1, #0
+ 8001374: 203f movs r0, #63 ; 0x3f
+ 8001376: f004 f928 bl 80055ca
+ HAL_NVIC_EnableIRQ(CAN2_TX_IRQn);
+ 800137a: 203f movs r0, #63 ; 0x3f
+ 800137c: f004 f941 bl 8005602
+ HAL_NVIC_SetPriority(CAN2_RX1_IRQn, 0, 0);
+ 8001380: 2200 movs r2, #0
+ 8001382: 2100 movs r1, #0
+ 8001384: 2041 movs r0, #65 ; 0x41
+ 8001386: f004 f920 bl 80055ca
+ HAL_NVIC_EnableIRQ(CAN2_RX1_IRQn);
+ 800138a: 2041 movs r0, #65 ; 0x41
+ 800138c: f004 f939 bl 8005602
+}
+ 8001390: bf00 nop
+ 8001392: 3738 adds r7, #56 ; 0x38
+ 8001394: 46bd mov sp, r7
+ 8001396: bd80 pop {r7, pc}
+ 8001398: 40006400 .word 0x40006400
+ 800139c: 2000010c .word 0x2000010c
+ 80013a0: 40021000 .word 0x40021000
+ 80013a4: 40011400 .word 0x40011400
+ 80013a8: 40010000 .word 0x40010000
+ 80013ac: 40006800 .word 0x40006800
+ 80013b0: 40010c00 .word 0x40010c00
+
+080013b4 :
+uint8_t GBT_BRO;
+
+extern GBT_EDCAN_Output_t GBT_EDCAN_Output;
+
+
+void GBT_Init(){
+ 80013b4: b580 push {r7, lr}
+ 80013b6: af00 add r7, sp, #0
+ GBT_State = GBT_DISABLED;
+ 80013b8: 4b03 ldr r3, [pc, #12] ; (80013c8 )
+ 80013ba: 2200 movs r2, #0
+ 80013bc: 701a strb r2, [r3, #0]
+ GBT_Lock(0);
+ 80013be: 2000 movs r0, #0
+ 80013c0: f7ff fe26 bl 8001010
+}
+ 80013c4: bf00 nop
+ 80013c6: bd80 pop {r7, pc}
+ 80013c8: 20000110 .word 0x20000110
+
+080013cc :
+
+uint8_t GBT_CC_GetState(){
+ 80013cc: b580 push {r7, lr}
+ 80013ce: b082 sub sp, #8
+ 80013d0: af00 add r7, sp, #0
+ //Vin*k= 1.09v
+ //12vin = 1353 ADC
+//TODO: Filter 100ms
+ uint32_t adc;
+ float volt;
+ ADC_Select_Channel(ADC_CHANNEL_6);
+ 80013d2: 2006 movs r0, #6
+ 80013d4: f7ff fe88 bl 80010e8
+ HAL_ADC_Start(&hadc1);
+ 80013d8: 482e ldr r0, [pc, #184] ; (8001494 )
+ 80013da: f002 fd47 bl 8003e6c
+ HAL_ADC_PollForConversion(&hadc1, 100);
+ 80013de: 2164 movs r1, #100 ; 0x64
+ 80013e0: 482c ldr r0, [pc, #176] ; (8001494 )
+ 80013e2: f002 fe1d bl 8004020
+ adc = HAL_ADC_GetValue(&hadc1);
+ 80013e6: 482b ldr r0, [pc, #172] ; (8001494 )
+ 80013e8: f002 ff20 bl 800422c
+ 80013ec: 6078 str r0, [r7, #4]
+ HAL_ADC_Stop(&hadc1);
+ 80013ee: 4829 ldr r0, [pc, #164] ; (8001494 )
+ 80013f0: f002 fdea bl 8003fc8
+
+ volt = (float)adc/113.4f;
+ 80013f4: 6878 ldr r0, [r7, #4]
+ 80013f6: f7ff f987 bl 8000708 <__aeabi_ui2f>
+ 80013fa: 4603 mov r3, r0
+ 80013fc: 4926 ldr r1, [pc, #152] ; (8001498 )
+ 80013fe: 4618 mov r0, r3
+ 8001400: f7ff fa8e bl 8000920 <__aeabi_fdiv>
+ 8001404: 4603 mov r3, r0
+ 8001406: 603b str r3, [r7, #0]
+ if((volt<12.6f) && (volt>11.4f)) return GBT_CC_12V;
+ 8001408: 4924 ldr r1, [pc, #144] ; (800149c )
+ 800140a: 6838 ldr r0, [r7, #0]
+ 800140c: f7ff fb72 bl 8000af4 <__aeabi_fcmplt>
+ 8001410: 4603 mov r3, r0
+ 8001412: 2b00 cmp r3, #0
+ 8001414: d008 beq.n 8001428
+ 8001416: 4922 ldr r1, [pc, #136] ; (80014a0 )
+ 8001418: 6838 ldr r0, [r7, #0]
+ 800141a: f7ff fb89 bl 8000b30 <__aeabi_fcmpgt>
+ 800141e: 4603 mov r3, r0
+ 8001420: 2b00 cmp r3, #0
+ 8001422: d001 beq.n 8001428
+ 8001424: 2301 movs r3, #1
+ 8001426: e030 b.n 800148a
+ if((volt<6.8f) && (volt>5.2f)) return GBT_CC_6V;
+ 8001428: 491e ldr r1, [pc, #120] ; (80014a4 )
+ 800142a: 6838 ldr r0, [r7, #0]
+ 800142c: f7ff fb62 bl 8000af4 <__aeabi_fcmplt>
+ 8001430: 4603 mov r3, r0
+ 8001432: 2b00 cmp r3, #0
+ 8001434: d008 beq.n 8001448
+ 8001436: 491c ldr r1, [pc, #112] ; (80014a8 )
+ 8001438: 6838 ldr r0, [r7, #0]
+ 800143a: f7ff fb79 bl 8000b30 <__aeabi_fcmpgt>
+ 800143e: 4603 mov r3, r0
+ 8001440: 2b00 cmp r3, #0
+ 8001442: d001 beq.n 8001448
+ 8001444: 2302 movs r3, #2
+ 8001446: e020 b.n 800148a
+ if((volt<4.8f) && (volt>3.2f)) return GBT_CC_4V;
+ 8001448: 4918 ldr r1, [pc, #96] ; (80014ac )
+ 800144a: 6838 ldr r0, [r7, #0]
+ 800144c: f7ff fb52 bl 8000af4 <__aeabi_fcmplt>
+ 8001450: 4603 mov r3, r0
+ 8001452: 2b00 cmp r3, #0
+ 8001454: d008 beq.n 8001468
+ 8001456: 4916 ldr r1, [pc, #88] ; (80014b0 )
+ 8001458: 6838 ldr r0, [r7, #0]
+ 800145a: f7ff fb69 bl 8000b30 <__aeabi_fcmpgt>
+ 800145e: 4603 mov r3, r0
+ 8001460: 2b00 cmp r3, #0
+ 8001462: d001 beq.n 8001468
+ 8001464: 2303 movs r3, #3
+ 8001466: e010 b.n 800148a
+ if((volt<2.8f) && (volt>1.2f)) return GBT_CC_2V;
+ 8001468: 4912 ldr r1, [pc, #72] ; (80014b4 )
+ 800146a: 6838 ldr r0, [r7, #0]
+ 800146c: f7ff fb42 bl 8000af4 <__aeabi_fcmplt>
+ 8001470: 4603 mov r3, r0
+ 8001472: 2b00 cmp r3, #0
+ 8001474: d008 beq.n 8001488
+ 8001476: 4910 ldr r1, [pc, #64] ; (80014b8 )
+ 8001478: 6838 ldr r0, [r7, #0]
+ 800147a: f7ff fb59 bl 8000b30 <__aeabi_fcmpgt>
+ 800147e: 4603 mov r3, r0
+ 8001480: 2b00 cmp r3, #0
+ 8001482: d001 beq.n 8001488
+ 8001484: 2304 movs r3, #4
+ 8001486: e000 b.n 800148a
+ return GBT_CC_UNKNOWN;
+ 8001488: 2300 movs r3, #0
+}
+ 800148a: 4618 mov r0, r3
+ 800148c: 3708 adds r7, #8
+ 800148e: 46bd mov sp, r7
+ 8001490: bd80 pop {r7, pc}
+ 8001492: bf00 nop
+ 8001494: 2000008c .word 0x2000008c
+ 8001498: 42e2cccd .word 0x42e2cccd
+ 800149c: 4149999a .word 0x4149999a
+ 80014a0: 41366666 .word 0x41366666
+ 80014a4: 40d9999a .word 0x40d9999a
+ 80014a8: 40a66666 .word 0x40a66666
+ 80014ac: 4099999a .word 0x4099999a
+ 80014b0: 404ccccd .word 0x404ccccd
+ 80014b4: 40333333 .word 0x40333333
+ 80014b8: 3f99999a .word 0x3f99999a
+
+080014bc :
+
+float GBT_CC_GetAdc(){
+ 80014bc: b580 push {r7, lr}
+ 80014be: b082 sub sp, #8
+ 80014c0: af00 add r7, sp, #0
+ //Vin*k= 1.09v
+ //12vin = 1353 ADC
+
+ uint32_t adc;
+ float volt;
+ ADC_Select_Channel(ADC_CHANNEL_6);
+ 80014c2: 2006 movs r0, #6
+ 80014c4: f7ff fe10 bl 80010e8
+ HAL_ADC_Start(&hadc1);
+ 80014c8: 480e ldr r0, [pc, #56] ; (8001504 )
+ 80014ca: f002 fccf bl 8003e6c
+ HAL_ADC_PollForConversion(&hadc1, 100);
+ 80014ce: 2164 movs r1, #100 ; 0x64
+ 80014d0: 480c ldr r0, [pc, #48] ; (8001504 )
+ 80014d2: f002 fda5 bl 8004020
+ adc = HAL_ADC_GetValue(&hadc1);
+ 80014d6: 480b ldr r0, [pc, #44] ; (8001504 )
+ 80014d8: f002 fea8 bl 800422c
+ 80014dc: 6078 str r0, [r7, #4]
+ HAL_ADC_Stop(&hadc1);
+ 80014de: 4809 ldr r0, [pc, #36] ; (8001504 )
+ 80014e0: f002 fd72 bl 8003fc8
+
+ volt = (float)adc/113.4f;
+ 80014e4: 6878 ldr r0, [r7, #4]
+ 80014e6: f7ff f90f bl 8000708 <__aeabi_ui2f>
+ 80014ea: 4603 mov r3, r0
+ 80014ec: 4906 ldr r1, [pc, #24] ; (8001508 )
+ 80014ee: 4618 mov r0, r3
+ 80014f0: f7ff fa16 bl 8000920 <__aeabi_fdiv>
+ 80014f4: 4603 mov r3, r0
+ 80014f6: 603b str r3, [r7, #0]
+
+ return volt;
+ 80014f8: 683b ldr r3, [r7, #0]
+}
+ 80014fa: 4618 mov r0, r3
+ 80014fc: 3708 adds r7, #8
+ 80014fe: 46bd mov sp, r7
+ 8001500: bd80 pop {r7, pc}
+ 8001502: bf00 nop
+ 8001504: 2000008c .word 0x2000008c
+ 8001508: 42e2cccd .word 0x42e2cccd
+
+0800150c :
+
+void GBT_ChargerTask(){
+ 800150c: b5b0 push {r4, r5, r7, lr}
+ 800150e: b082 sub sp, #8
+ 8001510: af00 add r7, sp, #0
+
+ if(j_rx.state == 2){
+ 8001512: 4bae ldr r3, [pc, #696] ; (80017cc )
+ 8001514: f893 310a ldrb.w r3, [r3, #266] ; 0x10a
+ 8001518: 2b02 cmp r3, #2
+ 800151a: f040 80b9 bne.w 8001690
+ switch (j_rx.PGN){
+ 800151e: 4bab ldr r3, [pc, #684] ; (80017cc )
+ 8001520: f8d3 3100 ldr.w r3, [r3, #256] ; 0x100
+ 8001524: f5b3 5f1c cmp.w r3, #9984 ; 0x2700
+ 8001528: d03c beq.n 80015a4
+ 800152a: f5b3 5f1c cmp.w r3, #9984 ; 0x2700
+ 800152e: f200 80ab bhi.w 8001688
+ 8001532: f5b3 5fb8 cmp.w r3, #5888 ; 0x1700
+ 8001536: f000 80a2 beq.w 800167e
+ 800153a: f5b3 5fb8 cmp.w r3, #5888 ; 0x1700
+ 800153e: f200 80a3 bhi.w 8001688
+ 8001542: f5b3 5fb0 cmp.w r3, #5632 ; 0x1600
+ 8001546: f000 809c beq.w 8001682
+ 800154a: f5b3 5fb0 cmp.w r3, #5632 ; 0x1600
+ 800154e: f200 809b bhi.w 8001688
+ 8001552: f5b3 5fa8 cmp.w r3, #5376 ; 0x1500
+ 8001556: f000 8096 beq.w 8001686
+ 800155a: f5b3 5fa8 cmp.w r3, #5376 ; 0x1500
+ 800155e: f200 8093 bhi.w 8001688
+ 8001562: f5b3 5f98 cmp.w r3, #4864 ; 0x1300
+ 8001566: d07f beq.n 8001668
+ 8001568: f5b3 5f98 cmp.w r3, #4864 ; 0x1300
+ 800156c: f200 808c bhi.w 8001688
+ 8001570: f5b3 5f88 cmp.w r3, #4352 ; 0x1100
+ 8001574: d061 beq.n 800163a
+ 8001576: f5b3 5f88 cmp.w r3, #4352 ; 0x1100
+ 800157a: f200 8085 bhi.w 8001688
+ 800157e: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
+ 8001582: d03e beq.n 8001602
+ 8001584: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
+ 8001588: d87e bhi.n 8001688
+ 800158a: f5b3 6f10 cmp.w r3, #2304 ; 0x900
+ 800158e: d028 beq.n 80015e2
+ 8001590: f5b3 6f10 cmp.w r3, #2304 ; 0x900
+ 8001594: d878 bhi.n 8001688
+ 8001596: f5b3 7f00 cmp.w r3, #512 ; 0x200
+ 800159a: d008 beq.n 80015ae
+ 800159c: f5b3 6fc0 cmp.w r3, #1536 ; 0x600
+ 80015a0: d015 beq.n 80015ce
+ 80015a2: e071 b.n 8001688
+ 80015a4: 4b89 ldr r3, [pc, #548] ; (80017cc )
+ 80015a6: 881a ldrh r2, [r3, #0]
+ case 0x2700: //PGN BHM
+ memcpy (&GBT_MaxVoltage, j_rx.data, sizeof(GBT_MaxVoltage));
+ 80015a8: 4b89 ldr r3, [pc, #548] ; (80017d0 )
+ 80015aa: 801a strh r2, [r3, #0]
+
+ break;
+ 80015ac: e06c b.n 8001688
+
+ case 0x0200: //PGN BRM LONG
+ GBT_BAT_INFO_recv = 1;
+ 80015ae: 4b89 ldr r3, [pc, #548] ; (80017d4 )
+ 80015b0: 2201 movs r2, #1
+ 80015b2: 701a strb r2, [r3, #0]
+ memcpy (&GBT_EVInfo, j_rx.data, sizeof(GBT_EVInfo));
+ 80015b4: 4a88 ldr r2, [pc, #544] ; (80017d8 )
+ 80015b6: 4b85 ldr r3, [pc, #532] ; (80017cc )
+ 80015b8: 4614 mov r4, r2
+ 80015ba: 461d mov r5, r3
+ 80015bc: cd0f ldmia r5!, {r0, r1, r2, r3}
+ 80015be: c40f stmia r4!, {r0, r1, r2, r3}
+ 80015c0: cd0f ldmia r5!, {r0, r1, r2, r3}
+ 80015c2: c40f stmia r4!, {r0, r1, r2, r3}
+ 80015c4: cd0f ldmia r5!, {r0, r1, r2, r3}
+ 80015c6: c40f stmia r4!, {r0, r1, r2, r3}
+ 80015c8: 682b ldr r3, [r5, #0]
+ 80015ca: 7023 strb r3, [r4, #0]
+
+ break;
+ 80015cc: e05c b.n 8001688
+
+ case 0x0600: //PGN BCP LONG
+ GBT_BAT_STAT_recv = 1;
+ 80015ce: 4b83 ldr r3, [pc, #524] ; (80017dc )
+ 80015d0: 2201 movs r2, #1
+ 80015d2: 701a strb r2, [r3, #0]
+ memcpy (&GBT_BATStat, j_rx.data, sizeof(GBT_BATStat));
+ 80015d4: 4a82 ldr r2, [pc, #520] ; (80017e0 )
+ 80015d6: 4b7d ldr r3, [pc, #500] ; (80017cc )
+ 80015d8: 4614 mov r4, r2
+ 80015da: cb0f ldmia r3, {r0, r1, r2, r3}
+ 80015dc: c407 stmia r4!, {r0, r1, r2}
+ 80015de: 7023 strb r3, [r4, #0]
+ break;
+ 80015e0: e052 b.n 8001688
+
+ case 0x0900: //PGN BRO
+ if(j_rx.data[0] == 0xAA) EV_ready = 1;
+ 80015e2: 4b7a ldr r3, [pc, #488] ; (80017cc )
+ 80015e4: 781b ldrb r3, [r3, #0]
+ 80015e6: 2baa cmp r3, #170 ; 0xaa
+ 80015e8: d103 bne.n 80015f2
+ 80015ea: 4b7e ldr r3, [pc, #504] ; (80017e4 )
+ 80015ec: 2201 movs r2, #1
+ 80015ee: 701a strb r2, [r3, #0]
+ 80015f0: e002 b.n 80015f8
+ else EV_ready = 0;
+ 80015f2: 4b7c ldr r3, [pc, #496] ; (80017e4