diff src/ghostwriter.asm @ 455:85b533b7a18c

NEW: Store more battery info into logbook memory
author heinrichsweikamp
date Tue, 27 Sep 2016 16:40:14 +0200
parents b4f28ab23b87
children b4417044a042
line wrap: on
line diff
--- a/src/ghostwriter.asm	Tue Sep 27 16:03:31 2016 +0200
+++ b/src/ghostwriter.asm	Tue Sep 27 16:40:14 2016 +0200
@@ -633,8 +633,11 @@
     movf    hi,W
     rcall	ghostwrite_byte_header	; WREG -> Header in ext. flash
 
-    ; Spare at Byte 59
-    movlw   0xFF
+    ; Battery info at Byte 59
+    movff   battery_type,lo		; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah
+    swapf   lo,F
+    movf    batt_percent,W		; 0-100
+    addwf   lo,W			; upper 4 bits: battery_type, lower 4 bits: batt_percent
     rcall	ghostwrite_byte_header	; WREG -> Header in ext. flash
     ; Store 5 Setpoints
     movff   char_I_setpoint_cbar+0,WREG