comparison src/start.asm @ 648:aeca5717d9eb

3.17 / 10.72 release
author heinrichs weikamp
date Fri, 04 Mar 2022 08:29:36 +0100
parents 7d8a4c60ec1a
children bc214815deb2
comparison
equal deleted inserted replaced
647:357341239438 648:aeca5717d9eb
42 extern get_first_gas_to_WREG 42 extern get_first_gas_to_WREG
43 43
44 extern oFirmwareMajor 44 extern oFirmwareMajor
45 extern oFirmwareMinor 45 extern oFirmwareMinor
46 extern oPressureAdjust 46 extern oPressureAdjust
47 extern get_cpu_version
47 48
48 IFDEF _ccr_pscr 49 IFDEF _ccr_pscr
49 extern option_cleanup_oCCRMode_pSCR 50 extern option_cleanup_oCCRMode_pSCR
50 extern option_cleanup_oCCRMode_CCR 51 extern option_cleanup_oCCRMode_CCR
51 extern get_first_dil_to_WREG 52 extern get_first_dil_to_WREG
118 movlw .4 ; 62,5ms * 4 = 1/4 second 119 movlw .4 ; 62,5ms * 4 = 1/4 second
119 movff WREG,isr_tmr7_helper 120 movff WREG,isr_tmr7_helper
120 121
121 ; initialize hardware (ports, timers) and start interrupts 122 ; initialize hardware (ports, timers) and start interrupts
122 call init_ostc ; also selects bank common and sets CPU to normal speed 123 call init_ostc ; also selects bank common and sets CPU to normal speed
124
125 ; get CPU type and set less_io_cpu bit
126 call get_cpu_version
123 127
124 ; flag that later restart origins from a cold start 128 ; flag that later restart origins from a cold start
125 bsf cold_start 129 bsf cold_start
126 130
127 ; get button type from bootloader info 131 ; get button type from bootloader info
158 EEPROM_CC_READ eeprom_button_polarity,button_polarity 162 EEPROM_CC_READ eeprom_button_polarity,button_polarity
159 163
160 ; initialize pressure sensor calibration 164 ; initialize pressure sensor calibration
161 call I2C_probe_pressure_sensor ; Probe the type of sensor, set/clear press_sensor_type 165 call I2C_probe_pressure_sensor ; Probe the type of sensor, set/clear press_sensor_type
162 call get_calibration_data ; get calibration data from pressure sensor 166 call get_calibration_data ; get calibration data from pressure sensor
163 167
164 call TFT_DisplayOff ; turn off display 168 call TFT_DisplayOff ; turn off display
165 bsf LEDr ; turn on red LED 169 bsf LEDr ; turn on red LED
166 170
167 ; wait for valid temperature and pressure 171 ; wait for valid temperature and pressure
168 btfsc press_sensor_type ; New sensor found? 172 btfsc press_sensor_type ; New sensor found?
377 bsf ANCON0,7 ; AN7 analog again 381 bsf ANCON0,7 ; AN7 analog again
378 banksel common ; back to bank common 382 banksel common ; back to bank common
379 bsf lightsen_power ; power-up ambient light sensor again 383 bsf lightsen_power ; power-up ambient light sensor again
380 384
381 restart2: 385 restart2:
386 btfsc less_io_cpu ; Less I/O CPU found?
387 bsf ble_available ; Yes, must have BLE (old or new)
382 IFNDEF _hwos_sport 388 IFNDEF _hwos_sport
383 btfsc vusb_in ; USB power detected? 389 btfsc vusb_in ; USB power detected?
384 bra restart3 ; YES - no BT then 390 bra restart3 ; YES - no BT then
385 bcf PORTE,0 ; NO - power up BT chip (if available) 391 bcf PORTE,0 ; NO - power up BT chip (if available)
386 WAITMS d'5' ; - wait 5 ms 392 WAITMS d'5' ; - wait 5 ms