'ram_component_set': ['std_common_lib', 'mem', 'cpu', 'lpc', 'dma',
'xip_os', 'ipc', 'watchdog', 'uart', 'otp', 'efuse_v100',
'gpio_v100', 'spi', 'qspi', 'cpu_trace', 'time_set', 'security',
- 'update_recovery', 'i2c', 'pmp_set', 'flash', 'button'
+ 'update_recovery', 'i2c', 'pmp_set', 'flash', 'button','calendar'
],
'bin_name': 'recovery',
'application': 'recovery',
extern void cm_sync_all_config_to_disk(void);
void uapi_poweroff_device(void)
{
-
+ //重启前要保存时间
+ uapi_calendar_store_date();
uapi_sys_shipmode(0);
}
void uapi_reboot_device(void)
{
+ //重启前要保存时间
+ uapi_calendar_store_date();
mcu_os_sys_reset(NULL,NULL);
}
} else {
printf("uapi_upg_request_upgrade OK!!\r\n");
/* app中下载后直接开始升级流程,升级流程结束后重启 */
+ uapi_calendar_store_date();
/* IOT设备重启 */
upg_reboot();
}
#endif
}
-#include "chip_system_time.h"
-void test_bandy_time(uint32_t timestamp)
-{
- struct tm tm;
- struct timeval tv;
- // uint32_t time = 1716044461; // 2024-5-18 15:1:1 网站转换:2024-05-18 23:01:01
- printf("--------SYNC TIME----------\r\n");
- get_current_timestamp();
- get_current_time(&tv, &tm);
- sync_time(timestamp, 8*4);
- get_current_timestamp();
- get_current_time(&tv, &tm);
- printf("--------SAVE TIME----------\r\n");
- get_current_timestamp();
- get_current_time(&tv, &tm);
- save_time();
- get_current_timestamp();
- get_current_time(&tv, &tm);
- printf("--------RESTORE TIME----------\r\n");
- get_current_timestamp();
- get_current_time(&tv, &tm);
- restore_time();
- get_current_timestamp();
- get_current_time(&tv, &tm);
-}
+// #include "chip_system_time.h"
+// void test_bandy_time(uint32_t timestamp)
+// {
+// struct tm tm;
+// struct timeval tv;
+// // uint32_t time = 1716044461; // 2024-5-18 15:1:1 网站转换:2024-05-18 23:01:01
+// printf("--------SYNC TIME----------\r\n");
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// sync_time(timestamp, 8*4);
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// printf("--------SAVE TIME----------\r\n");
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// save_time();
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// printf("--------RESTORE TIME----------\r\n");
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// restore_time();
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// }
void uapi_ppg_get_id(uint8_t *chip_id)
{