Răsfoiți Sursa

重写SOS,关机逻辑

xuxinyi 2 luni în urmă
părinte
comite
8f5ad6cb84
3 a modificat fișierele cu 4 adăugiri și 2 ștergeri
  1. 1 0
      Core/Inc/RTC_SLEEP.h
  2. 1 0
      Core/Inc/main.h
  3. 2 2
      Core/Src/main.c

+ 1 - 0
Core/Inc/RTC_SLEEP.h

@@ -31,6 +31,7 @@ typedef struct {
 
 extern RTC_DateTimeTypeDef firstPressTime;
 extern RTC_SOS_key_struct SOS_key_struct;
+extern uint8_t RTC_Sleep_Flag;
 
 void RTC_GetDateTime(RTC_HandleTypeDef *hrtc, RTC_DateTimeTypeDef *datetime);
 

+ 1 - 0
Core/Inc/main.h

@@ -73,6 +73,7 @@ void Error_Handler(void);
 /* USER CODE BEGIN Private defines */
 
 #define FLASH_USER_ADDR   0x0800FC00  // 用户存储页(最后 1KB)
+
 extern uint8_t rx_buf[25];
 extern uint8_t rx_buf_uart2[25];
 extern uint8_t rx_buf_uart2_DMA[25];

+ 2 - 2
Core/Src/main.c

@@ -337,8 +337,8 @@ int main(void)
 
   /* Infinite loop */
   /* USER CODE BEGIN WHILE */
-  // RTC_DateTimeTypeDef now;
-  // RTC_GetDateTime(&hrtc, &now);
+  RTC_DateTimeTypeDef now;
+  RTC_GetDateTime(&hrtc, &now);
 
   printf("Device is ready\r\n");
   printf("设备地址:0x%02X%02X\n", deviceInfo.loraDeviceAddress_H, deviceInfo.loraDeviceAddress_L);