Is it can enter the standby mode, use the RTC awakening, the data can also send out,
Now want to let the entire sensor after the initial electricity into dormancy, and then in the RTC after wake up, again to send data; But now as long as electricity to send data directly, then into dormancy,
By looking at the PWRS - & gt; CSR registers, see the RM says in the manual of SBF and WUF bits can be used to determine whether waking from a standby mode, but the program do something, or do you want to send data to electricity,
Please bosses to look at what may be because,
Int main (void)
{
/* MCU Configuration -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - */
HAL_Init ();
/* Configure the system clock */
SystemClock_Config ();
MX_GPIO_Init ();
MX_RTC_Init ();
RTC_AlarmConfig ();
/* the USER CODE BEGIN SysInit */
If (__HAL_PWR_GET_FLAG (PWR_FLAG_SB)!=RESET)//in this judgment SBF flags, if is 1, it shows that had been awakened
//if (__HAL_PWR_GET_FLAG (PWR_FLAG_WU)!=RESET)
{
__HAL_RCC_GPIOA_CLK_ENABLE ();
MX_SPI1_Init ();
Lora_init ();
//HAL_Delay (10000);
Read_Ds18b20 ();
Lora_SendTemp1 ();
}
__HAL_RCC_PWR_CLK_ENABLE ();
If (__HAL_PWR_GET_FLAG (PWR_FLAG_SB)!=RESET)
{
__HAL_PWR_CLEAR_FLAG (PWR_FLAG_SB);
}
HAL_PWR_DisableWakeUpPin (PWR_WAKEUP_PIN1);
If (__HAL_PWR_GET_FLAG (PWR_FLAG_WU)!=RESET)
HAL_PWR_EnterSTANDBYMode ();
While (1)
{
}
}
Part in the picture, the red box, I think the literal translation means that these two signs, one is used to indicate who enter standby mode; The other one is has been awakened, by judging the, think that the device has reached the standby mode, you can send data; If not entered, then enter the standby, do not send data,
CodePudding user response:
How no one replyCodePudding user response:
Can add a logo, said just on electricity, has not been sent