This commit is contained in:
Yunhorn 2024-03-07 11:58:43 +08:00
commit 119c3ef6c5
5 changed files with 33 additions and 9 deletions

View File

@ -47,12 +47,12 @@ extern "C" {
/** /**
* @brief Verbose level for all trace logs * @brief Verbose level for all trace logs
*/ */
#define VERBOSE_LEVEL VLEVEL_H #define VERBOSE_LEVEL VLEVEL_OFF
/** /**
* @brief Enable trace logs * @brief Enable trace logs
*/ */
#define APP_LOG_ENABLED 1 #define APP_LOG_ENABLED 0
/** /**
* @brief Activate monitoring (probes) of some internal RF signals for debug purpose * @brief Activate monitoring (probes) of some internal RF signals for debug purpose

View File

@ -85,11 +85,23 @@ int main(void)
/* Initialize all configured peripherals */ /* Initialize all configured peripherals */
MX_GPIO_Init(); MX_GPIO_Init();
MX_LoRaWAN_Init(); #if 1
if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
{
/* Clear Standby flag */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
HAL_GPIO_TogglePin(LED3_GPIO_Port, LED3_Pin); /* LED_BLUE */
} else {
MX_LoRaWAN_Init();
}
#endif
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
/* USER CODE END 2 */ /* USER CODE END 2 */
MX_LoRaWAN_Init();
/* Infinite loop */ /* Infinite loop */
/* USER CODE BEGIN WHILE */ /* USER CODE BEGIN WHILE */
while (1) while (1)

View File

@ -77,15 +77,26 @@ const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
void PWR_EnterOffMode(void) void PWR_EnterOffMode(void)
{ {
/* USER CODE BEGIN EnterOffMode_1 */ /* USER CODE BEGIN EnterOffMode_1 */
/* USER CODE END EnterOffMode_1 */ /* USER CODE END EnterOffMode_1 */
//HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_A, PWR_GPIO_BIT_0);
//HAL_PWREx_EnablePullUpPullDownConfig();
/* USER CODE BEGIN EnterOffMode_2 */
/* USER CODE END EnterOffMode_2 */
/* USER CODE BEGIN EnterOffMode_3 */
//HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_LOW);
//__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
//HAL_PWR_EnterSTANDBYMode();
/* USER CODE END EnterOffMode_3 */
} }
void PWR_ExitOffMode(void) void PWR_ExitOffMode(void)
{ {
/* USER CODE BEGIN ExitOffMode_1 */ /* USER CODE BEGIN ExitOffMode_1 */
//__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
/* USER CODE END ExitOffMode_1 */ /* USER CODE END ExitOffMode_1 */
} }

View File

@ -121,7 +121,8 @@ void SystemApp_Init(void)
/*Init low power manager*/ /*Init low power manager*/
UTIL_LPM_Init(); UTIL_LPM_Init();
/* Disable Stand-by mode */ /* Disable Stand-by mode */
UTIL_LPM_SetOffMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_ENABLE); UTIL_LPM_SetOffMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_DISABLE);
//UTIL_LPM_SetOffMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_ENABLE);
#if defined (LOW_POWER_DISABLE) && (LOW_POWER_DISABLE == 1) #if defined (LOW_POWER_DISABLE) && (LOW_POWER_DISABLE == 1)
/* Disable Stop Mode */ /* Disable Stop Mode */

View File

@ -290,7 +290,7 @@ static LmHandlerParams_t LmHandlerParams =
/** /**
* @brief Type of Event to generate application Tx * @brief Type of Event to generate application Tx
*/ */
static TxEventType_t EventType = TX_ON_TIMER; static TxEventType_t EventType = TX_ON_TIMER;//TX_ON_EVENT;
/** /**
* @brief Timer to handle the application Tx * @brief Timer to handle the application Tx