diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index ea70373..37cdd34 100644 --- a/Core/Inc/sys_conf.h +++ b/Core/Inc/sys_conf.h @@ -47,12 +47,12 @@ extern "C" { /** * @brief Verbose level for all trace logs */ -#define VERBOSE_LEVEL VLEVEL_L +#define VERBOSE_LEVEL VLEVEL_H /** * @brief Enable trace logs */ -#define APP_LOG_ENABLED 0 +#define APP_LOG_ENABLED 1 /** * @brief Activate monitoring (probes) of some internal RF signals for debug purpose @@ -75,13 +75,13 @@ extern "C" { * @brief Enable/Disable MCU Debugger pins (dbg serial wires) * @note by HW serial wires are ON by default, need to put them OFF to save power */ -#define DEBUGGER_ENABLED 0 +#define DEBUGGER_ENABLED 1 /** * @brief Disable Low Power mode * @note 0: LowPowerMode enabled. MCU enters stop2 mode, 1: LowPowerMode disabled. MCU enters sleep mode only */ -#define LOW_POWER_DISABLE 0 +#define LOW_POWER_DISABLE 1 /* USER CODE BEGIN EC */ diff --git a/Core/Src/dma.c b/Core/Src/dma.c index 366b255..c34a3c2 100644 --- a/Core/Src/dma.c +++ b/Core/Src/dma.c @@ -70,9 +70,11 @@ void MX_DMA_Init(void) // **** I2C2 // **** USART2 +#if 0 /* DMA1_Channel6_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn); +#endif /* DMA1_Channel7_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn); diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index 3e14778..ce17b3d 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -89,7 +89,7 @@ void MX_GPIO_Init(void) /*Configure GPIO pin : PtPin */ GPIO_InitStruct.Pin = BUT1_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(BUT1_GPIO_Port, &GPIO_InitStruct); diff --git a/Core/Src/stm32wlxx_it.c b/Core/Src/stm32wlxx_it.c index e3545a0..f352fde 100644 --- a/Core/Src/stm32wlxx_it.c +++ b/Core/Src/stm32wlxx_it.c @@ -328,7 +328,9 @@ void DMA1_Channel6_IRQHandler(void) /* USER CODE BEGIN DMA1_Channel6_IRQn 0 */ /* USER CODE END DMA1_Channel6_IRQn 0 */ +#if 0 HAL_DMA_IRQHandler(&hdma_usart2_rx); +#endif /* USER CODE BEGIN DMA1_Channel6_IRQn 1 */ /* USER CODE END DMA1_Channel6_IRQn 1 */ diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index de00b90..11d0941 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -400,7 +400,7 @@ static LmHandlerParams_t LmHandlerParams = /** * @brief Type of Event to generate application Tx */ -static TxEventType_t EventType = TX_ON_TIMER; +static TxEventType_t EventType = TX_ON_EVENT; /** * @brief Timer to handle the application Tx @@ -634,18 +634,19 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) switch (GPIO_Pin) { case BUT1_Pin: -#if (defined(STS_USE_STM32WL55)||defined(STS_USE_STM32WLE5)) + #ifdef YUNHORN_STS_O5_ENABLED - uint8_t pinstate = (STS_Reed_Hall_State== 0)?1:0; - APP_LOG(TS_OFF, VLEVEL_L, "## BUTTON-1 DETECTED: %2d \r\n", pinstate); + uint8_t pinstate = STS_Reed_Hall_State; - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); - //if (EventType == TX_ON_EVENT) - if (pinstate == 1) - { //UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + + if (EventType == TX_ON_EVENT) + + { + APP_LOG(TS_OFF, VLEVEL_L, "## BUTTON-1 DETECTED: %2d \r\n", pinstate); + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); } else { #ifdef LED_ONBOARD @@ -656,7 +657,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) } #endif -#endif + break; case BUT2_Pin: #if defined(STS_USE_STM32WLE5) diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index 2f13bb8..59e0d81 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -26,7 +26,7 @@