| 
									
										
										
										
											2023-06-10 11:52:00 +08:00
										 |  |  | #ifndef dev_backup_h__
 | 
					
						
							|  |  |  | #define dev_backup_h__
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "stdint.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // 定义复位类型
 | 
					
						
							|  |  |  | #define REBOOT_APP_TO_APP       0xabcd
 | 
					
						
							|  |  |  | #define REBOOT_APP_TO_BOOT      0xbcde
 | 
					
						
							|  |  |  | #define REBOOT_BOOT_TO_APP      0x1234
 | 
					
						
							|  |  |  | #define REBOOT_BOOT_TO_BOOT     0x2345
 | 
					
						
							|  |  |  | #define REBOOT_PARAM_ERR        0xaaaa
 | 
					
						
							|  |  |  | #define REBOOT_HARD_ERR         0xbbbb
 | 
					
						
							|  |  |  | #define REBOOT_INIT             0xffff
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-12 23:37:12 +08:00
										 |  |  | // 定义boot魔数
 | 
					
						
							|  |  |  | #define BOOT_MAGIC_NUM  ((uint32_t)(('b')<<0)|(('o')<<8)|(('o')<<16)|(('t')<<24))
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-10 11:52:00 +08:00
										 |  |  | void bk_reboot_app(void); | 
					
						
							|  |  |  | void bk_reboot_boot(void); | 
					
						
							|  |  |  | void bk_reboot_updata(void); | 
					
						
							|  |  |  | void bk_reboot_guide(void); | 
					
						
							|  |  |  | void bk_reboot_param_err(void); | 
					
						
							|  |  |  | void bk_reboot_hard_err(void); | 
					
						
							|  |  |  | void bk_init(void); | 
					
						
							|  |  |  | uint32_t bk_get_boottype(void); | 
					
						
							|  |  |  | const char *bk_get_currtype(void); | 
					
						
							|  |  |  | void bk_set_wdog_fun(void (*fun)(void)); | 
					
						
							|  |  |  | void *bk_wdog_fun(void); | 
					
						
							|  |  |  | uint32_t bk_reboot_times(void); | 
					
						
							| 
									
										
										
										
											2023-10-12 23:37:12 +08:00
										 |  |  | int bk_check_magic_num(void); | 
					
						
							| 
									
										
										
										
											2023-06-10 11:52:00 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 |