diff src/comm.asm @ 273:12ee30cbced9

CHANGE: Automatically abort connection fail after 2mins (Bluetooth only)
author heinrichsweikamp
date Mon, 04 May 2015 12:56:07 +0200
parents 1207cf9a9408
children 653a3ab08062
line wrap: on
line diff
--- a/src/comm.asm	Wed Apr 29 16:54:58 2015 +0200
+++ b/src/comm.asm	Mon May 04 12:56:07 2015 +0200
@@ -219,7 +219,7 @@
     goto    0x1FF0C
 
 ;-----------------------------------------------------------------------------
-; Sends external flash from 0x3E0000 to 0x3FD000 (118784bytes) via comm
+; send firmware to bootloader
 ;
 comm_send_firmware:
     movlw   0x50                            ; send echo
@@ -371,7 +371,7 @@
 	call	rs232_get_byte
 	btfsc	rs232_recieve_overflow			; Got byte?
 	bra		comm_download_mode0				; No, Done.
-	movff	RCREG1,up
+    movff   RCREG1,up
 	call	rs232_get_byte
 	btfsc	rs232_recieve_overflow			; Got byte?
 	bra		comm_download_mode0				; No, Done.
@@ -386,8 +386,13 @@
     bnz     $+4
     decf    hi,F
 
-; 6bytes received, send data
-comm_send_range2:						; needs ext_flash_address:3 start address and up:hi:lo amount
+    movlw   0x40
+    cpfslt  up                          ; Abort when up > 0x3F
+    bra		comm_download_mode0			; Abort
+
+    ; 6bytes received, send data
+    ; needs ext_flash_address:3 start address and up:hi:lo amount
+
 	call	ext_flash_read_block_start
 	movwf	TXREG1
 
@@ -547,7 +552,7 @@
 	movlw	0x50
 	cpfseq	RCREG1
 	bra		$+4
-	bra		comm_send_firmware          ; sends firmware from external flash from 0x3E0000 to 0x3FD000 (118784bytes) via comm
+	bra		comm_send_firmware          ; send firmware to bootloader
 ;	movlw	"t"
 ;	cpfseq	RCREG1
 ;	bra		$+4