comparison src/start.asm @ 614:a32212cd5ea9

work on new battery menu
author heinrichsweikamp
date Wed, 30 Jan 2019 21:46:42 +0100
parents 6dd6b37da7c8
children b87f23fae743
comparison
equal deleted inserted replaced
613:8077ee960199 614:a32212cd5ea9
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File start.asm REFACTORED VERSION V2.99e 3 ; File start.asm REFACTORED VERSION V2.99g
4 ; 4 ;
5 ; Startup subroutines 5 ; Startup subroutines
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
91 cpfseq TABLAT 91 cpfseq TABLAT
92 bcf analog_switches 92 bcf analog_switches
93 93
94 ; get screen type (2) from Bootloader-Info 94 ; get screen type (2) from Bootloader-Info
95 bsf screen_type2 95 bsf screen_type2
96 movlw 0x80 96 movlw 0x80
97 movwf TBLPTRL ; Only adjust low byte. High and Upper are still 0x01F7... 97 movwf TBLPTRL ; only adjust low byte, high and upper are still 0x01F7...
98 TBLRD*+ ; Reads 0x83 for screen 2 98 TBLRD*+ ; reads 0x83 if OSTC has screen type 2
99 movlw 0x83 99 movlw 0x83
100 cpfseq TABLAT 100 cpfseq TABLAT
101 bcf screen_type2 101 bcf screen_type2
102 102
103 ; read button polarity 103 ; read button polarity
104 movlw LOW .897 104 movlw LOW .897
105 movwf EEADR 105 movwf EEADR
106 movlw HIGH .897 106 movlw HIGH .897
370 WAITMS d'200' 370 WAITMS d'200'
371 call I2C_probe_OSTC_rx ; set ostc_rx_present flag if this is an OSTC TR model 371 call I2C_probe_OSTC_rx ; set ostc_rx_present flag if this is an OSTC TR model
372 372
373 ; The hardware descriptor is now: 373 ; The hardware descriptor is now:
374 ; 0x11: 2 with BLE 374 ; 0x11: 2 with BLE
375 ; 0x13: +/2 with BLE & ambient 375 ; 0x12; Sport
376 ; 0x13: +/2 with BLE & ambient ; PLUS ??? OSTC 3 (2016) ???
376 ; 0x05: cR 377 ; 0x05: cR
377 ; 0x0A: 3 378 ; 0x0A: 3
378 ; 0x1A: 3 with BLE 379 ; 0x1A: 3 with BLE
379 ; 0x33: 2 TR 380 ; 0x33: 2 TR
380 381
414 415
415 btfsc use_old_batt_flag ; =1: load old battery information after power-on reset 416 btfsc use_old_batt_flag ; =1: load old battery information after power-on reset
416 goto use_old_batteries ; returns to surface loop 417 goto use_old_batteries ; returns to surface loop
417 418
418 btfsc RCON,POR ; was this a power-on reset? 419 btfsc RCON,POR ; was this a power-on reset?
419 goto surfloop ; YES - jump to surface loop 420 goto surfloop ; NO - jump to surface loop
420 bsf RCON,POR ; set bit for next detection 421 bsf RCON,POR ; set bit for next detection
421 ; Things to do after a power-on reset 422 ; Things to do after a power-on reset
422 goto do_new_battery_select ; returns to surface loop 423 goto do_new_battery_select ; returns to surface loop
423 424
424 ;============================================================================= 425 ;=============================================================================