Bläddra i källkod

before reboot, need save soc

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 4 år sedan
förälder
incheckning
789013a43c
1 ändrade filer med 3 tillägg och 0 borttagningar
  1. 3 0
      Application/app/iap.c

+ 3 - 0
Application/app/iap.c

@@ -22,6 +22,7 @@ void process_iap_message(can_frame_t *frame, int len){
 				wdog_reload();
 				fmc_iap_write_magic(0xFFFFFFFF);
 				shark_rtc_set_backup(0x3000);
+				nv_save_all_soc();
 				NVIC_SystemReset();
 				while(1);
 			}
@@ -49,6 +50,7 @@ void process_iap_message(can_frame_t *frame, int len){
 			break;
 		case CAN_KEY_IAP_BOOT:
 			if (_write_success) {
+				nv_save_all_soc();
 				NVIC_SystemReset();
 				while(1);
 			} else {
@@ -83,6 +85,7 @@ void process_iap_message(can_frame_t *frame, int len){
 }
 
 void _reboot_timer_handler(shark_timer_t *t){
+	nv_save_all_soc();
 	NVIC_SystemReset();
 }