Compare commits
8 Commits
aa64d93253
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| a6a512d2e3 | |||
| 6dab1a5eb7 | |||
| 72c26fb758 | |||
| e3080b1f6e | |||
| 77f600ddb3 | |||
| e3a226be54 | |||
| 8b0ca85f3d | |||
| 3d4f9eab74 |
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include "stm32g441xx.h"
|
#include "stm32g441xx.h"
|
||||||
#include "stm32g4xx_hal.h"
|
#include "stm32g4xx_hal.h"
|
||||||
|
#include "stm32g4xx_hal_gpio.h"
|
||||||
|
|
||||||
#define TS_INACTIVE 0
|
#define TS_INACTIVE 0
|
||||||
#define TS_PRECHARGE 2
|
#define TS_PRECHARGE 2
|
||||||
@ -24,6 +25,7 @@
|
|||||||
#define ADC_READ_TIMEOUT 500 // in ms
|
#define ADC_READ_TIMEOUT 500 // in ms
|
||||||
#define SDC_LOWER_THRESHOLD 2500 // in ADC Values
|
#define SDC_LOWER_THRESHOLD 2500 // in ADC Values
|
||||||
#define PRECHARGE_95_DURATION 1000 // in ms
|
#define PRECHARGE_95_DURATION 1000 // in ms
|
||||||
|
#define PRECHARGE_OPEN_AFTER 1000 // in ms
|
||||||
// FIXME
|
// FIXME
|
||||||
#define LOWER_VEHICLE_SIDE_VOLTAGE_LIMIT 150000 // in mV
|
#define LOWER_VEHICLE_SIDE_VOLTAGE_LIMIT 150000 // in mV
|
||||||
|
|
||||||
@ -31,6 +33,7 @@ typedef struct {
|
|||||||
|
|
||||||
int32_t BatteryVoltageVehicleSide;
|
int32_t BatteryVoltageVehicleSide;
|
||||||
int32_t BatteryVoltageBatterySide;
|
int32_t BatteryVoltageBatterySide;
|
||||||
|
int32_t shuntCurrent;
|
||||||
uint8_t targetTSState;
|
uint8_t targetTSState;
|
||||||
uint8_t currentTSState;
|
uint8_t currentTSState;
|
||||||
uint32_t precharge95ReachedTimestamp;
|
uint32_t precharge95ReachedTimestamp;
|
||||||
@ -51,4 +54,8 @@ void AIR_Discharge_Position();
|
|||||||
void AIR_Active_Position();
|
void AIR_Active_Position();
|
||||||
void AIR_Error_Position();
|
void AIR_Error_Position();
|
||||||
|
|
||||||
|
typedef enum { RELAY_AIR_NEG, RELAY_AIR_POS, RELAY_PRECHARGE } Relay;
|
||||||
|
|
||||||
|
void Set_Relay_Position(Relay relay, GPIO_PinState position);
|
||||||
|
|
||||||
#endif /* INC_AIR_STATE_MASCHINE_H_ */
|
#endif /* INC_AIR_STATE_MASCHINE_H_ */
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
#define SLAVE_EMERGENCY_ADDRESS 0x001 // Emergency Frame
|
#define SLAVE_EMERGENCY_ADDRESS 0x001 // Emergency Frame
|
||||||
#define CLOCK_SYNC_ADDRESS 0x002
|
#define CLOCK_SYNC_ADDRESS 0x002
|
||||||
#define MASTER_HEARTBEAT_ADDRESS 0x010
|
#define MASTER_HEARTBEAT_ADDRESS 0x010
|
||||||
|
#define SLAVE_EEPROM_WRITE_ADDRESS 0x020
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int16_t FrameID;
|
int16_t FrameID;
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "stm32g441xx.h"
|
#include "stm32g441xx.h"
|
||||||
|
|
||||||
#define NUMBEROFSLAVES 7
|
#define NUMBEROFSLAVES 9
|
||||||
#define NUMBEROFCELLS 10
|
#define NUMBEROFCELLS 10
|
||||||
#define NUMBEROFTEMPS 32
|
#define NUMBEROFTEMPS 32
|
||||||
|
|
||||||
@ -32,6 +32,7 @@ typedef struct {
|
|||||||
uint8_t error;
|
uint8_t error;
|
||||||
uint8_t timeout;
|
uint8_t timeout;
|
||||||
uint32_t frame_timestamps[SLAVE_HEARTBEAT_FRAMES];
|
uint32_t frame_timestamps[SLAVE_HEARTBEAT_FRAMES];
|
||||||
|
uint8_t error_frame[8];
|
||||||
|
|
||||||
} SlaveHandler;
|
} SlaveHandler;
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,7 @@ void FDCAN1_IT0_IRQHandler(void);
|
|||||||
void FDCAN1_IT1_IRQHandler(void);
|
void FDCAN1_IT1_IRQHandler(void);
|
||||||
void TIM1_UP_TIM16_IRQHandler(void);
|
void TIM1_UP_TIM16_IRQHandler(void);
|
||||||
void SPI1_IRQHandler(void);
|
void SPI1_IRQHandler(void);
|
||||||
|
void TIM8_UP_IRQHandler(void);
|
||||||
/* USER CODE BEGIN EFP */
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
/* USER CODE END EFP */
|
/* USER CODE END EFP */
|
||||||
|
|||||||
@ -7,7 +7,10 @@
|
|||||||
|
|
||||||
#include "AIR_State_Maschine.h"
|
#include "AIR_State_Maschine.h"
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
#include "stm32g4xx_hal.h"
|
#include "stm32g4xx_hal.h"
|
||||||
|
#include "stm32g4xx_hal_gpio.h"
|
||||||
|
|
||||||
DMA_HandleTypeDef* air_current_dma = {0};
|
DMA_HandleTypeDef* air_current_dma = {0};
|
||||||
DMA_HandleTypeDef* sdc_voltage_dma = {0};
|
DMA_HandleTypeDef* sdc_voltage_dma = {0};
|
||||||
@ -15,6 +18,10 @@ DMA_HandleTypeDef* sdc_voltage_dma = {0};
|
|||||||
uint8_t air_adc_complete = 0;
|
uint8_t air_adc_complete = 0;
|
||||||
uint8_t sdc_adc_complete = 0;
|
uint8_t sdc_adc_complete = 0;
|
||||||
|
|
||||||
|
static uint32_t pos_air_change_timestamp, neg_air_change_timestamp,
|
||||||
|
precharge_change_timestamp;
|
||||||
|
static GPIO_PinState neg_air_state, pos_air_state, precharge_state;
|
||||||
|
|
||||||
AIRStateHandler init_AIR_State_Maschine() {
|
AIRStateHandler init_AIR_State_Maschine() {
|
||||||
AIRStateHandler airstate = {0};
|
AIRStateHandler airstate = {0};
|
||||||
|
|
||||||
@ -110,6 +117,12 @@ uint8_t Update_AIR_State(AIRStateHandler* airstate) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (airstate->currentTSState == TS_CHARGING) {
|
||||||
|
if (airstate->shuntCurrent < 0) {
|
||||||
|
airstate->currentTSState = TS_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if (airstate->currentTSState ==
|
else if (airstate->currentTSState ==
|
||||||
TS_PRECHARGE) // Change from Precharge to Active at 95% TS Voltage at
|
TS_PRECHARGE) // Change from Precharge to Active at 95% TS Voltage at
|
||||||
// Vehicle Side
|
// Vehicle Side
|
||||||
@ -178,48 +191,76 @@ void Deactivate_TS(AIRStateHandler* airstate) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AIR_Precharge_Position() {
|
void AIR_Precharge_Position() {
|
||||||
HAL_GPIO_WritePin(PreCharge_Control_GPIO_Port, PreCharge_Control_Pin,
|
Set_Relay_Position(RELAY_PRECHARGE, GPIO_PIN_SET);
|
||||||
GPIO_PIN_SET);
|
Set_Relay_Position(RELAY_AIR_NEG, GPIO_PIN_SET);
|
||||||
HAL_GPIO_WritePin(AIR_negative_Control_GPIO_Port, AIR_negative_Control_Pin,
|
Set_Relay_Position(RELAY_AIR_POS, GPIO_PIN_RESET);
|
||||||
GPIO_PIN_SET);
|
|
||||||
HAL_GPIO_WritePin(AIR_Positive_Control_GPIO_Port, AIR_Positive_Control_Pin,
|
|
||||||
GPIO_PIN_RESET);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIR_Inactive_Position() {
|
void AIR_Inactive_Position() {
|
||||||
HAL_GPIO_WritePin(PreCharge_Control_GPIO_Port, PreCharge_Control_Pin,
|
Set_Relay_Position(RELAY_PRECHARGE, GPIO_PIN_RESET);
|
||||||
GPIO_PIN_RESET);
|
Set_Relay_Position(RELAY_AIR_NEG, GPIO_PIN_RESET);
|
||||||
HAL_GPIO_WritePin(AIR_negative_Control_GPIO_Port, AIR_negative_Control_Pin,
|
Set_Relay_Position(RELAY_AIR_POS, GPIO_PIN_RESET);
|
||||||
GPIO_PIN_RESET);
|
|
||||||
HAL_GPIO_WritePin(AIR_Positive_Control_GPIO_Port, AIR_Positive_Control_Pin,
|
|
||||||
GPIO_PIN_RESET);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIR_Discharge_Position() {
|
void AIR_Discharge_Position() {
|
||||||
HAL_GPIO_WritePin(PreCharge_Control_GPIO_Port, PreCharge_Control_Pin,
|
Set_Relay_Position(RELAY_PRECHARGE, GPIO_PIN_SET);
|
||||||
GPIO_PIN_SET);
|
Set_Relay_Position(RELAY_AIR_NEG, GPIO_PIN_SET);
|
||||||
HAL_GPIO_WritePin(AIR_negative_Control_GPIO_Port, AIR_negative_Control_Pin,
|
Set_Relay_Position(RELAY_AIR_POS, GPIO_PIN_RESET);
|
||||||
GPIO_PIN_SET);
|
|
||||||
HAL_GPIO_WritePin(AIR_Positive_Control_GPIO_Port, AIR_Positive_Control_Pin,
|
|
||||||
GPIO_PIN_RESET);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIR_Active_Position() // TODO Deactivate Precharge after a while to
|
void AIR_Active_Position() {
|
||||||
// decrease current Consumption
|
if (pos_air_state == GPIO_PIN_SET &&
|
||||||
{
|
HAL_GetTick() - pos_air_change_timestamp > PRECHARGE_OPEN_AFTER) {
|
||||||
HAL_GPIO_WritePin(PreCharge_Control_GPIO_Port, PreCharge_Control_Pin,
|
Set_Relay_Position(RELAY_PRECHARGE, GPIO_PIN_RESET);
|
||||||
GPIO_PIN_SET);
|
} else {
|
||||||
HAL_GPIO_WritePin(AIR_negative_Control_GPIO_Port, AIR_negative_Control_Pin,
|
Set_Relay_Position(RELAY_PRECHARGE, GPIO_PIN_SET);
|
||||||
GPIO_PIN_SET);
|
}
|
||||||
HAL_GPIO_WritePin(AIR_Positive_Control_GPIO_Port, AIR_Positive_Control_Pin,
|
Set_Relay_Position(RELAY_AIR_NEG, GPIO_PIN_SET);
|
||||||
GPIO_PIN_SET);
|
Set_Relay_Position(RELAY_AIR_POS, GPIO_PIN_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIR_Error_Position() {
|
void AIR_Error_Position() {
|
||||||
HAL_GPIO_WritePin(PreCharge_Control_GPIO_Port, PreCharge_Control_Pin,
|
Set_Relay_Position(RELAY_PRECHARGE, GPIO_PIN_RESET);
|
||||||
GPIO_PIN_RESET);
|
Set_Relay_Position(RELAY_AIR_NEG, GPIO_PIN_RESET);
|
||||||
HAL_GPIO_WritePin(AIR_negative_Control_GPIO_Port, AIR_negative_Control_Pin,
|
Set_Relay_Position(RELAY_AIR_POS, GPIO_PIN_RESET);
|
||||||
GPIO_PIN_RESET);
|
}
|
||||||
HAL_GPIO_WritePin(AIR_Positive_Control_GPIO_Port, AIR_Positive_Control_Pin,
|
|
||||||
GPIO_PIN_RESET);
|
void Set_Relay_Position(Relay relay, GPIO_PinState position) {
|
||||||
|
// Add a small delay after closing relays in order to not draw too much
|
||||||
|
// current
|
||||||
|
switch (relay) {
|
||||||
|
case RELAY_AIR_NEG:
|
||||||
|
HAL_GPIO_WritePin(AIR_negative_Control_GPIO_Port, AIR_negative_Control_Pin,
|
||||||
|
position);
|
||||||
|
if (position != neg_air_state) {
|
||||||
|
neg_air_change_timestamp = HAL_GetTick();
|
||||||
|
}
|
||||||
|
if (position == GPIO_PIN_SET && neg_air_state == GPIO_PIN_RESET) {
|
||||||
|
HAL_Delay(10);
|
||||||
|
}
|
||||||
|
neg_air_state = position;
|
||||||
|
break;
|
||||||
|
case RELAY_AIR_POS:
|
||||||
|
HAL_GPIO_WritePin(AIR_Positive_Control_GPIO_Port, AIR_Positive_Control_Pin,
|
||||||
|
position);
|
||||||
|
if (position != pos_air_state) {
|
||||||
|
pos_air_change_timestamp = HAL_GetTick();
|
||||||
|
}
|
||||||
|
if (position == GPIO_PIN_SET && pos_air_state == GPIO_PIN_RESET) {
|
||||||
|
HAL_Delay(10);
|
||||||
|
}
|
||||||
|
pos_air_state = position;
|
||||||
|
break;
|
||||||
|
case RELAY_PRECHARGE:
|
||||||
|
HAL_GPIO_WritePin(PreCharge_Control_GPIO_Port, PreCharge_Control_Pin,
|
||||||
|
position);
|
||||||
|
if (position != precharge_state) {
|
||||||
|
precharge_change_timestamp = HAL_GetTick();
|
||||||
|
}
|
||||||
|
if (position == GPIO_PIN_SET && precharge_state == GPIO_PIN_RESET) {
|
||||||
|
HAL_Delay(10);
|
||||||
|
}
|
||||||
|
precharge_state = position;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,11 +14,8 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// 3 should be programmed with CAN id 2
|
const uint16_t slave_CAN_id_to_slave_index[10] = {
|
||||||
// const uint16_t slave_CAN_id_to_slave_index[7] = {
|
0, 1, 2, 3, 4, 5, 6, 7, 255, 8}; // TODO: Make this pretty pls
|
||||||
// 255, 255, 0, 255, 255, 255, 1}; // TODO: Make this pretty pls
|
|
||||||
const uint16_t slave_CAN_id_to_slave_index[7] = {
|
|
||||||
0, 1, 2, 3, 4, 5, 6}; // TODO: Make this pretty pls
|
|
||||||
canFrame framebuffer[CANFRAMEBUFFERSIZE] = {0};
|
canFrame framebuffer[CANFRAMEBUFFERSIZE] = {0};
|
||||||
uint32_t framebufferwritepointer = 0;
|
uint32_t framebufferwritepointer = 0;
|
||||||
uint32_t framebufferreadpointer = 0;
|
uint32_t framebufferreadpointer = 0;
|
||||||
@ -72,11 +69,9 @@ uint8_t CAN_Receive(FDCAN_HandleTypeDef* hcan) {
|
|||||||
uint8_t messageID = msg & 0x00F;
|
uint8_t messageID = msg & 0x00F;
|
||||||
updateSlaveInfo(slaveID, messageID, rxFrame);
|
updateSlaveInfo(slaveID, messageID, rxFrame);
|
||||||
} else if (rxFrame.FrameID == SLAVE_EMERGENCY_ADDRESS) {
|
} else if (rxFrame.FrameID == SLAVE_EMERGENCY_ADDRESS) {
|
||||||
AMSErrorHandle errorframe = {0};
|
uint8_t slave_id = rxFrame.data[0];
|
||||||
errorframe.errorcode = SlavesErrorFrameError;
|
slaves[slave_id].error = 1;
|
||||||
memcpy(errorframe.errorarg, rxFrame.data, 7);
|
memcpy(slaves[slave_id].error_frame, rxFrame.data, 8);
|
||||||
|
|
||||||
AMS_Error_Handler(&errorframe);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,8 @@ static FDCAN_HandleTypeDef* can;
|
|||||||
static TIM_HandleTypeDef* sync_timer;
|
static TIM_HandleTypeDef* sync_timer;
|
||||||
static TIM_HandleTypeDef* heartbeat_timer;
|
static TIM_HandleTypeDef* heartbeat_timer;
|
||||||
|
|
||||||
|
static uint8_t clock_sync_counter = 0;
|
||||||
|
|
||||||
void clock_sync_init(FDCAN_HandleTypeDef* can_handle,
|
void clock_sync_init(FDCAN_HandleTypeDef* can_handle,
|
||||||
TIM_HandleTypeDef* sync_timer_handle,
|
TIM_HandleTypeDef* sync_timer_handle,
|
||||||
TIM_HandleTypeDef* heartbeat_timer_handle) {
|
TIM_HandleTypeDef* heartbeat_timer_handle) {
|
||||||
@ -25,7 +27,8 @@ void clock_sync_init(FDCAN_HandleTypeDef* can_handle,
|
|||||||
|
|
||||||
void clock_sync_handle_timer_complete(TIM_HandleTypeDef* timer) {
|
void clock_sync_handle_timer_complete(TIM_HandleTypeDef* timer) {
|
||||||
if (timer == sync_timer) {
|
if (timer == sync_timer) {
|
||||||
CAN_Transmit(can, CLOCK_SYNC_ADDRESS, NULL, 0);
|
CAN_Transmit(can, CLOCK_SYNC_ADDRESS, &clock_sync_counter, 1);
|
||||||
|
clock_sync_counter++;
|
||||||
} else if (timer == heartbeat_timer) {
|
} else if (timer == heartbeat_timer) {
|
||||||
CAN_Transmit(can, MASTER_HEARTBEAT_ADDRESS, NULL, 0);
|
CAN_Transmit(can, MASTER_HEARTBEAT_ADDRESS, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -348,7 +348,7 @@ void InterSTMFrame() {
|
|||||||
spirxbuf[0] << 24 | spirxbuf[1] << 16 | spirxbuf[2] << 8 | spirxbuf[3];
|
spirxbuf[0] << 24 | spirxbuf[1] << 16 | spirxbuf[2] << 8 | spirxbuf[3];
|
||||||
spi_airstates->BatteryVoltageVehicleSide =
|
spi_airstates->BatteryVoltageVehicleSide =
|
||||||
spirxbuf[4] << 24 | spirxbuf[5] << 16 | spirxbuf[6] << 8 | spirxbuf[7];
|
spirxbuf[4] << 24 | spirxbuf[5] << 16 | spirxbuf[6] << 8 | spirxbuf[7];
|
||||||
uint32_t current =
|
spi_airstates->shuntCurrent =
|
||||||
spirxbuf[8] << 24 | spirxbuf[9] << 16 | spirxbuf[10] << 8 | spirxbuf[11];
|
spirxbuf[8] << 24 | spirxbuf[9] << 16 | spirxbuf[10] << 8 | spirxbuf[11];
|
||||||
spi_airstates->targetTSState = spirxbuf[12];
|
spi_airstates->targetTSState = spirxbuf[12];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,8 @@
|
|||||||
#include "stm32g4xx_hal.h"
|
#include "stm32g4xx_hal.h"
|
||||||
#include "stm32g4xx_hal_gpio.h"
|
#include "stm32g4xx_hal_gpio.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
SlaveHandler slaves[NUMBEROFSLAVES];
|
SlaveHandler slaves[NUMBEROFSLAVES];
|
||||||
|
|
||||||
void initSlaves() {
|
void initSlaves() {
|
||||||
@ -63,8 +65,12 @@ uint8_t checkSlaveTimeout() {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HAL_GetTick() < 20000) {
|
if (slaves[n].error) {
|
||||||
continue;
|
AMSErrorHandle errorframe;
|
||||||
|
errorframe.errorcode = SlavesErrorFrameError;
|
||||||
|
memcpy(errorframe.errorarg, slaves[n].error_frame, 7);
|
||||||
|
AMS_Error_Handler(&errorframe);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < SLAVE_HEARTBEAT_FRAMES; i++) {
|
for (int i = 0; i < SLAVE_HEARTBEAT_FRAMES; i++) {
|
||||||
|
|||||||
@ -322,6 +322,9 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
|||||||
/* USER CODE END TIM8_MspInit 0 */
|
/* USER CODE END TIM8_MspInit 0 */
|
||||||
/* Peripheral clock enable */
|
/* Peripheral clock enable */
|
||||||
__HAL_RCC_TIM8_CLK_ENABLE();
|
__HAL_RCC_TIM8_CLK_ENABLE();
|
||||||
|
/* TIM8 interrupt Init */
|
||||||
|
HAL_NVIC_SetPriority(TIM8_UP_IRQn, 0, 0);
|
||||||
|
HAL_NVIC_EnableIRQ(TIM8_UP_IRQn);
|
||||||
/* USER CODE BEGIN TIM8_MspInit 1 */
|
/* USER CODE BEGIN TIM8_MspInit 1 */
|
||||||
|
|
||||||
/* USER CODE END TIM8_MspInit 1 */
|
/* USER CODE END TIM8_MspInit 1 */
|
||||||
@ -358,6 +361,9 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
|||||||
/* USER CODE END TIM8_MspDeInit 0 */
|
/* USER CODE END TIM8_MspDeInit 0 */
|
||||||
/* Peripheral clock disable */
|
/* Peripheral clock disable */
|
||||||
__HAL_RCC_TIM8_CLK_DISABLE();
|
__HAL_RCC_TIM8_CLK_DISABLE();
|
||||||
|
|
||||||
|
/* TIM8 interrupt DeInit */
|
||||||
|
HAL_NVIC_DisableIRQ(TIM8_UP_IRQn);
|
||||||
/* USER CODE BEGIN TIM8_MspDeInit 1 */
|
/* USER CODE BEGIN TIM8_MspDeInit 1 */
|
||||||
|
|
||||||
/* USER CODE END TIM8_MspDeInit 1 */
|
/* USER CODE END TIM8_MspDeInit 1 */
|
||||||
|
|||||||
@ -60,6 +60,7 @@
|
|||||||
extern FDCAN_HandleTypeDef hfdcan1;
|
extern FDCAN_HandleTypeDef hfdcan1;
|
||||||
extern SPI_HandleTypeDef hspi1;
|
extern SPI_HandleTypeDef hspi1;
|
||||||
extern TIM_HandleTypeDef htim1;
|
extern TIM_HandleTypeDef htim1;
|
||||||
|
extern TIM_HandleTypeDef htim8;
|
||||||
/* USER CODE BEGIN EV */
|
/* USER CODE BEGIN EV */
|
||||||
|
|
||||||
/* USER CODE END EV */
|
/* USER CODE END EV */
|
||||||
@ -259,6 +260,20 @@ void SPI1_IRQHandler(void)
|
|||||||
/* USER CODE END SPI1_IRQn 1 */
|
/* USER CODE END SPI1_IRQn 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles TIM8 update interrupt.
|
||||||
|
*/
|
||||||
|
void TIM8_UP_IRQHandler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM8_UP_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM8_UP_IRQn 0 */
|
||||||
|
HAL_TIM_IRQHandler(&htim8);
|
||||||
|
/* USER CODE BEGIN TIM8_UP_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM8_UP_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
/* USER CODE BEGIN 1 */
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
/* USER CODE END 1 */
|
/* USER CODE END 1 */
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
|||||||
##########################################################################################################################
|
##########################################################################################################################
|
||||||
# File automatically-generated by tool: [projectgenerator] version: [3.17.1] date: [Mon Aug 01 08:27:49 CEST 2022]
|
# File automatically-generated by tool: [projectgenerator] version: [3.17.1] date: [Tue Aug 02 18:31:31 CEST 2022]
|
||||||
##########################################################################################################################
|
##########################################################################################################################
|
||||||
|
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
|
|||||||
@ -65,6 +65,7 @@ NVIC.SPI1_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
|||||||
NVIC.SVCall_IRQn=true\:4\:0\:true\:false\:true\:false\:false\:false
|
NVIC.SVCall_IRQn=true\:4\:0\:true\:false\:true\:false\:false\:false
|
||||||
NVIC.SysTick_IRQn=true\:4\:0\:true\:false\:true\:false\:true\:false
|
NVIC.SysTick_IRQn=true\:4\:0\:true\:false\:true\:false\:true\:false
|
||||||
NVIC.TIM1_UP_TIM16_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
NVIC.TIM1_UP_TIM16_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
||||||
|
NVIC.TIM8_UP_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
||||||
NVIC.UsageFault_IRQn=true\:4\:0\:true\:false\:true\:false\:false\:false
|
NVIC.UsageFault_IRQn=true\:4\:0\:true\:false\:true\:false\:false\:false
|
||||||
PA10.GPIOParameters=GPIO_Label
|
PA10.GPIOParameters=GPIO_Label
|
||||||
PA10.GPIO_Label=Status_LED
|
PA10.GPIO_Label=Status_LED
|
||||||
@ -151,7 +152,7 @@ ProjectManager.StackSize=0x400
|
|||||||
ProjectManager.TargetToolchain=Makefile
|
ProjectManager.TargetToolchain=Makefile
|
||||||
ProjectManager.ToolChainLocation=
|
ProjectManager.ToolChainLocation=
|
||||||
ProjectManager.UnderRoot=false
|
ProjectManager.UnderRoot=false
|
||||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_FDCAN1_Init-FDCAN1-false-HAL-true,4-MX_SPI1_Init-SPI1-false-HAL-true,5-MX_CRC_Init-CRC-false-HAL-true,6-MX_TIM1_Init-TIM1-false-HAL-true
|
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_FDCAN1_Init-FDCAN1-false-HAL-true,4-MX_SPI1_Init-SPI1-false-HAL-true,5-MX_CRC_Init-CRC-false-HAL-true,6-MX_TIM1_Init-TIM1-false-HAL-true,7-MX_TIM8_Init-TIM8-false-HAL-true
|
||||||
RCC.ADC12Freq_Value=16000000
|
RCC.ADC12Freq_Value=16000000
|
||||||
RCC.AHBFreq_Value=16000000
|
RCC.AHBFreq_Value=16000000
|
||||||
RCC.APB1Freq_Value=16000000
|
RCC.APB1Freq_Value=16000000
|
||||||
|
|||||||
Reference in New Issue
Block a user