Explorar el Código

add switch bootloader command

Signed-off-by: FuangCao <cavan.cao@foxmail.com>
FuangCao hace 5 años
padre
commit
adc314ffa9
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      Application/app/iap.c

+ 4 - 0
Application/app/iap.c

@@ -59,6 +59,10 @@ void process_iap_message(can_frame_t *frame, int len){
 			iap_read_string(frame);
 			break;
 		case CAN_KEY_REBOOT:
+			if (len == 4 && shark_decode_u32(frame->data) == SHARK_IAP_MAGIC_SUCCESS) {
+				fmc_iap_write_magic(0xFFFFFFFF);
+			}
+
 			shark_timer_post(&_reboot_timer, 100);
 			protocol_send_ack(frame->head.can_addr, frame->key, 1);
 			break;