comparison src/tft_outputs.asm @ 453:b4f28ab23b87

NEW: Show Uptime (Time since last firmware boot) in information menu
author heinrichsweikamp
date Mon, 19 Sep 2016 16:32:02 +0200
parents d93d75ae01bf
children 0ef84436df32
comparison
equal deleted inserted replaced
452:55dcf1b248f2 453:b4f28ab23b87
8 ;============================================================================= 8 ;=============================================================================
9 ; HISTORY 9 ; HISTORY
10 ; 2011-08-07 : [mH] moving from OSTC code 10 ; 2011-08-07 : [mH] moving from OSTC code
11 11
12 #include "hwos.inc" ; Mandatory header 12 #include "hwos.inc" ; Mandatory header
13 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c 13 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c
14 #include "tft.inc" 14 #include "tft.inc"
15 #include "wait.inc" 15 #include "wait.inc"
16 #include "strings.inc" 16 #include "strings.inc"
17 #include "convert.inc" 17 #include "convert.inc"
18 #include "varargs.inc" 18 #include "varargs.inc"
19 #include "math.inc" 19 #include "math.inc"
20 #include "isr.inc" 20 #include "isr.inc"
21 #include "eeprom_rs232.inc" 21 #include "eeprom_rs232.inc"
22 #include "adc_lightsensor.inc" 22 #include "adc_lightsensor.inc"
23 #include "surfmode.inc" 23 #include "surfmode.inc"
24 #include "divemode.inc" 24 #include "divemode.inc"
25 #include "external_flash.inc" 25 #include "external_flash.inc"
26 #include "ghostwriter.inc" 26 #include "ghostwriter.inc"
27 #include "customview.inc" 27 #include "customview.inc"
28 #include "i2c.inc" 28 #include "i2c.inc"
29 #include "colorschemes.inc" 29 #include "colorschemes.inc"
30 #include "calibrate.inc" 30 #include "calibrate.inc"
31 31
2953 output_16dp .2 ; x.xxx 2953 output_16dp .2 ; x.xxx
2954 bcf leftbind 2954 bcf leftbind
2955 PUTC "V" 2955 PUTC "V"
2956 return 2956 return
2957 2957
2958 ; For the Information menu: Append Uptime
2959 global info_menu_uptime
2960 extern tUptime
2961 info_menu_uptime:
2962 lfsr FSR1,tUptime
2963 call strcat_text
2964 movff uptime+0,xC+0
2965 movff uptime+1,xC+1
2966 movff uptime+2,xC+2
2967 movff uptime+3,xC+3
2968 movlw LOW .3600
2969 movwf xB+0
2970 movlw HIGH .3600
2971 movwf xB+1 ; One day = 3600s
2972 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
2973 ;xC+0:xC+1 -> Full hours
2974 movff xC+1,xA+1
2975 movff xC+0,xA+0
2976 clrf xB+1
2977 movlw .24
2978 movwf xB+0
2979 call div16x16 ;xA/xB=xC with xA+0 as remainder
2980 movff xC+0,lo
2981 movff xC+1,hi ; Full days
2982 bsf leftbind
2983 output_16
2984 PUTC "d"
2985 movff xA+0,lo ; Full hours
2986 output_8
2987 PUTC "h"
2988 bcf leftbind
2989 return ; Done.
2990
2958 ;----------------------------------------------------------------------------- 2991 ;-----------------------------------------------------------------------------
2959 ; ppO2 menu 2992 ; ppO2 menu
2960 global divesets_ppo2_max 2993 global divesets_ppo2_max
2961 extern tPPO2Max 2994 extern tPPO2Max
2962 extern tbar 2995 extern tbar