correct AMS_NERROR logic
This commit is contained in:
parent
6fe46bc756
commit
2680da3c4f
|
@ -454,12 +454,14 @@ static void MX_GPIO_Init(void)
|
|||
|NEG_AIR_CTRL_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOB, SLAVE_POWER_1_Pin|SLAVE_POWER_DSEL_Pin|SLAVE_POWER_DEN_Pin|SLAVE_POWER_0_Pin
|
||||
|AMS_NERROR_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOB, SLAVE_POWER_1_Pin|SLAVE_POWER_DSEL_Pin|SLAVE_POWER_DEN_Pin|SLAVE_POWER_0_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(PRECHARGE_CTRL_GPIO_Port, PRECHARGE_CTRL_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(AMS_NERROR_GPIO_Port, AMS_NERROR_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pins : STATUS_LED_R_Pin STATUS_LED_G_Pin STATUS_LED_B_Pin POS_AIR_CTRL_Pin
|
||||
NEG_AIR_CTRL_Pin */
|
||||
GPIO_InitStruct.Pin = STATUS_LED_R_Pin|STATUS_LED_G_Pin|STATUS_LED_B_Pin|POS_AIR_CTRL_Pin
|
||||
|
|
|
@ -116,12 +116,12 @@ TSState ts_sm_update_error() {
|
|||
no_error_since = now;
|
||||
} else if (now - no_error_since > NO_ERROR_TIME) {
|
||||
no_error_since = 0;
|
||||
HAL_GPIO_WritePin(AMS_NERROR_GPIO_Port, AMS_NERROR_Pin, GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(AMS_NERROR_GPIO_Port, AMS_NERROR_Pin, GPIO_PIN_RESET);
|
||||
return TS_INACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
HAL_GPIO_WritePin(AMS_NERROR_GPIO_Port, AMS_NERROR_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(AMS_NERROR_GPIO_Port, AMS_NERROR_Pin, GPIO_PIN_SET);
|
||||
return TS_ERROR;
|
||||
}
|
||||
|
||||
|
|
72
Makefile
72
Makefile
|
@ -1,5 +1,5 @@
|
|||
##########################################################################################################################
|
||||
# File automatically-generated by tool: [projectgenerator] version: [4.2.0-B44] date: [Thu May 02 19:45:04 CEST 2024]
|
||||
# File automatically-generated by tool: [projectgenerator] version: [4.2.0-B44] date: [Mon May 06 18:18:37 CEST 2024]
|
||||
##########################################################################################################################
|
||||
|
||||
# ------------------------------------------------
|
||||
|
@ -35,35 +35,35 @@ BUILD_DIR = build
|
|||
# source
|
||||
######################################
|
||||
# C sources
|
||||
C_SOURCES = \
|
||||
Core/Src/main.c \
|
||||
Core/Src/stm32h7xx_it.c \
|
||||
Core/Src/stm32h7xx_hal_msp.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_fdcan.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.c \
|
||||
Core/Src/system_stm32h7xx.c
|
||||
C_SOURCES = \
|
||||
Core/Src/main.c \
|
||||
Core/Src/stm32h7xx_it.c \
|
||||
Core/Src/stm32h7xx_hal_msp.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_fdcan.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c \
|
||||
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.c \
|
||||
Core/Src/system_stm32h7xx.c
|
||||
|
||||
# ASM sources
|
||||
ASM_SOURCES = \
|
||||
ASM_SOURCES = \
|
||||
startup_stm32h7a3xx.s
|
||||
|
||||
# ASM sources
|
||||
|
@ -110,8 +110,8 @@ MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
|
|||
AS_DEFS =
|
||||
|
||||
# C defines
|
||||
C_DEFS = \
|
||||
-DUSE_HAL_DRIVER \
|
||||
C_DEFS = \
|
||||
-DUSE_HAL_DRIVER \
|
||||
-DSTM32H7A3xx
|
||||
|
||||
|
||||
|
@ -119,11 +119,11 @@ C_DEFS = \
|
|||
AS_INCLUDES =
|
||||
|
||||
# C includes
|
||||
C_INCLUDES = \
|
||||
-ICore/Inc \
|
||||
-IDrivers/STM32H7xx_HAL_Driver/Inc \
|
||||
-IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy \
|
||||
-IDrivers/CMSIS/Device/ST/STM32H7xx/Include \
|
||||
C_INCLUDES = \
|
||||
-ICore/Inc \
|
||||
-IDrivers/STM32H7xx_HAL_Driver/Inc \
|
||||
-IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy \
|
||||
-IDrivers/CMSIS/Device/ST/STM32H7xx/Include \
|
||||
-IDrivers/CMSIS/Include
|
||||
|
||||
|
||||
|
@ -200,4 +200,4 @@ clean:
|
|||
#######################################
|
||||
-include $(wildcard $(BUILD_DIR)/*.d)
|
||||
|
||||
# *** EOF ***
|
||||
# *** EOF ***
|
||||
|
|
|
@ -147,9 +147,11 @@ PB6.Mode=I2C
|
|||
PB6.Signal=I2C1_SCL
|
||||
PB7.Mode=I2C
|
||||
PB7.Signal=I2C1_SDA
|
||||
PB8.GPIOParameters=GPIO_Label
|
||||
PB8.GPIOParameters=PinState,GPIO_PuPd,GPIO_Label
|
||||
PB8.GPIO_Label=AMS_NERROR
|
||||
PB8.GPIO_PuPd=GPIO_NOPULL
|
||||
PB8.Locked=true
|
||||
PB8.PinState=GPIO_PIN_SET
|
||||
PB8.Signal=GPIO_Output
|
||||
PC0.GPIOParameters=GPIO_Label
|
||||
PC0.GPIO_Label=STATUS_LED_R
|
||||
|
|
Loading…
Reference in New Issue