Mercurial > public > hwos_code
comparison src/start.asm @ 416:4389fe9673b2
NEW: Support for new logbook memory chip (minor hardware change)
BUGFIX: Button sensitivity was not reset after update in some cases
author | heinrichsweikamp |
---|---|
date | Mon, 18 Apr 2016 14:34:57 +0200 |
parents | d3087a8ed7e1 |
children | ceb1b7329dce |
comparison
equal
deleted
inserted
replaced
415:fd3865a82519 | 416:4389fe9673b2 |
---|---|
133 extern new_battery_menu,use_old_batteries | 133 extern new_battery_menu,use_old_batteries |
134 ; ***************************************************************************** | 134 ; ***************************************************************************** |
135 ; "new_battery_menu" and "use_old_batteries" 'goto' back to "power_on_return" | 135 ; "new_battery_menu" and "use_old_batteries" 'goto' back to "power_on_return" |
136 ; ***************************************************************************** | 136 ; ***************************************************************************** |
137 | 137 |
138 btfsc RCON,POR ; Was this a power-on reset? | 138 btfsc RCON,POR ; Was this a power-on reset? |
139 goto use_old_batteries ; No, load last stored battery values | 139 goto use_old_batteries ; No, load last stored battery values and return to "power_on_return:" |
140 goto new_battery_menu ; No, show "New battery dialog" and return to "power_on_return:" | |
141 | |
142 global power_on_return | |
143 power_on_return: | |
144 bsf RCON,POR ; Set bit for next detection | |
140 | 145 |
141 call lt2942_get_status ; Check for gauge IC | 146 call lt2942_get_status ; Check for gauge IC |
142 | |
143 btfss rechargeable ; cR or 2 hardware? | 147 btfss rechargeable ; cR or 2 hardware? |
144 goto new_battery_menu ; No, show "New battery dialog" | 148 bra power_on_return2 ; no |
145 | 149 |
146 movlw .30 | 150 movlw .30 |
147 movff WREG,opt_cR_button_right | 151 movff WREG,opt_cR_button_right |
148 movff WREG,opt_cR_button_left ; Reset on power-on reset | 152 movff WREG,opt_cR_button_left ; Reset on power-on reset |
149 call piezo_config ; Yes, configure buttons | 153 call piezo_config ; Yes, configure buttons |
150 goto use_old_batteries ; Yes, load last stored battery values | 154 call piezo_config ; Yes, configure buttons (2 times) |
151 | 155 |
152 global power_on_return | 156 power_on_return2: |
153 power_on_return: | |
154 bsf RCON,POR ; Set bit for next detection | |
155 | |
156 ; check firmware and reset Custom Functions after an update | 157 ; check firmware and reset Custom Functions after an update |
157 movlw d'1' | 158 movlw d'1' |
158 movwf EEADR ; =1 | 159 movwf EEADR ; =1 |
159 movwf EEADRH ; =1 | 160 movwf EEADRH ; =1 |
160 call read_eeprom ; read current version x | 161 call read_eeprom ; read current version x |