adjust pin

This commit is contained in:
Siwat Sirichai 2023-10-01 00:17:08 +07:00
parent 8394bf9892
commit f6946613ad
12 changed files with 10551 additions and 10499 deletions

View File

@ -59,6 +59,8 @@ void Error_Handler(void);
/* Private defines -----------------------------------------------------------*/
#define B1_Pin GPIO_PIN_13
#define B1_GPIO_Port GPIOC
#define ALARM_Pin GPIO_PIN_0
#define ALARM_GPIO_Port GPIOC
#define USART_TX_Pin GPIO_PIN_2
#define USART_TX_GPIO_Port GPIOA
#define USART_RX_Pin GPIO_PIN_3

View File

@ -362,6 +362,9 @@ static void MX_GPIO_Init(void)
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(ALARM_GPIO_Port, ALARM_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, LD2_Pin|Door_Lock_Pin, GPIO_PIN_RESET);
@ -371,6 +374,13 @@ static void MX_GPIO_Init(void)
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pin : ALARM_Pin */
GPIO_InitStruct.Pin = ALARM_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(ALARM_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : LD2_Pin Door_Lock_Pin */
GPIO_InitStruct.Pin = LD2_Pin|Door_Lock_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
@ -455,11 +465,13 @@ void startDoorHandleTask(void *argument)
{
/* USER CODE BEGIN startDoorHandleTask */
/* Infinite loop */
HAL_GPIO_WritePin(DOOR_LOCK_BANK, DOOR_LOCK_PIN, 1);
for (;;) {
door_state = HAL_GPIO_ReadPin(DOOR_SENSOR_BANK, DOOR_SENSOR_PIN);
door_state = !HAL_GPIO_ReadPin(DOOR_SENSOR_BANK, DOOR_SENSOR_PIN);
if (door_lock_state != door_lock_state_command) {
if (door_lock_state_command == DOOR_LOCK_LOCKED) {
if (door_state == DOOR_STATE_CLOSED) {
osDelay(500);
HAL_GPIO_WritePin(DOOR_LOCK_BANK, DOOR_LOCK_PIN, 1);
door_lock_state = DOOR_LOCK_LOCKED;
door_lock_waiting = false;

View File

@ -4,9 +4,9 @@
../Core/Src/main.c:268:13:MX_ADC1_Init 3
../Core/Src/main.c:320:13:MX_USART2_UART_Init 2
../Core/Src/main.c:353:13:MX_GPIO_Init 1
../Core/Src/main.c:402:6:StartMainTask 9
../Core/Src/main.c:454:6:startDoorHandleTask 14
../Core/Src/main.c:514:6:StartStateSendTask 1
../Core/Src/main.c:535:6:StartADCReqTask 1
../Core/Src/main.c:555:6:HAL_TIM_PeriodElapsedCallback 2
../Core/Src/main.c:572:6:Error_Handler 1
../Core/Src/main.c:412:6:StartMainTask 9
../Core/Src/main.c:464:6:startDoorHandleTask 14
../Core/Src/main.c:526:6:StartStateSendTask 1
../Core/Src/main.c:547:6:StartADCReqTask 1
../Core/Src/main.c:567:6:HAL_TIM_PeriodElapsedCallback 2
../Core/Src/main.c:584:6:Error_Handler 1

View File

@ -4,9 +4,9 @@
../Core/Src/main.c:268:13:MX_ADC1_Init 24 static
../Core/Src/main.c:320:13:MX_USART2_UART_Init 8 static
../Core/Src/main.c:353:13:MX_GPIO_Init 48 static
../Core/Src/main.c:402:6:StartMainTask 24 static
../Core/Src/main.c:454:6:startDoorHandleTask 16 static
../Core/Src/main.c:514:6:StartStateSendTask 24 static
../Core/Src/main.c:535:6:StartADCReqTask 16 static
../Core/Src/main.c:555:6:HAL_TIM_PeriodElapsedCallback 16 static
../Core/Src/main.c:572:6:Error_Handler 4 static,ignoring_inline_asm
../Core/Src/main.c:412:6:StartMainTask 24 static
../Core/Src/main.c:464:6:startDoorHandleTask 16 static
../Core/Src/main.c:526:6:StartStateSendTask 24 static
../Core/Src/main.c:547:6:StartADCReqTask 16 static
../Core/Src/main.c:567:6:HAL_TIM_PeriodElapsedCallback 16 static
../Core/Src/main.c:584:6:Error_Handler 4 static,ignoring_inline_asm

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -29,21 +29,22 @@ Mcu.Name=STM32F411R(C-E)Tx
Mcu.Package=LQFP64
Mcu.Pin0=PC13-ANTI_TAMP
Mcu.Pin1=PC14-OSC32_IN
Mcu.Pin10=PA9
Mcu.Pin11=PA13
Mcu.Pin12=PA14
Mcu.Pin13=PB3
Mcu.Pin14=VP_FREERTOS_VS_CMSIS_V2
Mcu.Pin15=VP_SYS_VS_tim1
Mcu.Pin10=PA7
Mcu.Pin11=PA9
Mcu.Pin12=PA13
Mcu.Pin13=PA14
Mcu.Pin14=PB3
Mcu.Pin15=VP_FREERTOS_VS_CMSIS_V2
Mcu.Pin16=VP_SYS_VS_tim1
Mcu.Pin2=PC15-OSC32_OUT
Mcu.Pin3=PH0 - OSC_IN
Mcu.Pin4=PH1 - OSC_OUT
Mcu.Pin5=PA1
Mcu.Pin6=PA2
Mcu.Pin7=PA3
Mcu.Pin8=PA5
Mcu.Pin9=PA7
Mcu.PinsNb=16
Mcu.Pin5=PC0
Mcu.Pin6=PA1
Mcu.Pin7=PA2
Mcu.Pin8=PA3
Mcu.Pin9=PA5
Mcu.PinsNb=17
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F411RETx
@ -106,6 +107,10 @@ PB3.GPIOParameters=GPIO_Label
PB3.GPIO_Label=SWO
PB3.Locked=true
PB3.Signal=SYS_JTDO-SWO
PC0.GPIOParameters=GPIO_Label
PC0.GPIO_Label=ALARM
PC0.Locked=true
PC0.Signal=GPIO_Output
PC13-ANTI_TAMP.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI
PC13-ANTI_TAMP.GPIO_Label=B1 [Blue PushButton]
PC13-ANTI_TAMP.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING