comparison src/start.asm @ 656:8af5aefbcdaf default tip

Update to 3.31 beta
author heinrichsweikamp
date Thu, 27 Nov 2025 18:32:58 +0100
parents 75e90cd0c2c3
children
comparison
equal deleted inserted replaced
655:c7b7b8a358cd 656:8af5aefbcdaf
142 142
143 ; get screen type (2) from bootloader info 143 ; get screen type (2) from bootloader info
144 bsf screen_type2 ; set flags for later clear of the false one 144 bsf screen_type2 ; set flags for later clear of the false one
145 bsf screen_type3 ; ... 145 bsf screen_type3 ; ...
146 bsf screen_type4 ; ... 146 bsf screen_type4 ; ...
147 bsf screen_type5 ; ...
147 movlw 0x80 ; set up read from 0x01F780 148 movlw 0x80 ; set up read from 0x01F780
148 movwf TBLPTRL ; ... 149 movwf TBLPTRL ; ...
149 ;movlw 0xF7 ; high and upper are still at 0x01F7xx 150 ;movlw 0xF7 ; high and upper are still at 0x01F7xx
150 ;movwf TBLPTRH ; ... 151 ;movwf TBLPTRH ; ...
151 ;movlw 0x01 ; ... 152 ;movlw 0x01 ; ...
158 cpfseq TABLAT ; equal? 159 cpfseq TABLAT ; equal?
159 bcf screen_type3 ; NO - not screen type 3 160 bcf screen_type3 ; NO - not screen type 3
160 movlw 0x85 ; coding for screen type 4 161 movlw 0x85 ; coding for screen type 4
161 cpfseq TABLAT ; equal? 162 cpfseq TABLAT ; equal?
162 bcf screen_type4 ; NO - not screen type 4 163 bcf screen_type4 ; NO - not screen type 4
164 movlw 0x86 ; coding for screen type 5
165 cpfseq TABLAT ; equal?
166 bcf screen_type5 ; NO - not screen type 5
163 167
164 bcf dn_flag 168 bcf dn_flag
165 btfsc screen_type4 169 btfsc screen_type4
170 bsf dn_flag
171 btfsc screen_type5
166 bsf dn_flag 172 bsf dn_flag
167 173
168 ; get button polarity from configuration data (EEPROM) 174 ; get button polarity from configuration data (EEPROM)
169 EEPROM_CC_READ eeprom_button_polarity,button_polarity 175 EEPROM_CC_READ eeprom_button_polarity,button_polarity
170 176
363 369
364 ; configure the OSTC model descriptor (stored in HW_descriptor) 370 ; configure the OSTC model descriptor (stored in HW_descriptor)
365 bcf tft_power ; inverted, here needed for I2C_probe_OSTC_rx, to wake-up RX circuity 371 bcf tft_power ; inverted, here needed for I2C_probe_OSTC_rx, to wake-up RX circuity
366 bsf ambient_sensor ; set ambient light sensor as available by default 372 bsf ambient_sensor ; set ambient light sensor as available by default
367 bsf ext_input_optical ; set optical input as available by default 373 bsf ext_input_optical ; set optical input as available by default
374 bcf ext_s8_full_digital ; clear flag
368 375
369 call lt2942_get_status ; check for gauge IC 376 call lt2942_get_status ; check for gauge IC
370 btfss battery_gauge_available ; OSTC 2, cR or TR? 377 btfss battery_gauge_available ; OSTC 2, cR or TR?
371 bra restart2 ; NO 378 bra restart2 ; NO
372 379
373 ; OSTC 2, cR or TR 380 ; OSTC 2, cR or TR
374 call lt2942_init ; initialize battery gauge IC 381 call battery_gauge_init ; initialize battery gauge IC
382 call lt2942_get_voltage
375 bcf ext_input_optical ; OSTC 2, cR and TR do not have an optical input 383 bcf ext_input_optical ; OSTC 2, cR and TR do not have an optical input
376 384
377 banksel ANCON0 ; ANCON0 is outside access RAM 385 banksel ANCON0 ; ANCON0 is outside access RAM
378 bcf ANCON0,7 ; AN7 digital input 386 bcf ANCON0,7 ; AN7 digital input
379 banksel common ; back to bank common 387 banksel common ; back to bank common
386 bsf ANCON0,7 ; AN7 analog again 394 bsf ANCON0,7 ; AN7 analog again
387 banksel common ; back to bank common 395 banksel common ; back to bank common
388 bsf lightsen_power ; power-up ambient light sensor again 396 bsf lightsen_power ; power-up ambient light sensor again
389 397
390 restart2: 398 restart2:
391 btfsc less_io_cpu ; Less I/O CPU found? 399 ; Dual comm hardware (USB and BLE-only)?
400 bsf dual_comm ; assume dual comm hardware by default
401 movlw 0xFC ; set up read from 0x01FFFC
402 movwf TBLPTRL ; ...
403 movlw 0xFF ; ...
404 movwf TBLPTRH ; ...
405 movlw 0x01 ; ...
406 movwf TBLPTRU ; ...
407 TBLRD*+ ; read configuration byte
408 movlw 0x6E ; coding for dual comm
409 cpfseq TABLAT ; equal?
410 bcf dual_comm ; NO
411 TBLRD*+ ; read configuration byte
412 movlw 0x61 ; coding for dual comm
413 cpfseq TABLAT ; equal?
414 bcf dual_comm ; NO
415 TBLRD*+ ; read configuration byte
416 movlw 0x6E ; coding for dual comm
417 cpfseq TABLAT ; equal?
418 bcf dual_comm ; NO
419 TBLRD*+ ; read configuration byte
420 movlw 0x6F ; coding for dual comm
421 cpfseq TABLAT ; equal?
422 bcf dual_comm ; NO
423
424 btfsc dual_comm
425 bcf ambient_sensor ; dual-comm has no ambient sensor
426
427 btfsc less_io_cpu ; Less I/O CPU found?
392 bsf ble_available ; Yes, must have BLE (old or new) 428 bsf ble_available ; Yes, must have BLE (old or new)
393 IFNDEF _hwos_sport 429 IFNDEF _hwos_sport
394 btfsc vusb_in ; USB power detected? 430 btfsc vusb_in ; USB power detected?
395 bra restart3 ; YES - no BT then 431 bra restart3 ; YES - no BT then
396 bcf ble_npower ; NO - power up BT chip (if available) 432 bcf ble_npower ; NO - power up BT chip (if available)
400 ENDIF 436 ENDIF
401 bsf ble_available ; YES - BT available 437 bsf ble_available ; YES - BT available
402 438
403 restart3: 439 restart3:
404 bsf ble_npower ; power down BT chip (if available) 440 bsf ble_npower ; power down BT chip (if available)
405 IFDEF _external_sensor ; Compiled for external analog interface? 441 IFDEF _external_sensor_eccr ; Compiled for external analog interface?
406 bsf ext_input_s8_ana ; YES - Set the flag 442 bsf ext_input_s8_ana ; YES - Set the flag
407 call eeprom_serial_number_read ; read OSTC serial number 443 call eeprom_serial_number_read ; read OSTC serial number
408 movlw .31 444 movlw .31
409 cpfslt hi ; bigger than WREG? 445 cpfslt hi ; bigger than WREG?
410 bsf ble_available ; NO - must be new OSTC+ with interface 446 bsf ble_available ; NO - must be new OSTC+ with interface
582 ; 618 ;
583 global restart_set_modes_and_flags 619 global restart_set_modes_and_flags
584 restart_set_modes_and_flags: 620 restart_set_modes_and_flags:
585 call disable_ir_s8_analog ; switch off IR/S8/analog interface by default (for all compile versions!) 621 call disable_ir_s8_analog ; switch off IR/S8/analog interface by default (for all compile versions!)
586 622
587 IFDEF _external_sensor 623 IFDEF _external_sensor_eccr
588 WAITMS d'100' ; wait 100 ms to S8-HUD powered down properly 624 WAITMS d'100' ; wait 100 ms to S8-HUD powered down properly
589 ENDIF 625 ENDIF
590 626
591 ; setup sampling rate for dice data recording 627 ; setup sampling rate for dice data recording
592 movlw .2 ; default to 2 seconds 628 movlw .2 ; default to 2 seconds
637 bsf FLAG_ccr_mode ; YES - set CCR flag 673 bsf FLAG_ccr_mode ; YES - set CCR flag
638 call option_cleanup_oCCRMode_CCR ; - revert CCR mode 'Sensor' to 'fixed SP' if no sensor interface available 674 call option_cleanup_oCCRMode_CCR ; - revert CCR mode 'Sensor' to 'fixed SP' if no sensor interface available
639 IFDEF _rx_functions 675 IFDEF _rx_functions
640 call option_cleanup_oTrMode_CCR ; - revert TR mode from 'ind.double' to 'on' 676 call option_cleanup_oTrMode_CCR ; - revert TR mode from 'ind.double' to 'on'
641 ENDIF ; _rx_functions 677 ENDIF ; _rx_functions
642 IFDEF _external_sensor 678 IFDEF _external_sensor_eccr
643 call enable_ir_s8_analog ; - enable IR/S8/analog interface 679 call enable_ir_s8_analog ; - enable IR/S8/analog interface
644 ENDIF ; _external_sensor 680 ENDIF ; _external_sensor_eccr
645 ENDIF ; _ccr_pscr 681 ENDIF ; _ccr_pscr
646 return ; - done 682 return ; - done
647 683
648 restart_set_modes_and_flags4: 684 restart_set_modes_and_flags4:
649 decfsz lo,F ; Gauge mode? 685 decfsz lo,F ; Gauge mode?
671 bsf FLAG_pscr_mode ; - set pSCR mode flag 707 bsf FLAG_pscr_mode ; - set pSCR mode flag
672 call option_cleanup_oCCRMode_pSCR ; - revert AutoSP to calculated SP, additionally revert Sensor to fixed SP if no sensor interface available 708 call option_cleanup_oCCRMode_pSCR ; - revert AutoSP to calculated SP, additionally revert Sensor to fixed SP if no sensor interface available
673 IFDEF _rx_functions 709 IFDEF _rx_functions
674 call option_cleanup_oTrMode_no_CCR ; - revert TR mode from 'CCR Dil+O2' to 'on' 710 call option_cleanup_oTrMode_no_CCR ; - revert TR mode from 'CCR Dil+O2' to 'on'
675 ENDIF ; _rx_functions 711 ENDIF ; _rx_functions
676 IFDEF _external_sensor 712 IFDEF _external_sensor_eccr
677 call enable_ir_s8_analog ; - enable IR/S8/analog interface 713 call enable_ir_s8_analog ; - enable IR/S8/analog interface
678 ENDIF ; _external_sensor 714 ENDIF ; _external_sensor_eccr
679 ENDIF ; _ccr_pscr 715 ENDIF ; _ccr_pscr
680 return ; - done 716 return ; - done
681 717
682 ;----------------------------------------------------------------------------- 718 ;-----------------------------------------------------------------------------
683 719