From 5567c416152c918b56249dff6c0ad667cfb6a65e Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Tue, 7 May 2024 21:48:10 +0800 Subject: [PATCH] enabled debug for hall_1 and Hall_2 --- Core/Inc/sys_conf.h | 2 +- Core/Src/gpio.c | 4 ++-- Core/Src/stm32wlxx_it.c | 2 +- LoRaWAN/App/lora_app.c | 2 ++ STM32CubeIDE/.cproject | 1 - 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index 0271316..871fadc 100644 --- a/Core/Inc/sys_conf.h +++ b/Core/Inc/sys_conf.h @@ -47,7 +47,7 @@ extern "C" { /** * @brief Verbose level for all trace logs */ -#define VERBOSE_LEVEL VLEVEL_H +#define VERBOSE_LEVEL VLEVEL_M /** * @brief Enable trace logs diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index d4ead0b..b0a2f84 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -114,10 +114,10 @@ void MX_GPIO_Init(void) HAL_GPIO_Init(BUT3_GPIO_Port, &GPIO_InitStruct); #ifdef STS_O7 - HAL_NVIC_SetPriority(HALL1_EXTI_IRQn, 0, 0); + HAL_NVIC_SetPriority(HALL1_EXTI_IRQn, 15, 0); HAL_NVIC_EnableIRQ(HALL1_EXTI_IRQn); - HAL_NVIC_SetPriority(HALL2_EXTI_IRQn, 0, 0); + HAL_NVIC_SetPriority(HALL2_EXTI_IRQn, 15, 0); HAL_NVIC_EnableIRQ(HALL2_EXTI_IRQn); HAL_NVIC_SetPriority(A111_SENSOR_INTERRUPT_EXTI_IRQn, 0, 0); diff --git a/Core/Src/stm32wlxx_it.c b/Core/Src/stm32wlxx_it.c index 46f3b01..31c6d51 100644 --- a/Core/Src/stm32wlxx_it.c +++ b/Core/Src/stm32wlxx_it.c @@ -232,7 +232,7 @@ void EXTI0_IRQHandler(void) /* USER CODE END EXTI0_IRQn 0 */ #ifdef STS_O7 HAL_GPIO_EXTI_IRQHandler(HALL1_Pin); - sts_reed_hall_change_flag = 1; + //sts_reed_hall_change_flag = 1; #else HAL_GPIO_EXTI_IRQHandler(BUT1_Pin); sts_reed_hall_change_flag = 1; diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index e11131a..1a1cb11 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -632,6 +632,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) case HALL1_Pin: //sts_reed_hall_ext_int = 1; sts_hall1_read = HALL1_STATE; + APP_LOG(TS_OFF, VLEVEL_M, "\n\n Door Contact Read = %02X \r\n", HALL1_STATE); //UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0); /* Note: when "EventType == TX_ON_TIMER" this GPIO is not initialized */ // if (EventType == TX_ON_EVENT) @@ -642,6 +643,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) case HALL2_Pin: sts_hall2_read = HALL2_STATE; + APP_LOG(TS_OFF, VLEVEL_M, "\n\n SOS Button Read = %02X \r\n", HALL2_STATE); // UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0); UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); break; diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index 0ceadee..1bc22b8 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -154,7 +154,6 @@