comparison src/start.asm @ 441:360acdcda0d7

+BUGFIX: Compatibility with "hwOS Config" fixed +NEW: New hardware descriptor command 0x60 added (For PC programs)
author heinrichsweikamp
date Tue, 26 Jul 2016 12:08:29 +0200
parents 4b93354b7738
children 84bb5cbebe57
comparison
equal deleted inserted replaced
440:36a9ac914ce3 441:360acdcda0d7
62 bsf LEDr ; Status LED 62 bsf LEDr ; Status LED
63 bcf pressure_refresh 63 bcf pressure_refresh
64 ; First pass will not have valid temperature! 64 ; First pass will not have valid temperature!
65 btfss pressure_refresh ; Air pressure compensation 65 btfss pressure_refresh ; Air pressure compensation
66 bra $-2 66 bra $-2
67 bcf LEDr 67 ; Second pass
68 ; Second pass
69 bcf pressure_refresh 68 bcf pressure_refresh
70 btfss pressure_refresh ; Air pressure compensation 69 btfss pressure_refresh ; Air pressure compensation
71 bra $-2 70 bra $-2
72 71 bcf LEDr
72
73 clrf rel_pressure+0 73 clrf rel_pressure+0
74 clrf rel_pressure+1 74 clrf rel_pressure+1
75 clrf surface_interval+0 75 clrf surface_interval+0
76 clrf surface_interval+1 76 clrf surface_interval+1
77 77
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 and return to "power_on_return:" 139 goto use_old_batteries ; No, load last stored battery values and return to "power_on_return:"
140
141 ; bsf LEDg
140 goto new_battery_menu ; No, show "New battery dialog" and return to "power_on_return:" 142 goto new_battery_menu ; No, show "New battery dialog" and return to "power_on_return:"
141 143
142 global power_on_return 144 global power_on_return
143 power_on_return: 145 power_on_return:
144 bsf RCON,POR ; Set bit for next detection 146 bsf RCON,POR ; Set bit for next detection
163 incf EEADR,F ; set to 0x102 165 incf EEADR,F ; set to 0x102
164 call read_eeprom ; read current version y 166 call read_eeprom ; read current version y
165 movff EEDATA,temp2 167 movff EEDATA,temp2
166 clrf EEADRH ; Reset EEADRH 168 clrf EEADRH ; Reset EEADRH
167 169
168 movlw softwareversion_x 170 ; movlw softwareversion_x
169 cpfseq temp1 ; compare version x 171 ; cpfseq temp1 ; compare version x
170 bra check_firmware_new ; is not equal -> reset CF and store new version in EEPROM 172 bra check_firmware_new ; is not equal -> reset CF and store new version in EEPROM
171 173
172 movlw softwareversion_y 174 movlw softwareversion_y
173 cpfseq temp2 ; compare version y 175 cpfseq temp2 ; compare version y
174 bra check_firmware_new ; is not equal -> reset CF and store new version in EEPROM 176 bra check_firmware_new ; is not equal -> reset CF and store new version in EEPROM
279 bra restart2 ; No 281 bra restart2 ; No
280 282
281 call lt2942_init ; Yes, init battery gauge IC 283 call lt2942_init ; Yes, init battery gauge IC
282 bcf optical_input ; Clear flag 284 bcf optical_input ; Clear flag
283 285
286 banksel 0xF16
284 bcf ANCON0,7 ; AN7 Digital input 287 bcf ANCON0,7 ; AN7 Digital input
288 banksel common
285 bcf lightsen_power ; Power-down ambient light sensor 289 bcf lightsen_power ; Power-down ambient light sensor
286 bcf ambient_sensor ; Clear flag 290 bcf ambient_sensor ; Clear flag
291 nop
287 btfss PORTF,2 ; Light sensor available? 292 btfss PORTF,2 ; Light sensor available?
288 bsf ambient_sensor ; Yes. 293 bsf ambient_sensor ; Yes.
294 banksel 0xF16
289 bsf ANCON0,7 ; AN7 Analog again 295 bsf ANCON0,7 ; AN7 Analog again
290 bsf lightsen_power ; Power-up ambient light sensor 296 banksel common
297 bsf lightsen_power ; Power-up ambient light sensor again
291 298
292 restart2: 299 restart2:
293 btfsc vusb_in 300 btfsc vusb_in
294 bra restart3 ; USB (and powered on) 301 bra restart3 ; USB (and powered on)
295 bcf PORTE,0 ; Start comms 302 bcf PORTE,0 ; Start comms