Mercurial > public > hwos_code
comparison src/menu_tree.asm @ 477:44b8a826b314
NEW: Show battery type in surface mode next to battery voltage
author | heinrichsweikamp |
---|---|
date | Mon, 16 Jan 2017 11:59:55 +0100 |
parents | 2880aa1264f5 |
children | ad8acade5567 |
comparison
equal
deleted
inserted
replaced
476:7c10557c248e | 477:44b8a826b314 |
---|---|
744 global use_old_prior_209 | 744 global use_old_prior_209 |
745 use_old_prior_209: | 745 use_old_prior_209: |
746 clrf EEADRH | 746 clrf EEADRH |
747 read_int_eeprom 0x0F ; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah | 747 read_int_eeprom 0x0F ; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah |
748 incfsz EEDATA,F ; Was 0xFF? | 748 incfsz EEDATA,F ; Was 0xFF? |
749 bra use_old_prior_209_2 ; Yes | 749 return ; No, done. |
750 return | 750 |
751 use_old_prior_209_2: | |
752 call lt2942_get_status ; Check for gauge IC | 751 call lt2942_get_status ; Check for gauge IC |
753 movlw .3 ; Assume a 18650 | 752 movlw .3 ; Assume a 18650 |
754 btfss battery_gauge_available ; cR/2 hardware? | 753 btfss battery_gauge_available ; cR/2 hardware? |
755 movlw .1 ; Assume a Saft | 754 movlw .1 ; Assume a Saft |
756 movwf EEDATA | 755 movwf EEDATA |
774 movff EEDATA,battery_gauge+5 | 773 movff EEDATA,battery_gauge+5 |
775 read_int_eeprom 0x0F | 774 read_int_eeprom 0x0F |
776 movff EEDATA,battery_type; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah | 775 movff EEDATA,battery_type; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah |
777 | 776 |
778 rcall setup_new_saft ; Any other value | 777 rcall setup_new_saft ; Any other value |
779 incf EEDATA,F | 778 incf EEDATA,F ; 1 ... 5 |
780 dcfsnz EEDATA,F | 779 dcfsnz EEDATA,F |
781 rcall setup_new_15v ;=0 | 780 rcall setup_new_15v ;=0 |
782 dcfsnz EEDATA,F | 781 dcfsnz EEDATA,F |
783 rcall setup_new_saft ;=1 | 782 rcall setup_new_saft ;=1 |
784 dcfsnz EEDATA,F | 783 dcfsnz EEDATA,F |
785 rcall setup_new_panasonic ;=2 | 784 rcall setup_new_panasonic ;=2 |
786 dcfsnz EEDATA,W | 785 dcfsnz EEDATA,F |
787 rcall setup_new_18650 ;=3 | 786 rcall setup_new_18650 ;=3 |
788 dcfsnz EEDATA,W | 787 dcfsnz EEDATA,F |
789 rcall setup_new_16650 ;=4 | 788 rcall setup_new_16650 ;=4 |
790 | 789 |
791 bcf use_old_batt_flag ; clear flag | 790 bcf use_old_batt_flag ; clear flag |
792 goto surfloop ; Jump to Surfaceloop! | 791 goto surfloop ; Jump to Surfaceloop! |
793 | 792 |