annotate src/comm.asm @ 629:237931377539

3.07 stable release
author heinrichsweikamp
date Fri, 29 Nov 2019 18:48:11 +0100
parents cd58f7fc86db
children 185ba2f91f59
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3 ; File comm.asm combined next generation V3.04.3
0
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; RS232 via USB
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2012, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2011-08-22 : [mH] Creation
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
11 ; 2012-02-11 : [jDG] Added "c" set custom text, and "i" identify
0
heinrichsweikamp
parents:
diff changeset
12
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 273
diff changeset
13 #include "hwos.inc"
0
heinrichsweikamp
parents:
diff changeset
14 #include "eeprom_rs232.inc"
heinrichsweikamp
parents:
diff changeset
15 #include "tft.inc"
heinrichsweikamp
parents:
diff changeset
16 #include "wait.inc"
heinrichsweikamp
parents:
diff changeset
17 #include "strings.inc"
heinrichsweikamp
parents:
diff changeset
18 #include "convert.inc"
heinrichsweikamp
parents:
diff changeset
19 #include "external_flash.inc"
heinrichsweikamp
parents:
diff changeset
20 #include "tft_outputs.inc"
heinrichsweikamp
parents:
diff changeset
21 #include "surfmode.inc"
heinrichsweikamp
parents:
diff changeset
22 #include "rtc.inc"
heinrichsweikamp
parents:
diff changeset
23 #include "adc_lightsensor.inc"
299
6c4800af27ac Make char_I_bottom_usage and char_I_deco_usage configurable from PC
heinrichsweikamp
parents: 275
diff changeset
24 #include "shared_definitions.h"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
25 #include "math.inc"
0
heinrichsweikamp
parents:
diff changeset
26
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
27 extern restart
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
28 extern option_reset_all
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
29 extern option_check_all
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
30 extern gaslist_cleanup_list
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
31 extern option_save_all
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
32 extern vault_decodata_into_eeprom
0
heinrichsweikamp
parents:
diff changeset
33
heinrichsweikamp
parents:
diff changeset
34
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
35 #DEFINE timeout_comm_pre_mode .240 ; timeout before communication is established
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
36 #DEFINE timeout_service_mode .120 ; timeout when communication is established
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
37
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
38 #DEFINE comm_title_row .0 ; positioning of title
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
39 #DEFINE comm_title_column_usb .40
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
40 #DEFINE comm_title_column_ble .25
0
heinrichsweikamp
parents:
diff changeset
41
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
42 #DEFINE comm_string_row .30 ; positioning of host-sent text messages
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
43 #DEFINE comm_string_column .40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
44
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
45 #DEFINE comm_status1_row .70 ; positioning of COMM mode status messages
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
46 #DEFINE comm_status1_column .10
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
47 #DEFINE comm_status2_row .100
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
48 #DEFINE comm_status2_column comm_status1_column
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
49 #DEFINE comm_status3_row .130
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
50 #DEFINE comm_status3_column comm_status1_column
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
51 #DEFINE comm_status4_row .160
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
52 #DEFINE comm_status4_column comm_status1_column
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
53
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
54 #DEFINE comm_warning_row .160 ; positioning of COMM mode warning messages
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
55 #DEFINE comm_warning_column .65
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
56
0
heinrichsweikamp
parents:
diff changeset
57
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
58 comm CODE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
59
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
60 ;=============================================================================
0
heinrichsweikamp
parents:
diff changeset
61
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
62 global comm_mode_usb
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
63 comm_mode_usb: ; entry point for comm mode via USB
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
64 WAITMS d'1' ; wait 1 ms
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
65 btfss vusb_in ; USB still plugged in?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
66 return ; NO - it was only a glitch, abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
67 WAITMS d'1' ; wait 1 ms
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
68 btfss vusb_in ; USB still plugged in?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
69 return ; NO - it was only a glitch, abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
70 bsf aux_flag ; YES - remember to show USB title
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
71 bra comm_mode_common ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
72
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
73 global comm_mode_ble
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
74 comm_mode_ble: ; entry point for comm mode via BLE
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
75 bcf aux_flag ; remember to show BLE title
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
76 ;bra comm_mode_common ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
77
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
78 comm_mode_common:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
79 clrf STKPTR ; clear return addresses stack
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
80 call TFT_ClearScreen ; clear screen
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
81 WIN_COLOR color_greenish ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
82 btfss aux_flag ; shall show USB title?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
83 bra comm_mode_common_1 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
84 WIN_SMALL comm_title_column_usb, comm_title_row ; YES - set USB title position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
85 STRCPY_TEXT_PRINT tUsbTitle ; - print USB title text
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
86 bra comm_mode_common_2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
87 comm_mode_common_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
88 WIN_SMALL comm_title_column_ble, comm_title_row ; set BLE title position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
89 STRCPY_TEXT_PRINT tBleTitle ; print BLE title text
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
90 comm_mode_common_2:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
91 call TFT_standard_color ; set standard color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
92 WIN_TOP .10 ; positioning of USB/BLE logo, row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
93 WIN_LEFT .1 ; positioning of USB/BLE logo, column
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
94 btfsc battery_gauge_available ; "+" bootloader ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
95 bra comm_mode_common_3 ; NO
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
96 TFT_WRITE_PROM_IMAGE_BY_ADDR usb_ble_logo_2 ; YES - show USB/BLE logo 2
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
97 bra comm_mode_common_4
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
98 comm_mode_common_3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
99 TFT_WRITE_PROM_IMAGE_BY_ADDR usb_ble_logo_1 ; NO - show USB/BLE logo 1
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
100 comm_mode_common_4:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
101 WIN_SMALL comm_status1_column,comm_status1_row ; positioning of status message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
102 STRCPY_TEXT_PRINT tUsbStarting ; print status message "starting..."
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
103 WIN_TINY .40,.240-.16 ; set output position to bottom line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
104 call TFT_show_serial_and_firmware ; show serial number and firmware version
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
105 call option_save_all ; save all settings into EEPROM (comm mode may be entered after settings have been changed without leaving the menu in between)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
106
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
107 IFDEF _screendump
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
108 bcf screen_dump_avail ; disable screen dump function
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
109 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
110
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
111 bcf switch_right ; clear left-over right button event
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
112 bcf comm_service_enabled ; communication is not yet established
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
113 bsf surfmode_menu ; flag that restart will be entered from surface menu / comm mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
114 movlw timeout_comm_pre_mode ; get timeout for phase without communication established yet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
115 movwf comm_timeout_timer ; initialize timeout counter
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
116 WIN_SMALL comm_status1_column+.80,comm_status1_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
117 STRCPY_TEXT_PRINT tUsbStartDone ; add to status message "done..."
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
118 call enable_rs232 ; enable serial comm, also sets CPU to normal speed
0
heinrichsweikamp
parents:
diff changeset
119 comm_mode1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
120 bcf trigger_full_second ; clear 'one second elapsed' flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
121 bcf LEDr ; switch off red LED / power down TR co-processor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
122 dcfsnz comm_timeout_timer,F ; decrement timeout, reached zero?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
123 bra comm_service_exit ; YES - timeout, exit comm mode
0
heinrichsweikamp
parents:
diff changeset
124 comm_mode2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
125 rcall comm_get_byte ; read 1 byte from RX buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
126 movlw 0xAA ; coding of service mode start byte: 0xAA
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
127 cpfseq RCREG1 ; received service mode start byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
128 bra comm_mode2a ; NO - probe for download mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
129 bra comm_mode2b ; YES - received start byte for service mode
0
heinrichsweikamp
parents:
diff changeset
130 comm_mode2a:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
131 movlw 0xBB ; coding of download mode start byte: 0xBB
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
132 cpfseq RCREG1 ; received download mode start byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
133 bra comm_mode2c ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
134 bra comm_download_mode ; YES - received start byte for download mode
393
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
135 comm_mode2c:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
136 btfsc ble_available ; BLE available?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
137 bra comm_mode4a ; YES - skip USB check check (required for very old OSTC sport)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
138 btfss vusb_in ; USB plugged in?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
139 bra comm_service_exit_nousb_delay; NO - disconnected, exit comm mode
393
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
140 comm_mode4a:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
141 btfsc switch_right ; right button pressed?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
142 bra comm_service_exit ; YES - exit comm mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
143 btfsc trigger_full_second ; NO - did 1 second elapsed meanwhile?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
144 bra comm_mode1 ; YES - loop with clocking down timeout counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
145 bra comm_mode2 ; NO - loop without clocking down timeout counter
0
heinrichsweikamp
parents:
diff changeset
146
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
147 ; received start byte for service mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
148 comm_mode2b:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
149 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
150 movlw 0x4B ; prepare answer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
151 movwf TXREG1 ; send answer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
152 ; check if correct service key is received
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
153 rcall comm_get_byte ; receive first byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
154 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
155 movff RCREG1,TXREG1 ; echo received byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
156 movlw UPPER comm_service_key ; load expected byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
157 cpfseq RCREG1 ; received expected byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
158 bra comm_mode1 ; NO - restart
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
159 rcall comm_get_byte ; receive second byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
160 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
161 movff RCREG1,TXREG1 ; echo received byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
162 movlw HIGH (comm_service_key & 0xFFFF) ; load expected byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
163 cpfseq RCREG1 ; received expected byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
164 bra comm_mode1 ; NO - restart
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
165 rcall comm_get_byte ; receive third byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
166 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
167 movff RCREG1,TXREG1 ; echo received byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
168 movlw LOW comm_service_key ; load expected byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
169 cpfseq RCREG1 ; received expected byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
170 bra comm_mode1 ; NO - restart
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
171 ; YES to all - enable com service mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
172 WIN_SMALL comm_status2_column, comm_status2_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
173 STRCPY_TEXT_PRINT tUsbServiceMode ; print service mode enabled message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
174 bsf comm_service_enabled ; set flag for com service mode enabled
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
175 bra comm_download_mode0 ; continue using common routine
69
50697bd41c54 +CHANGE: Some French Translations
heinrichsweikamp
parents: 66
diff changeset
176
50697bd41c54 +CHANGE: Some French Translations
heinrichsweikamp
parents: 66
diff changeset
177 comm_service_exit_nousb_delay:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
178 WAITMS d'200' ; wait 200 ms
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
179 btfsc vusb_in ; USB plugged in?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
180 bra comm_mode4a ; YES - (still) connected, return
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
181 comm_service_exit_nousb:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
182 bcf LEDr ; switch off red LED
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
183 WIN_SMALL comm_status3_column, comm_status3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
184 STRCPY_TEXT_PRINT tUsbClosed ; print port closed message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
185 bra comm_service_exit_common ; exit to restart
0
heinrichsweikamp
parents:
diff changeset
186
heinrichsweikamp
parents:
diff changeset
187 comm_service_exit:
heinrichsweikamp
parents:
diff changeset
188 WIN_SMALL comm_status3_column, comm_status3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
189 STRCPY_TEXT_PRINT tUsbExit ; print exited message
0
heinrichsweikamp
parents:
diff changeset
190 comm_service_exit_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
191 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
192 movlw 0xFF ; prepare reply "FF"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
193 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
194 call wait_1s ; wait <= 1 second
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
195 call wait_1s ; wait 1 second
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
196 call disable_rs232 ; shut down comm port
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
197 goto restart ; restart
0
heinrichsweikamp
parents:
diff changeset
198
heinrichsweikamp
parents:
diff changeset
199
heinrichsweikamp
parents:
diff changeset
200 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
201 ; Start Bootloader
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
202 ;
0
heinrichsweikamp
parents:
diff changeset
203 comm_service_ll_bootloader:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
204 bsf LEDr ; switch on red LED
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
205 WIN_SMALL comm_status3_column, comm_status3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
206 STRCPY_TEXT_PRINT tUsbLlBld ; print low level bootloader started message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
207 WIN_TOP comm_warning_row ; set row for icon
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
208 WIN_LEFT comm_warning_column ; set column for icon
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
209 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; show the warning icon
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
210 goto 0x1FF0C ; jump into the bootloader code
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
211
0
heinrichsweikamp
parents:
diff changeset
212
heinrichsweikamp
parents:
diff changeset
213 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
214 ; Send Firmware to Bootloader
0
heinrichsweikamp
parents:
diff changeset
215 ;
heinrichsweikamp
parents:
diff changeset
216 comm_send_firmware:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
217 movlw 0x50 ; prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
218 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
219 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
220 lfsr FSR2,buffer ; load base address of buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
221 movlw .5 ; read 5 bytes into buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
222 movwf lo ; initialize loop counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
223 movlw 0x55 ; initialize checksum byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
224 movwf hi ; store in hi
0
heinrichsweikamp
parents:
diff changeset
225 comm_send_firmware_loop:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
226 rcall comm_get_byte ; receive one byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
227 btfsc rs232_rx_timeout ; got a byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
228 bra comm_send_firmware_abort ; NO - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
229 movf RCREG1,W ; YES - copy received byte to WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
230 movwf POSTINC2 ; - copy received byte to buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
231 xorwf hi,F ; - xor received byte into checksum
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
232 rlncf hi,F ; - rotate checksum byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
233 decfsz lo,F ; - decrement loop counter, done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
234 bra comm_send_firmware_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
235 movf hi,W ; YES - copy checksum to WREG, zero flag set?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
236 bnz comm_send_firmware_failed ; NO - checksum test failed
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
237 movlw 0x4C ; YES - checksum ok, prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
238 movwf TXREG1 ; - send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
239 rcall comm_write_byte ; - wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
240 call vault_decodata_into_eeprom ; - store last deco data (and time/date) to EEPROM
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
241 goto 0x1FDF0 ; - jump into the bootloader code
0
heinrichsweikamp
parents:
diff changeset
242
heinrichsweikamp
parents:
diff changeset
243 comm_send_firmware_failed:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
244 WIN_SMALL comm_string_column, comm_string_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
245 call TFT_warning_color ; set warning color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
246 STRCPY_PRINT "Checksum failed" ; print failure message
0
heinrichsweikamp
parents:
diff changeset
247 comm_send_firmware_abort:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
248 movlw 0xFF ; prepare reply for ABORTED
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
249 movwf TXREG1 ; send reply
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
250 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
251
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
252
0
heinrichsweikamp
parents:
diff changeset
253 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
254 ; Reset to Dive 1 in Logbook
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
255 ;
0
heinrichsweikamp
parents:
diff changeset
256 comm_reset_logbook_pointers:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
257 call eeprom_reset_logbook_pointers ; clear logbook pointers in EEPROM
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
258 call ext_flash_erase_logbook ; clear complete logbook(!)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
259 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
260
heinrichsweikamp
parents:
diff changeset
261 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
262 ; Reset Battery Gauge
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
263 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
264 comm_reset_battery_gauge: ; reset battery gauge registers
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
265 call reset_battery_pointer ; reset battery pointer 0x07-0x0C and battery gauge
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
266 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
267
heinrichsweikamp
parents:
diff changeset
268 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
269 ; Erase a Memory Range given byte Start Address and Number of 4 kB Blocks
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
270 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
271 comm_erase_range4kb:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
272 movlw 0x42 ; prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
273 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
274 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
275 bcf INTCON,GIE ; disable all interrupts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
276 rcall comm_get_flash_address ; get three bytes start address or return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
277 btfsc rs232_rx_timeout ; got start address?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
278 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
279 rcall comm_get_byte ; YES - get number of blocks
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
280 btfsc rs232_rx_timeout ; - got number?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
281 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
282 movff RCREG1,lo ; YES - copy number of blocks to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
283 comm_erase_range4kb_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
284 call ext_flash_erase4kB ; - erase a memory block
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
285 movlw 0x10 ; - increase start address by 4096 (0x1000)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
286 addwf ext_flash_address+1,F ; - ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
287 movlw .0 ; - ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
288 addwfc ext_flash_address+2,F ; - ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
289 decfsz lo,F ; - decrement block counter, all blocks done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
290 bra comm_erase_range4kb_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
291 bra comm_download_mode0 ; YES - done
0
heinrichsweikamp
parents:
diff changeset
292
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
293 ;-----------------------------------------------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
294 ; Erase one Memory Block of 4 kB Size
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
295 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
296 comm_erase_4kb:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
297 bcf INTCON,GIE ; disable all interrupts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
298 rcall comm_get_flash_address ; get three bytes start address or return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
299 btfsc rs232_rx_timeout ; got start address?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
300 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
301 call ext_flash_erase4kB ; YES - erase memory block
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
302 bra comm_download_mode0 ; - done
0
heinrichsweikamp
parents:
diff changeset
303
heinrichsweikamp
parents:
diff changeset
304 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
305 ; Write a Stream of Data Bytes to Memory
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
306 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
307 comm_write_range:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
308 movlw 0x30 ; prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
309 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
310 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
311 bcf INTCON,GIE ; disable all interrupts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
312 rcall comm_get_flash_address ; get three bytes starts address or return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
313 btfsc rs232_rx_timeout ; got start address?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
314 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
315 comm_write_range_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
316 rcall comm_get_byte ; YES - get data byte to write to memory
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
317 btfsc rs232_rx_timeout ; got byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
318 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
319 movf RCREG1,W ; YES - copy received data byte to WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
320 ; bsf NCTS ; - hold Bluetooth chip (requires PC/Android/iOS side to use flow control...)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
321 call ext_flash_byte_write_comms ; - write data byte to flash memory
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
322 ; bcf NCTS ; - release Bluetooth chip (requires PC/Android/iOS side to use flow control...)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
323 call incf_ext_flash_address_p1 ; - increase address
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
324 bra comm_write_range_loop ; - loop
0
heinrichsweikamp
parents:
diff changeset
325
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
326
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
327 ;-----------------------------------------------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
328 ; Read a Memory Section given by Start Address and Length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
329 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
330 comm_send_range:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
331 movlw 0x20 ; prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
332 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
333 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
334 bcf INTCON,GIE ; disable all interrupts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
335 rcall comm_get_flash_address ; get three bytes start address or return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
336 btfsc rs232_rx_timeout ; got start address?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
337 bra comm_download_mode0 ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
338 rcall comm_get_byte ; get length, 3rd byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
339 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
340 bra comm_download_mode0 ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
341 movff RCREG1,up ; store length, 3rd byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
342 rcall comm_get_byte ; get length, 2nd byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
343 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
344 bra comm_download_mode0 ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
345 movff RCREG1,hi ; store length, 2nd byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
346 rcall comm_get_byte ; get length, 1st byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
347 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
348 bra comm_download_mode0 ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
349 movff RCREG1,lo ; store length, 1st byte
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
350 ; if lo==0, we must precondition hi because there are too many bytes sent
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
351 movf lo,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
352 bnz $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
353 decf hi,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
354 movlw 0x40
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
355 cpfslt up ; up > 0x3F ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
356 bra comm_download_mode0 ; YES - abort
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
357 ; 6 bytes received, send data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
358 ; needs ext_flash_address:3 start address and up:hi:lo amount
0
heinrichsweikamp
parents:
diff changeset
359 call ext_flash_read_block_start
heinrichsweikamp
parents:
diff changeset
360 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
361 bra comm_send_range24 ; counter 24 bit
0
heinrichsweikamp
parents:
diff changeset
362 comm_send_range24_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
363 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
364 movwf TXREG1 ; start new transmit
0
heinrichsweikamp
parents:
diff changeset
365 comm_send_range24:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
366 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
367 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
368 bra comm_send_range24_loop
heinrichsweikamp
parents:
diff changeset
369 decf hi,F
heinrichsweikamp
parents:
diff changeset
370 movlw 0xFF
heinrichsweikamp
parents:
diff changeset
371 cpfseq hi
heinrichsweikamp
parents:
diff changeset
372 bra comm_send_range24_loop
heinrichsweikamp
parents:
diff changeset
373 decf up,F
heinrichsweikamp
parents:
diff changeset
374 movlw 0xFF
heinrichsweikamp
parents:
diff changeset
375 cpfseq up
heinrichsweikamp
parents:
diff changeset
376 bra comm_send_range24_loop
heinrichsweikamp
parents:
diff changeset
377 call ext_flash_read_block_stop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
378 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
379
heinrichsweikamp
parents:
diff changeset
380 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
381
heinrichsweikamp
parents:
diff changeset
382 comm_get_flash_address:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
383 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
384 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
385 return ; NO - return
0
heinrichsweikamp
parents:
diff changeset
386 movff RCREG1,ext_flash_address+2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
387 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
388 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
389 return ; NO - return
0
heinrichsweikamp
parents:
diff changeset
390 movff RCREG1,ext_flash_address+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
391 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
392 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
393 return ; NO - return
0
heinrichsweikamp
parents:
diff changeset
394 movff RCREG1,ext_flash_address+0
heinrichsweikamp
parents:
diff changeset
395 return
heinrichsweikamp
parents:
diff changeset
396
heinrichsweikamp
parents:
diff changeset
397 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
398
heinrichsweikamp
parents:
diff changeset
399 comm_download_mode:
heinrichsweikamp
parents:
diff changeset
400 ; Enable comm download mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
401 WIN_SMALL comm_status2_column, comm_status2_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
402 STRCPY_TEXT_PRINT tUsbDownloadMode ; download mode enabled
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
403 bsf INTCON,GIE ; all interrupts on
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
404 rcall comm_write_byte ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
405 movlw 0xBB ; command echo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
406 movwf TXREG1 ; send answer
0
heinrichsweikamp
parents:
diff changeset
407 comm_download_mode0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
408 bsf INTCON,GIE ; all interrupts on
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
409 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
410 movlw 0x4C ; default reply is 4C for service mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
411 btfss comm_service_enabled ; com service enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
412 movlw 0x4D ; NO - change to reply 4D for download mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
413 movwf TXREG1 ; send answer
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
414 movlw timeout_service_mode ; get timeout value
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
415 movwf comm_timeout_timer ; load into timeout counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
416 bcf switch_right ; clear left-over button event
0
heinrichsweikamp
parents:
diff changeset
417 comm_download_mode1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
418 bcf trigger_full_second ; clear 'one second elapsed' flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
419 dcfsnz comm_timeout_timer,F ; decrement timeout, reached zero?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
420 bra comm_service_exit ; YES - exit
0
heinrichsweikamp
parents:
diff changeset
421 comm_download_mode2:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
422 rcall comm_get_byte ; NO - check for a byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
423 btfsc comm_service_enabled ; com service mode enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
424 btg LEDr ; YES - blink in service mode
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
425 btfsc ble_available ; BLE available?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
426 bra comm_download_mode3 ; YES - skip USB check (required for very old OSTC sport)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
427 btfss vusb_in ; USB plugged in?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
428 bra comm_service_exit_nousb ; NO - disconnected -> exit
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
429 comm_download_mode3:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
430 btfsc switch_right ; shall abort?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
431 bra comm_service_exit ; YES
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
432 btfsc trigger_full_second ; NO - did 1 second elapsed meanwhile?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
433 bra comm_download_mode1 ; YES - check for timeout
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
434 btfsc rs232_rx_timeout ; NO - got a byte?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
435 bra comm_download_mode2 ; NO - loop waiting for command byte
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
436 ; Command received
0
heinrichsweikamp
parents:
diff changeset
437 bcf LEDr
heinrichsweikamp
parents:
diff changeset
438 movlw 0xFF
heinrichsweikamp
parents:
diff changeset
439 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
440 bra $+4
heinrichsweikamp
parents:
diff changeset
441 bra comm_service_exit ; exit
heinrichsweikamp
parents:
diff changeset
442 movlw "a"
heinrichsweikamp
parents:
diff changeset
443 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
444 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
445 bra comm_send_headers ; send all 256 dive headers
0
heinrichsweikamp
parents:
diff changeset
446 movlw "b"
heinrichsweikamp
parents:
diff changeset
447 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
448 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
449 bra comm_set_time ; read time and date from the PC and set clock
0
heinrichsweikamp
parents:
diff changeset
450 movlw "c"
heinrichsweikamp
parents:
diff changeset
451 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
452 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
453 bra comm_set_custom_text ; send a opt_name_length byte string of custom text
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
454 movlw "f" ; 0x66
0
heinrichsweikamp
parents:
diff changeset
455 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
456 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
457 bra comm_send_dive ; send header and profile for one dive
0
heinrichsweikamp
parents:
diff changeset
458 movlw "i"
heinrichsweikamp
parents:
diff changeset
459 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
460 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
461 bra comm_identify ; send firmware, serial, etc.
235
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
462 movlw "j"
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
463 cpfseq RCREG1
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
464 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
465 bra comm_hardware_descriptor ; send hardware descriptor byte
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
466 movlw 0x60
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
467 cpfseq RCREG1
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
468 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
469 bra comm_feature_and_hardware ; send more detailed information
0
heinrichsweikamp
parents:
diff changeset
470 movlw "n"
heinrichsweikamp
parents:
diff changeset
471 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
472 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
473 goto comm_send_string ; send a 15 byte string to the screen
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
474 movlw "m"
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
475 cpfseq RCREG1
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
476 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
477 goto comm_send_compact_headers ; send all 256 compact headers
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
478 IFDEF _screendump
0
heinrichsweikamp
parents:
diff changeset
479 movlw "l"
heinrichsweikamp
parents:
diff changeset
480 cpfseq RCREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
481 bra $+4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
482 call TFT_dump_screen ; dump the screen contents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
483 ENDIF
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
484 movlw "r"
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
485 cpfseq RCREG1
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
486 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
487 bra comm_read_setting ; read a setting (and send via USB)
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
488 movlw "w"
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
489 cpfseq RCREG1
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
490 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
491 bra comm_write_setting ; write a setting (into RAM)
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
492 movlw "x"
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
493 cpfseq RCREG1
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
494 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
495 bra comm_option_reset_all ; reset all options to factory default
0
heinrichsweikamp
parents:
diff changeset
496
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
497 btfss comm_service_enabled ; done for download mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
498 bra comm_download_mode0 ; loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
499
heinrichsweikamp
parents:
diff changeset
500 movlw 0x20
heinrichsweikamp
parents:
diff changeset
501 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
502 bra $+4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
503 bra comm_send_range ; send hi:lo:ext_flash_rw bytes starting from ext_flash_address:3
0
heinrichsweikamp
parents:
diff changeset
504 movlw 0x22
heinrichsweikamp
parents:
diff changeset
505 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
506 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
507 bra comm_reset_logbook_pointers ; reset all logbook pointers and the logbook
0
heinrichsweikamp
parents:
diff changeset
508 movlw 0x23
heinrichsweikamp
parents:
diff changeset
509 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
510 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
511 bra comm_reset_battery_gauge ; reset battery gauge registers
0
heinrichsweikamp
parents:
diff changeset
512 movlw 0x30
heinrichsweikamp
parents:
diff changeset
513 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
514 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
515 bra comm_write_range ; write bytes starting from ext_flash_address:3 (stop when timeout)
0
heinrichsweikamp
parents:
diff changeset
516 movlw 0x40
heinrichsweikamp
parents:
diff changeset
517 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
518 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
519 bra comm_erase_4kb ; erase 4 kB block from ext_flash_address:3 (Warning: no confirmation or built-in security here...)
0
heinrichsweikamp
parents:
diff changeset
520 movlw 0x42
heinrichsweikamp
parents:
diff changeset
521 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
522 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
523 bra comm_erase_range4kb ; erase range in 4 kB steps (get 3 bytes address and 1 byte amount of 4 kB blocks)
0
heinrichsweikamp
parents:
diff changeset
524 movlw 0x50
heinrichsweikamp
parents:
diff changeset
525 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
526 bra $+4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
527 bra comm_send_firmware ; send firmware to bootloader
147
fdd4e30846ae some cleanup
heinrichsweikamp
parents: 136
diff changeset
528 ; movlw "t"
fdd4e30846ae some cleanup
heinrichsweikamp
parents: 136
diff changeset
529 ; cpfseq RCREG1
fdd4e30846ae some cleanup
heinrichsweikamp
parents: 136
diff changeset
530 ; bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
531 ; goto testloop ; start raw-data test loop
0
heinrichsweikamp
parents:
diff changeset
532 movlw 0xC1
heinrichsweikamp
parents:
diff changeset
533 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
534 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
535 bra comm_service_ll_bootloader ; start low-level bootloader
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
536 bra comm_download_mode0 ; loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
537
heinrichsweikamp
parents:
diff changeset
538 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
539
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
540 comm_send_compact_headers:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
541 movlw "m" ; send echo
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
542 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
543 ; send 13 bytes/dive (compact header)
347
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
544 ; 1st: 200009h-200016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
545 ; 2nd: 201009h-201016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
546 ; 3rd: 202009h-202016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
547 ; 100: 264009h-264016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
548 ; 256: 2FF009h-2FF016h
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
549 movlw 0x1F
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
550 movwf ext_flash_address+2
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
551 movlw 0xF0
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
552 movwf ext_flash_address+1
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
553
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
554 comm_send_compact_headers2:
347
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
555 movlw 0x09
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
556 movwf ext_flash_address+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
557 ; adjust address for next dive
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
558 movlw 0x10
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
559 addwf ext_flash_address+1
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
560 movlw 0x00
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
561 addwfc ext_flash_address+2
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
562
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
563 movlw 0x30
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
564 cpfseq ext_flash_address+2 ; all 256 dive send?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
565 bra comm_send_compact_headers4 ; NO - continue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
566 bra comm_download_mode0 ; done, loop with timeout reset
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
567
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
568 comm_send_compact_headers4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
569 movlw .13
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
570 movwf lo ; counter
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
571 rcall comm_write_byte ; wait for completion of transmit
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
572 call ext_flash_read_block_start ; 1st byte
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
573 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
574 bra comm_send_compact_headers3 ; counter 24 bit
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
575 comm_send_compact_headers_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
576 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
577 movwf TXREG1 ; start new transmit
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
578 comm_send_compact_headers3:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
579 rcall comm_write_byte ; wait for completion of transmit
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
580 decfsz lo,F
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
581 bra comm_send_compact_headers_loop
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
582 call ext_flash_read_block_stop
347
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
583
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
584 ; Offset to total dive counter
356
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
585 movlw .80
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
586 movwf ext_flash_address+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
587 call ext_flash_read_block_start ; 1st byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
588 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
589 rcall comm_write_byte ; wait for completion of transmit
356
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
590 call ext_flash_read_block ; 2nd byte
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
591 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
592 call ext_flash_read_block_stop
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
593 rcall comm_write_byte ; wait for completion of transmit
356
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
594
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
595 ; Offset to Logbook-Profile version
391
682199d87b5c add profile version to compact headers
heinrichsweikamp
parents: 378
diff changeset
596 movlw .8
682199d87b5c add profile version to compact headers
heinrichsweikamp
parents: 378
diff changeset
597 movwf ext_flash_address+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
598 call ext_flash_byte_read ; get byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
599 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
600 rcall comm_write_byte ; wait for completion of transmit
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
601 bra comm_send_compact_headers2 ; continue
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
602
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
603
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
604 ;-----------------------------------------------------------------------------
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
605
0
heinrichsweikamp
parents:
diff changeset
606 comm_send_headers:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
607 movlw "a" ; send echo
0
heinrichsweikamp
parents:
diff changeset
608 movwf TXREG1
heinrichsweikamp
parents:
diff changeset
609 ; Send 256 bytes/dive (Header)
heinrichsweikamp
parents:
diff changeset
610 ; 1st: 200000h-2000FFh
heinrichsweikamp
parents:
diff changeset
611 ; 2nd: 201000h-2010FFh
heinrichsweikamp
parents:
diff changeset
612 ; 3rd: 202000h-2020FFh
heinrichsweikamp
parents:
diff changeset
613 ; 100: 264000h-2640FFh
heinrichsweikamp
parents:
diff changeset
614 ; 256: 2FF000h-2FF0FFh
heinrichsweikamp
parents:
diff changeset
615 movlw 0x1F
heinrichsweikamp
parents:
diff changeset
616 movwf ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
617 movlw 0xF0
heinrichsweikamp
parents:
diff changeset
618 movwf ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
619 comm_send_headers2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
620 clrf ext_flash_address+0
0
heinrichsweikamp
parents:
diff changeset
621 ; Adjust address for next dive
heinrichsweikamp
parents:
diff changeset
622 movlw 0x10
heinrichsweikamp
parents:
diff changeset
623 addwf ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
624 movlw 0x00
heinrichsweikamp
parents:
diff changeset
625 addwfc ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
626 movlw 0x30
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
627 cpfseq ext_flash_address+2 ; all 256 dive send?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
628 bra comm_send_headers4 ; NO - continue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
629 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
630 comm_send_headers4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
631 clrf lo ; counter
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
632 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
633 call ext_flash_read_block_start ; 1st byte
heinrichsweikamp
parents:
diff changeset
634 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
635 bra comm_send_headers3 ; counter 24 bit
0
heinrichsweikamp
parents:
diff changeset
636 comm_send_headers_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
637 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
638 movwf TXREG1 ; start new transmit
0
heinrichsweikamp
parents:
diff changeset
639 comm_send_headers3:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
640 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
641 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
642 bra comm_send_headers_loop
heinrichsweikamp
parents:
diff changeset
643 call ext_flash_read_block_stop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
644 bra comm_send_headers2 ; continue
0
heinrichsweikamp
parents:
diff changeset
645
heinrichsweikamp
parents:
diff changeset
646 ;-----------------------------------------------------------------------------
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
647
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
648 comm_option_reset_all: ; reset all options to factory default
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
649 movlw "x" ; send echo
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
650 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
651 call option_reset_all
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
652 bra comm_download_mode0 ; done, back to loop with timeout reset
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
653
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
654 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
655
heinrichsweikamp
parents:
diff changeset
656 comm_set_time:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
657 movlw "b" ; send echo
0
heinrichsweikamp
parents:
diff changeset
658 movwf TXREG1
heinrichsweikamp
parents:
diff changeset
659
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
660 rcall comm_write_byte ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
661 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
662 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
663 bra comm_download_mode0 ; NO - abort
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
664 movff RCREG1, rtc_latched_hour
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
665 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
666 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
667 bra comm_download_mode0 ; NO - abort
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
668 movff RCREG1, rtc_latched_mins
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
669 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
670 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
671 bra comm_download_mode0 ; NO - abort
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
672 movff RCREG1, rtc_latched_secs
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
673 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
674 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
675 bra comm_download_mode0 ; NO - abort
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
676 movff RCREG1, rtc_latched_month
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
677 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
678 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
679 bra comm_download_mode0 ; NO - abort
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
680 movff RCREG1, rtc_latched_day
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
681 rcall comm_get_byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
682 btfsc rs232_rx_timeout ; got byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
683 bra comm_download_mode0 ; NO - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
684 movff RCREG1, rtc_latched_year
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
685 call rtc_set_rtc ; write time and date to RTC module
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
686 bra comm_download_mode0 ; done, back to loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
687
heinrichsweikamp
parents:
diff changeset
688 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
689 ; Set custom text string (opt_name_length ASCII chars)
0
heinrichsweikamp
parents:
diff changeset
690 ;
heinrichsweikamp
parents:
diff changeset
691
heinrichsweikamp
parents:
diff changeset
692 comm_set_custom_text:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
693 movlw "c" ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
694 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
695 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
696 lfsr FSR2,opt_name
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
697 movlw opt_name_length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
698 movwf lo ; counter
0
heinrichsweikamp
parents:
diff changeset
699 comm_set_ctext_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
700 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
701 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
702 bra comm_set_ctext_loop_done ; NO - abort
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
703 movff RCREG1,POSTINC2 ; store character
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
704 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
705 bra comm_set_ctext_loop
136
9a637c9bb19a rename Deco Planner to Simulator
heinrichsweikamp
parents: 128
diff changeset
706 comm_set_ctext_loop_done:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
707 tstfsz lo ; got opt_name_length bytes?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
708 bra comm_set_ctext_loop_done2 ; NO - clear remaining chars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
709 bra comm_download_mode0 ; done, loop with timeout reset
136
9a637c9bb19a rename Deco Planner to Simulator
heinrichsweikamp
parents: 128
diff changeset
710 comm_set_ctext_loop_done2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
711 clrf POSTINC2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
712 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
713 bra comm_set_ctext_loop_done2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
714 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
715
heinrichsweikamp
parents:
diff changeset
716 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
717 ; Reply Serial (2 bytes low:high), firmware (major.minor) and custom text
0
heinrichsweikamp
parents:
diff changeset
718 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
719
0
heinrichsweikamp
parents:
diff changeset
720 comm_identify:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
721 movlw "i" ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
722 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
723 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
724
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
725 ;---- Read serial from internal EEPROM address 0000
0
heinrichsweikamp
parents:
diff changeset
726 clrf EEADRH
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
727 clrf EEADR ; get serial number LOW
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
728 call read_eeprom ; read byte
0
heinrichsweikamp
parents:
diff changeset
729 movff EEDATA,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
730 incf EEADR,F ; get serial number HIGH
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
731 call read_eeprom ; read byte
0
heinrichsweikamp
parents:
diff changeset
732 movff EEDATA,hi
heinrichsweikamp
parents:
diff changeset
733
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
734 ;---- Emit serial number
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
735 movff lo,TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
736 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
737 movff hi,TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
738 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
739
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
740 ;---- Emit firmware hi.lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
741 movlw softwareversion_x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
742 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
743 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
744 movlw softwareversion_y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
745 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
746 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
747
heinrichsweikamp
parents:
diff changeset
748 ;---- Emit custom text
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
749 movlw opt_name_length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
750 movwf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
751 lfsr FSR2,opt_name
0
heinrichsweikamp
parents:
diff changeset
752
heinrichsweikamp
parents:
diff changeset
753 common_identify_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
754 movff POSTINC2,TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
755 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
756 decfsz hi,F
heinrichsweikamp
parents:
diff changeset
757 bra common_identify_loop
heinrichsweikamp
parents:
diff changeset
758
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
759 bra comm_download_mode0 ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
760
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
761 ;-----------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
762
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
763 comm_get_byte:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
764 goto rs232_get_byte ; ... and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
765
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
766 comm_write_byte: ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
767 goto rs232_wait_tx ; ... and return
0
heinrichsweikamp
parents:
diff changeset
768
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
769
235
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
770 ;-----------------------------------------------------------------------------
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
771 ; Reply hardware descriptor byte
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
772 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
773 comm_hardware_descriptor:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
774 movlw "j" ; prepare echo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
775 movwf TXREG1 ; send echo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
776 rcall comm_write_byte ; wait for completion of transmit
235
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
777
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
778 movf HW_descriptor,W ; get hardware descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
779 bcf WREG,6 ; clear bit 6 for reason of compatibility with 3rd party software
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
780 bcf WREG,7 ; clear bit 7 for reason of compatibility with 3rd party software
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
781 movwf TXREG1 ; send hardware descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
782
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
783 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
784
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
785 comm_feature_and_hardware:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
786 movlw 0x60 ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
787 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
788 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
789
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
790 movlw 0x00 ; hardware high byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
791 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
792 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
793
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
794 movf HW_descriptor,W ; get hardware descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
795 bcf WREG,6 ; clear bit 6 for reason of compatibility with 3rd party software
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
796 bcf WREG,7 ; clear bit 7 for reason of compatibility with 3rd party software
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
797 movwf TXREG1 ; send hardware descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
798 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
799
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
800 movlw 0x00 ; feature high Byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
801 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
802 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
803
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
804 movlw 0x00 ; feature low Byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
805 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
806 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
807
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
808 movlw 0x00 ; model descriptor byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
809 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
810
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
811 bra comm_download_mode0 ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
812
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
813 ;-----------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
814
0
heinrichsweikamp
parents:
diff changeset
815 comm_send_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
816 movlw "f"; 0x66 ; send echo
0
heinrichsweikamp
parents:
diff changeset
817 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
818
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
819 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
820 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
821 bra comm_download_mode0 ; NO - abort!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
822 movff RCREG1,lo ; store dive number (0-255)
0
heinrichsweikamp
parents:
diff changeset
823 ; First, send the header (again)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
824 ; set ext_flash_address:3 to TOC entry of this dive
0
heinrichsweikamp
parents:
diff changeset
825 ; 1st: 200000h-200FFFh -> lo=0
heinrichsweikamp
parents:
diff changeset
826 ; 2nd: 201000h-201FFFh -> lo=1
heinrichsweikamp
parents:
diff changeset
827 ; 3rd: 202000h-202FFFh -> lo=2
heinrichsweikamp
parents:
diff changeset
828 ; 256: 2FF000h-2FFFFFh -> lo=255
heinrichsweikamp
parents:
diff changeset
829 clrf ext_flash_address+0
heinrichsweikamp
parents:
diff changeset
830 clrf ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
831 movlw 0x20
heinrichsweikamp
parents:
diff changeset
832 movwf ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
833 movlw .16
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
834 mulwf lo ; lo*16 = offset to 0x2000 (up:hi)
0
heinrichsweikamp
parents:
diff changeset
835 movf PRODL,W
heinrichsweikamp
parents:
diff changeset
836 addwf ext_flash_address+1,F
heinrichsweikamp
parents:
diff changeset
837 movf PRODH,W
heinrichsweikamp
parents:
diff changeset
838 addwfc ext_flash_address+2,F
heinrichsweikamp
parents:
diff changeset
839
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
840 incf_ext_flash_address d'2' ; skip 0xFA, 0xFA
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
841 call ext_flash_byte_read_plus ; read start address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
842 movff ext_flash_rw,ext_flash_log_pointer+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
843 call ext_flash_byte_read_plus ; read start address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
844 movff ext_flash_rw,ext_flash_log_pointer+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
845 call ext_flash_byte_read_plus ; read start address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
846 movff ext_flash_rw,ext_flash_log_pointer+2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
847 call ext_flash_byte_read_plus ; read end address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
848 movff ext_flash_rw,ext_flash_end_pointer+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
849 call ext_flash_byte_read_plus ; read end address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
850 movff ext_flash_rw,ext_flash_end_pointer+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
851 call ext_flash_byte_read_plus ; read end address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
852 movff ext_flash_rw,ext_flash_end_pointer+2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
853 decf_ext_flash_address d'8' ; back again to first 0xFA in header
0
heinrichsweikamp
parents:
diff changeset
854
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
855 movf ext_flash_log_pointer+0,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
856 cpfseq ext_flash_end_pointer+0 ; equal?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
857 bra comm_send_dive1 ; NO - send header
0
heinrichsweikamp
parents:
diff changeset
858
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
859 movf ext_flash_log_pointer+1,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
860 cpfseq ext_flash_end_pointer+1 ; equal?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
861 bra comm_send_dive1 ; NO - send header
0
heinrichsweikamp
parents:
diff changeset
862
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
863 movf ext_flash_log_pointer+2,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
864 cpfseq ext_flash_end_pointer+2 ; equal?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
865 bra comm_send_dive1 ; NO - send header
0
heinrichsweikamp
parents:
diff changeset
866
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
867 ; Start=End -> Not good, abort
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
868 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
869
heinrichsweikamp
parents:
diff changeset
870 comm_send_dive1:
heinrichsweikamp
parents:
diff changeset
871 ; Send header
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
872 clrf hi ; counter
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
873 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
874 call ext_flash_read_block_start ; 1st byte
0
heinrichsweikamp
parents:
diff changeset
875 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
876 bra comm_send_dive_header
0
heinrichsweikamp
parents:
diff changeset
877 comm_send_dive_header2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
878 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
879 movwf TXREG1 ; start new transmit
0
heinrichsweikamp
parents:
diff changeset
880 comm_send_dive_header:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
881 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
882 decfsz hi,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
883 bra comm_send_dive_header2
0
heinrichsweikamp
parents:
diff changeset
884 call ext_flash_read_block_stop
heinrichsweikamp
parents:
diff changeset
885
heinrichsweikamp
parents:
diff changeset
886 ; Set address for profile
heinrichsweikamp
parents:
diff changeset
887 movff ext_flash_log_pointer+0,ext_flash_address+0
heinrichsweikamp
parents:
diff changeset
888 movff ext_flash_log_pointer+1,ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
889 movff ext_flash_log_pointer+2,ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
890
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
891 movlw .6 ; skip 6 byte short header in profile - only for internal use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
892 call incf_ext_flash_address0_0x20 ; increases bytes in ext_flash_address:3 with 0x200000 bank switching
0
heinrichsweikamp
parents:
diff changeset
893
512
heinrichsweikamp
parents: 507
diff changeset
894 ; Set address for short header/compact header, Byte 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
895
0
heinrichsweikamp
parents:
diff changeset
896 comm_send_dive_profile:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
897 call ext_flash_byte_read_plus_0x20 ; read one byte into ext_flash_rw, takes care of banking at 0x200000
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
898 rcall comm_write_byte ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
899 movff ext_flash_rw,TXREG1 ; send a byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
900
0
heinrichsweikamp
parents:
diff changeset
901 ; 24bit compare with end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
902 movff ext_flash_end_pointer+0,WREG
0
heinrichsweikamp
parents:
diff changeset
903 cpfseq ext_flash_address+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
904 bra comm_send_dive_profile
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
905 movff ext_flash_end_pointer+1,WREG
0
heinrichsweikamp
parents:
diff changeset
906 cpfseq ext_flash_address+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
907 bra comm_send_dive_profile
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
908 movff ext_flash_end_pointer+2,WREG
0
heinrichsweikamp
parents:
diff changeset
909 cpfseq ext_flash_address+2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
910 bra comm_send_dive_profile
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
911
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
912 rcall comm_write_byte ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
913 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
914
heinrichsweikamp
parents:
diff changeset
915 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
916
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
917 comm_read_setting:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
918 movlw "r"
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
919 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
920 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
921 btfsc rs232_rx_timeout ; got byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
922 bra comm_read_abort ; NO - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
923 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
924 movlw 0x0F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
925 cpfsgt RCREG1 ; 0x00-0x0F: unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
926 bra comm_read_abort ; abort!
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
927 subwf RCREG1,W ; subtract unused commands
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
928
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
929 clrf up ; set gas/dil index to 0 (0 = gas 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
930 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
931 bra comm_read_gas_dil ; RCREG1=0x10
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
932 incf up ; increment gas/dil index (1 = gas 2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
933 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
934 bra comm_read_gas_dil ; RCREG1=0x11
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
935 incf up ; increment gas/dil index (2 = gas 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
936 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
937 bra comm_read_gas_dil ; RCREG1=0x12
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
938 incf up ; increment gas/dil index (3 = gas 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
939 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
940 bra comm_read_gas_dil ; RCREG1=0x13
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
941 incf up ; increment gas/dil index (4 = gas 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
942 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
943 bra comm_read_gas_dil ; RCREG1=0x14
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
944 incf up ; increment gas/dil index (5 = dil 1)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
945 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
946 bra comm_read_gas_dil ; RCREG1=0x15
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
947 incf up ; increment gas/dil index (6 = dil 2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
948 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
949 bra comm_read_gas_dil ; RCREG1=0x16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
950 incf up ; increment gas/dil index (7 = dil 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
951 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
952 bra comm_read_gas_dil ; RCREG1=0x17
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
953 incf up ; increment gas/dil index (8 = dil 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
954 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
955 bra comm_read_gas_dil ; RCREG1=0x18
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
956 incf up ; increment gas/dil index (9 = dil 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
957 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
958 bra comm_read_gas_dil ; RCREG1=0x19
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
959
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
960 clrf up ; set setpoint index to 0 (0 = SP 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
961 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
962 bra comm_read_sp ; RCREG1=0x1A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
963 incf up ; increment setpoint index (1 = SP2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
964 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
965 bra comm_read_sp ; RCREG1=0x1B
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
966 incf up ; increment setpoint index (2 = SP3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
967 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
968 bra comm_read_sp ; RCREG1=0x1C
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
969 incf up ; increment setpoint index (3 = SP4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
970 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
971 bra comm_read_sp ; RCREG1=0x1D
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
972 incf up ; increment setpoint index (4 = SP5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
973 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
974 bra comm_read_sp ; RCREG1=0x1E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
975
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
976 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
977 movff opt_ccr_mode, TXREG1 ; RCREG1=0x1F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
978 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
979 movff opt_dive_mode, TXREG1 ; RCREG1=0x20
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
980 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
981 movff char_I_deco_model, TXREG1 ; RCREG1=0x21
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
982 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
983 movff char_I_ppO2_max_work, TXREG1 ; RCREG1=0x22
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
984 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
985 movff char_I_ppO2_min, TXREG1 ; RCREG1=0x23
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
986 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
987 movff char_I_extra_time, TXREG1 ; RCREG1=0x24
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
988 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
989 movff opt_GF_low, TXREG1 ; RCREG1=0x25
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
990 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
991 movff opt_GF_high, TXREG1 ; RCREG1=0x26
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
992 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
993 movff opt_aGF_low, TXREG1 ; RCREG1=0x27
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
994 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
995 movff opt_aGF_high, TXREG1 ; RCREG1=0x28
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
996 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
997 movff opt_enable_aGF, TXREG1 ; RCREG1=0x29
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
998 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
999 movff opt_sat_multiplier_non_gf, TXREG1 ; RCREG1=0x2A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1000 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1001 movff opt_desat_multiplier_non_gf,TXREG1 ; RCREG1=0x2B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1002 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1003 movff opt_last_stop, TXREG1 ; RCREG1=0x2C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1004 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1005 movff opt_brightness, TXREG1 ; RCREG1=0x2D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1006 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1007 movff opt_units, TXREG1 ; RCREG1=0x2E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1008 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1009 movff opt_sampling_rate, TXREG1 ; RCREG1=0x2F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1010 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1011 movff opt_salinity, TXREG1 ; RCREG1=0x30
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1012 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1013 movff opt_dive_color_scheme, TXREG1 ; RCREG1=0x31
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1014 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1015 movff opt_language, TXREG1 ; RCREG1=0x32
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1016 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1017 movff opt_dateformat, TXREG1 ; RCREG1=0x33
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1018 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1019 movff opt_compass_gain, TXREG1 ; RCREG1=0x34
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1020 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1021 movff opt_pressure_adjust, TXREG1 ; RCREG1=0x35
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1022 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1023 movff opt_enable_safetystop, TXREG1 ; RCREG1=0x36
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1024 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1025 movff opt_calibration_O2_ratio, TXREG1 ; RCREG1=0x37
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1026 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1027 clrf TXREG1 ; RCREG1=0x38 NOT USED ANYMORE (ex opt_sensor_fallback)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1028 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1029 movff opt_flip_screen, TXREG1 ; RCREG1=0x39
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1030 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1031 movff opt_cR_button_left, TXREG1 ; RCREG1=0x3A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1032 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1033 movff opt_cR_button_right, TXREG1 ; RCREG1=0x3B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1034 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1035 movff char_I_SAC_work, TXREG1 ; RCREG1=0x3C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1036 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1037 movff char_I_SAC_deco, TXREG1 ; RCREG1=0x3D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1038 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1039 movff opt_modwarning, TXREG1 ; RCREG1=0x3E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1040 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1041 movff opt_vsitextv2, TXREG1 ; RCREG1=0x3F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1042 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1043 movff opt_vsigraph, TXREG1 ; RCREG1=0x40
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1044 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1045 movff opt_showppo2, TXREG1 ; RCREG1=0x41, always show ppO2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1046 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1047 movff opt_temperature_adjust, TXREG1 ; RCREG1=0x42
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1048 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1049 movff opt_safety_stop_length, TXREG1 ; RCREG1=0x43
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1050 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1051 movff opt_safety_stop_start, TXREG1 ; RCREG1=0x44
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1052 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1053 movff opt_safety_stop_end, TXREG1 ; RCREG1=0x45
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1054 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1055 movff opt_safety_stop_reset, TXREG1 ; RCREG1=0x46
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1056 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1057 clrf TXREG1 ; RCREG1=0x47, ignore conservatism in hwOS tech firmware
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1058 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1059 movff opt_diveTimeout, TXREG1 ; RCREG1=0x48
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1060 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1061 movff button_polarity, TXREG1 ; RCREG1=0x49
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1062 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1063 movff char_I_PSCR_drop, TXREG1 ; RCREG1=0x4A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1064 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1065 movff char_I_PSCR_lungratio, TXREG1 ; RCREG1=0x4B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1066 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1067 movff char_I_ppO2_max_deco, TXREG1 ; RCREG1=0x4C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1068 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1069 movff char_I_ppO2_min_loop, TXREG1 ; RCREG1=0x4D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1070 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1071 movff char_I_gas_avail_size+0, TXREG1 ; RCREG1=0x4E
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1072 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1073 movff char_I_gas_avail_size+1, TXREG1 ; RCREG1=0x4F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1074 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1075 movff char_I_gas_avail_size+2, TXREG1 ; RCREG1=0x50
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1076 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1077 movff char_I_gas_avail_size+3, TXREG1 ; RCREG1=0x51
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1078 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1079 movff char_I_gas_avail_size+4, TXREG1 ; RCREG1=0x52
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1080 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1081 movff char_I_gas_avail_pres+0, TXREG1 ; RCREG1=0x53
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1082 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1083 movff char_I_gas_avail_pres+1, TXREG1 ; RCREG1=0x54
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1084 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1085 movff char_I_gas_avail_pres+2, TXREG1 ; RCREG1=0x55
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1086 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1087 movff char_I_gas_avail_pres+3, TXREG1 ; RCREG1=0x56
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1088 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1089 movff char_I_gas_avail_pres+4, TXREG1 ; RCREG1=0x57
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1090 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1091 movff char_I_CC_max_frac_O2, TXREG1 ; RCREG1=0x58
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1092 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1093 movff opt_sim_setpoint_number, TXREG1 ; RCREG1=0x59
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1094 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1095 movff opt_calc_asc_gasvolume, TXREG1 ; RCREG1=0x5A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1096 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1097 movff opt_sim_use_aGF, TXREG1 ; RCREG1=0x5B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1098 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1099 movff char_I_altitude_wait, TXREG1 ; RCREG1=0x5C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1100 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1101 movff opt_enable_IBCD, TXREG1 ; RCREG1=0x5D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1102 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1103 movff opt_sat_multiplier_gf, TXREG1 ; RCREG1=0x5E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1104 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1105 movff opt_desat_multiplier_gf, TXREG1 ; RCREG1=0x5F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1106 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1107 movff opt_transmitter_id_1+0, TXREG1 ; RCREG1=0x60
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1108 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1109 movff opt_transmitter_id_1+1, TXREG1 ; RCREG1=0x61
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1110 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1111 movff opt_transmitter_id_2+0, TXREG1 ; RCREG1=0x62
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1112 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1113 movff opt_transmitter_id_2+1, TXREG1 ; RCREG1=0x63
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1114 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1115 movff opt_transmitter_id_3+0, TXREG1 ; RCREG1=0x64
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1116 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1117 movff opt_transmitter_id_3+1, TXREG1 ; RCREG1=0x65
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1118 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1119 movff opt_transmitter_id_4+0, TXREG1 ; RCREG1=0x66
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1120 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1121 movff opt_transmitter_id_4+1, TXREG1 ; RCREG1=0x67
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1122 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1123 movff opt_transmitter_id_5+0, TXREG1 ; RCREG1=0x68
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1124 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1125 movff opt_transmitter_id_5+1, TXREG1 ; RCREG1=0x69
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1126 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1127 movff opt_transmitter_id_6+0, TXREG1 ; RCREG1=0x6A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1128 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1129 movff opt_transmitter_id_6+1, TXREG1 ; RCREG1=0x6B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1130 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1131 movff opt_transmitter_id_7+0, TXREG1 ; RCREG1=0x6C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1132 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1133 movff opt_transmitter_id_7+1, TXREG1 ; RCREG1=0x6D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1134 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1135 movff opt_transmitter_id_8+0, TXREG1 ; RCREG1=0x6E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1136 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1137 movff opt_transmitter_id_8+1, TXREG1 ; RCREG1=0x6F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1138 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1139 movff opt_transmitter_id_9+0, TXREG1 ; RCREG1=0x70
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1140 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1141 movff opt_transmitter_id_9+1, TXREG1 ; RCREG1=0x71
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1142 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1143 movff opt_transmitter_id_10+0, TXREG1 ; RCREG1=0x72
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1144 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1145 movff opt_transmitter_id_10+1, TXREG1 ; RCREG1=0x73
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1146 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1147 movff char_I_gas_avail_size+5, TXREG1 ; RCREG1=0x74
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1148 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1149 movff char_I_gas_avail_size+6, TXREG1 ; RCREG1=0x75
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1150 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1151 movff char_I_gas_avail_size+7, TXREG1 ; RCREG1=0x76
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1152 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1153 movff char_I_gas_avail_size+8, TXREG1 ; RCREG1=0x77
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1154 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1155 movff char_I_gas_avail_size+9, TXREG1 ; RCREG1=0x78
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1156 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1157 movff char_I_gas_avail_pres+5, TXREG1 ; RCREG1=0x79
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1158 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1159 movff char_I_gas_avail_pres+6, TXREG1 ; RCREG1=0x7A
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1160 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1161 movff char_I_gas_avail_pres+7, TXREG1 ; RCREG1=0x7B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1162 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1163 movff char_I_gas_avail_pres+8, TXREG1 ; RCREG1=0x7C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1164 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1165 movff char_I_gas_avail_pres+9, TXREG1 ; RCREG1=0x7D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1166 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1167 movff opt_TR_mode, TXREG1 ; RCREG1=0x7E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1168 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1169 movff opt_TR_1st_pres, TXREG1 ; RCREG1=0x7F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1170 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1171 movff opt_TR_2nd_pres, TXREG1 ; RCREG1=0x80
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1172 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1173 movff opt_TR_Bail_pres, TXREG1 ; RCREG1=0x81
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1174 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1175 movff char_I_max_pres_diff, TXREG1 ; RCREG1=0x82
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1176 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1177 movff opt_ZfactorUse, TXREG1 ; RCREG1=0x83
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1178 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1179 movff opt_ZfactorTemp, TXREG1 ; RCREG1=0x84
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1180 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1181 movff opt_2ndDepthDisp, TXREG1 ; RCREG1=0x85
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1182 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1183 movff opt_max_depth, TXREG1 ; RCREG1=0x86
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1184 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1185 movff char_I_descent_speed, TXREG1 ; RCREG1=0x87
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1186 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1187 movff opt_store_apnoe_dive, TXREG1 ; RCREG1=0x88
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1188 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1189 movff opt_tissue_graphics, TXREG1 ; RCREG1=0x89
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1190 dcfsnz WREG
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1191 movff opt_layout, TXREG1 ; RCREG1=0x8A
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1192 dcfsnz WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1193 movff opt_extended_stops, TXREG1 ; RCREG1=0x8B
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1194 dcfsnz WREG
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1195 movff char_I_gas_density_att, TXREG1 ; RCREG1=0x8C
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1196 dcfsnz WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1197 movff char_I_gas_density_warn, TXREG1 ; RCREG1=0x8D
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1198 dcfsnz WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1199 movff char_I_dil_ppO2_check, TXREG1 ; RCREG1=0x8E
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1200
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1201 comm_read_abort:
255
ad62dff7739a add bearing option to compass
heinrichsweikamp
parents: 252
diff changeset
1202 comm_read_done:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1203 bra comm_download_mode0 ; done, loop with timeout reset
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1204
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1205 ;-----------------------------------------------------------------------------
157
5ee76921e359 make new parameters configurable through pc
heinrichsweikamp
parents: 150
diff changeset
1206
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1207 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1208 ; -------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1209 ; opt_gas_O2_ratio res 5 ; O2 ratios of OC/bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1210 ; opt_dil_O2_ratio res 5 ; O2 ratios of diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1211 ; opt_gas_He_ratio res 5 ; He ratios of OC/bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1212 ; opt_dil_He_ratio res 5 ; He ratios of diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1213 ; opt_gas_type res 5 ; OC/bailout gas type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1214 ; opt_dil_type res 5 ; dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1215 ; opt_gas_change res 5 ; change depths for OC/Bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1216 ; opt_dil_change res 5 ; change depths for diluents
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1217
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1218 comm_read_gas_dil:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1219 lfsr FSR0,opt_gas_O2_ratio ; load base address of gas data arrays
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1220 movf up,W ; load index (0-9) of gas/dil into WREG, addressing O2 ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1221 movff PLUSW0, TXREG1 ; transmit O2 ratio
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1222 rcall comm_write_byte ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1223 addlw .10 ; increment index by 10, addressing He ratio now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1224 movff PLUSW0, TXREG1 ; transmit He ratio
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1225 rcall comm_write_byte ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1226 addlw .10 ; increment index by 10, addressing gas/dil type now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1227 movff PLUSW0, TXREG1 ; transmit gas/dil type
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1228 rcall comm_write_byte ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1229 addlw .10 ; increment index by 10, addressing change depth now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1230 movff PLUSW0,TXREG1 ; transmit change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1231 bra comm_read_done ; done, wait for UART and loop with timeout reset
110
d39493c786a2 BUGFIX: OSTC settings via USB issues
heinrichsweikamp
parents: 97
diff changeset
1232
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1233
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1234 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1235 ; -------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1236 ; opt_setpoint_cbar res 5 ; setpoints in cbar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1237 ; opt_setpoint_change res 5 ; change depth for the setpoints in meter
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1238
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1239 comm_read_sp:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1240 lfsr FSR0,opt_setpoint_cbar ; load base address of setpoint cbar values
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1241 movf up,W ; load index (0-4) of setpoint into WREG, addressing cbar value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1242 movff PLUSW0, TXREG1 ; transmit setpoint cbar value
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1243 rcall comm_write_byte ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1244 addlw .5 ; increment index by 5, addressing change depth now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1245 movff PLUSW0, TXREG1 ; transmit change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1246 bra comm_read_done ; done, wait for UART and loop with timeout reset
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1247
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1248 ;-----------------------------------------------------------------------------
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1249
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1250 comm_write_setting:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1251 movlw "w"
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1252 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1253 rcall comm_get_byte ; "Byte 2"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1254 btfsc rs232_rx_timeout ; got a byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1255 bra comm_write_abort ; NO - abort
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1256 movff RCREG1,lo ; copy
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1257 rcall comm_get_byte ; "Byte 3"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1258 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1259 movlw 0x0F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1260 cpfsgt lo ; 0x00-0x0F: unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1261 bra comm_write_abort ; abort!
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1262 subwf lo,W ; subtract unused commands
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1263
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1264 clrf up ; set gas/dil index to 0 (0 = gas 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1265 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1266 bra comm_write_gas_dil ; RCREG1=0x10
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1267 incf up ; increment gas/dil index (1 = gas 2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1268 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1269 bra comm_write_gas_dil ; RCREG1=0x11
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1270 incf up ; increment gas/dil index (2 = gas 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1271 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1272 bra comm_write_gas_dil ; RCREG1=0x12
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1273 incf up ; increment gas/dil index (3 = gas 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1274 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1275 bra comm_write_gas_dil ; RCREG1=0x13
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1276 incf up ; increment gas/dil index (4 = gas 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1277 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1278 bra comm_write_gas_dil ; RCREG1=0x14
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1279 incf up ; increment gas/dil index (5 = dil 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1280 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1281 bra comm_write_gas_dil ; RCREG1=0x15
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1282 incf up ; increment gas/dil index (6 = dil 2)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1283 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1284 bra comm_write_gas_dil ; RCREG1=0x16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1285 incf up ; increment gas/dil index (7 = dil 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1286 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1287 bra comm_write_gas_dil ; RCREG1=0x17
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1288 incf up ; increment gas/dil index (8 = dil 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1289 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1290 bra comm_write_gas_dil ; RCREG1=0x18
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1291 incf up ; increment gas/dil index (9 = dil 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1292 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1293 bra comm_write_gas_dil ; RCREG1=0x19
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1294
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1295 clrf up ; set setpoint index to 0 (0 = SP 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1296 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1297 bra comm_write_sp ; RCREG1=0x1A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1298 incf up ; increment setpoint index (1 = SP2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1299 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1300 bra comm_write_sp ; RCREG1=0x1B
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1301 incf up ; increment setpoint index (2 = SP3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1302 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1303 bra comm_write_sp ; RCREG1=0x1C
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1304 incf up ; increment setpoint index (3 = SP4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1305 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1306 bra comm_write_sp ; RCREG1=0x1D
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1307 incf up ; increment setpoint index (4 = SP5)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1308 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1309 bra comm_write_sp ; RCREG1=0x1E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1310
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1311 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1312 movff RCREG1, opt_ccr_mode ; RCREG1=0x1F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1313 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1314 movff RCREG1, opt_dive_mode ; RCREG1=0x20
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1315 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1316 movff RCREG1, char_I_deco_model ; RCREG1=0x21
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1317 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1318 movff RCREG1, char_I_ppO2_max_work ; RCREG1=0x22
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1319 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1320 movff RCREG1, char_I_ppO2_min ; RCREG1=0x23
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1321 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1322 movff RCREG1, char_I_extra_time ; RCREG1=0x24
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1323 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1324 movff RCREG1, opt_GF_low ; RCREG1=0x25
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1325 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1326 movff RCREG1, opt_GF_high ; RCREG1=0x26
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1327 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1328 movff RCREG1, opt_aGF_low ; RCREG1=0x27
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1329 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1330 movff RCREG1, opt_aGF_high ; RCREG1=0x28
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1331 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1332 movff RCREG1, opt_enable_aGF ; RCREG1=0x29
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1333 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1334 movff RCREG1, opt_sat_multiplier_non_gf ; RCREG1=0x2A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1335 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1336 movff RCREG1, opt_desat_multiplier_non_gf ; RCREG1=0x2B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1337 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1338 movff RCREG1, opt_last_stop ; RCREG1=0x2C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1339 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1340 movff RCREG1, opt_brightness ; RCREG1=0x2D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1341 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1342 movff RCREG1, opt_units ; RCREG1=0x2E
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1343 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1344 movff RCREG1, opt_sampling_rate ; RCREG1=0x2F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1345 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1346 movff RCREG1, opt_salinity ; RCREG1=0x30
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1347 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1348 movff RCREG1, opt_dive_color_scheme ; RCREG1=0x31
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1349 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1350 movff RCREG1, opt_language ; RCREG1=0x32
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1351 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1352 movff RCREG1, opt_dateformat ; RCREG1=0x33
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1353 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1354 movff RCREG1, opt_compass_gain ; RCREG1=0x34
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1355 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1356 movff RCREG1, opt_pressure_adjust ; RCREG1=0x35
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1357 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1358 movff RCREG1, opt_enable_safetystop ; RCREG1=0x36
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1359 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1360 movff RCREG1, opt_calibration_O2_ratio; RCREG1=0x37
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1361 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1362 nop ; RCREG1=0x38 NOT USED ANYMORE (ex opt_sensor_fallback)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1363 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1364 movff RCREG1, opt_flip_screen ; RCREG1=0x39
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1365 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1366 movff RCREG1, opt_cR_button_left ; RCREG1=0x3A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1367 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1368 movff RCREG1, opt_cR_button_right ; RCREG1=0x3B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1369 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1370 movff RCREG1, char_I_SAC_work ; RCREG1=0x3C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1371 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1372 movff RCREG1, char_I_SAC_deco ; RCREG1=0x3D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1373 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1374 movff RCREG1, opt_modwarning ; RCREG1=0x3E
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1375 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1376 movff RCREG1, opt_vsitextv2 ; RCREG1=0x3F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1377 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1378 movff RCREG1, opt_vsigraph ; RCREG1=0x40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1379 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1380 movff RCREG1, opt_showppo2 ; RCREG1=0x41, always show ppO2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1381 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1382 movff RCREG1, opt_temperature_adjust ; RCREG1=0x42
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1383 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1384 movff RCREG1, opt_safety_stop_length ; RCREG1=0x43
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1385 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1386 movff RCREG1, opt_safety_stop_start ; RCREG1=0x44
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1387 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1388 movff RCREG1, opt_safety_stop_end ; RCREG1=0x45
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1389 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1390 movff RCREG1, opt_safety_stop_reset ; RCREG1=0x46
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1391 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1392 nop ; RCREG1=0x47, ignore conservatism for standard hwOS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1393 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1394 movff RCREG1, opt_diveTimeout ; RCREG1=0x48
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1395 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1396 bra comm_write_button_polarity ; RCREG1=0x49
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1397 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1398 movff RCREG1, char_I_PSCR_drop ; RCREG1=0x4A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1399 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1400 movff RCREG1, char_I_PSCR_lungratio ; RCREG1=0x4B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1401 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1402 movff RCREG1, char_I_ppO2_max_deco ; RCREG1=0x4C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1403 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1404 movff RCREG1, char_I_ppO2_min_loop ; RCREG1=0x4D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1405 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1406 movff RCREG1, char_I_gas_avail_size+0 ; RCREG1=0x4E
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1407 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1408 movff RCREG1, char_I_gas_avail_size+1 ; RCREG1=0x4F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1409 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1410 movff RCREG1, char_I_gas_avail_size+2 ; RCREG1=0x50
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1411 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1412 movff RCREG1, char_I_gas_avail_size+3 ; RCREG1=0x51
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1413 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1414 movff RCREG1, char_I_gas_avail_size+4 ; RCREG1=0x52
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1415 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1416 movff RCREG1, char_I_gas_avail_pres+0 ; RCREG1=0x53
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1417 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1418 movff RCREG1, char_I_gas_avail_pres+1 ; RCREG1=0x54
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1419 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1420 movff RCREG1, char_I_gas_avail_pres+2 ; RCREG1=0x55
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1421 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1422 movff RCREG1, char_I_gas_avail_pres+3 ; RCREG1=0x56
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1423 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1424 movff RCREG1, char_I_gas_avail_pres+4 ; RCREG1=0x57
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1425 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1426 movff RCREG1, char_I_CC_max_frac_O2 ; RCREG1=0x58
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1427 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1428 movff RCREG1, opt_sim_setpoint_number ; RCREG1=0x59
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1429 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1430 movff RCREG1, opt_calc_asc_gasvolume ; RCREG1=0x5A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1431 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1432 movff RCREG1, opt_sim_use_aGF ; RCREG1=0x5B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1433 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1434 movff RCREG1, char_I_altitude_wait ; RCREG1=0x5C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1435 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1436 movff RCREG1, opt_enable_IBCD ; RCREG1=0x5D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1437 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1438 movff RCREG1, opt_sat_multiplier_gf ; RCREG1=0x5E
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1439 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1440 movff RCREG1, opt_desat_multiplier_gf ; RCREG1=0x5F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1441 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1442 movff RCREG1, opt_transmitter_id_1+0 ; RCREG1=0x60
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1443 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1444 movff RCREG1, opt_transmitter_id_1+1 ; RCREG1=0x61
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1445 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1446 movff RCREG1, opt_transmitter_id_2+0 ; RCREG1=0x62
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1447 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1448 movff RCREG1, opt_transmitter_id_2+1 ; RCREG1=0x63
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1449 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1450 movff RCREG1, opt_transmitter_id_3+0 ; RCREG1=0x64
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1451 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1452 movff RCREG1, opt_transmitter_id_3+1 ; RCREG1=0x65
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1453 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1454 movff RCREG1, opt_transmitter_id_4+0 ; RCREG1=0x66
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1455 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1456 movff RCREG1, opt_transmitter_id_4+1 ; RCREG1=0x67
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1457 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1458 movff RCREG1, opt_transmitter_id_5+0 ; RCREG1=0x68
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1459 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1460 movff RCREG1, opt_transmitter_id_5+1 ; RCREG1=0x69
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1461 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1462 movff RCREG1, opt_transmitter_id_6+0 ; RCREG1=0x6A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1463 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1464 movff RCREG1, opt_transmitter_id_6+1 ; RCREG1=0x6B
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1465 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1466 movff RCREG1, opt_transmitter_id_7+0 ; RCREG1=0x6C
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1467 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1468 movff RCREG1, opt_transmitter_id_7+1 ; RCREG1=0x6D
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1469 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1470 movff RCREG1, opt_transmitter_id_8+0 ; RCREG1=0x6E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1471 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1472 movff RCREG1, opt_transmitter_id_8+1 ; RCREG1=0x6F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1473 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1474 movff RCREG1, opt_transmitter_id_9+0 ; RCREG1=0x70
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1475 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1476 movff RCREG1, opt_transmitter_id_9+1 ; RCREG1=0x71
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1477 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1478 movff RCREG1, opt_transmitter_id_10+0 ; RCREG1=0x72
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1479 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1480 movff RCREG1, opt_transmitter_id_10+1 ; RCREG1=0x73
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1481 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1482 movff RCREG1, char_I_gas_avail_size+5 ; RCREG1=0x74
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1483 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1484 movff RCREG1, char_I_gas_avail_size+6 ; RCREG1=0x75
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1485 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1486 movff RCREG1, char_I_gas_avail_size+7 ; RCREG1=0x76
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1487 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1488 movff RCREG1, char_I_gas_avail_size+8 ; RCREG1=0x77
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1489 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1490 movff RCREG1, char_I_gas_avail_size+9 ; RCREG1=0x78
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1491 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1492 movff RCREG1, char_I_gas_avail_pres+5 ; RCREG1=0x79
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1493 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1494 movff RCREG1, char_I_gas_avail_pres+6 ; RCREG1=0x7A
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1495 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1496 movff RCREG1, char_I_gas_avail_pres+7 ; RCREG1=0x7B
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1497 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1498 movff RCREG1, char_I_gas_avail_pres+8 ; RCREG1=0x7C
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1499 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1500 movff RCREG1, char_I_gas_avail_pres+9 ; RCREG1=0x7D
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1501 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1502 movff RCREG1, opt_TR_mode ; RCREG1=0x7E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1503 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1504 movff RCREG1, opt_TR_1st_pres ; RCREG1=0x7F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1505 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1506 movff RCREG1, opt_TR_2nd_pres ; RCREG1=0x80
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1507 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1508 movff RCREG1, opt_TR_Bail_pres ; RCREG1=0x81
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1509 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1510 movff RCREG1, char_I_max_pres_diff ; RCREG1=0x82
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1511 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1512 movff RCREG1, opt_ZfactorUse ; RCREG1=0x83
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1513 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1514 movff RCREG1, opt_ZfactorTemp ; RCREG1=0x84
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1515 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1516 movff RCREG1, opt_2ndDepthDisp ; RCREG1=0x85
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1517 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1518 movff RCREG1, opt_max_depth ; RCREG1=0x86
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1519 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1520 movff RCREG1, char_I_descent_speed ; RCREG1=0x87
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1521 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1522 movff RCREG1, opt_store_apnoe_dive ; RCREG1=0x88
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1523 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1524 movff RCREG1, opt_tissue_graphics ; RCREG1=0x89
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1525 dcfsnz WREG
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1526 movff RCREG1, opt_layout ; RCREG1=0x8A
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1527 dcfsnz WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1528 movff RCREG1, opt_extended_stops ; RCREG1=0x8B
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1529 dcfsnz WREG
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1530 movff RCREG1, char_I_gas_density_att ; RCREG1=0x8C
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1531 dcfsnz WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1532 movff RCREG1, char_I_gas_density_warn ; RCREG1=0x8D
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1533 dcfsnz WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1534 movff RCREG1, char_I_dil_ppO2_check ; RCREG1=0x8E
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1535
562
8b7ea27ea1fa seperate desat and sat multipliers for GF and Non-GF modes. Set to 100/100 as default in GF mode
heinrichsweikamp
parents: 560
diff changeset
1536
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1537 comm_write_abort:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1538 comm_write_done:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1539 ; check options, gases and diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1540 call option_check_all ; check all options (and reset if not within their min/max boundaries)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1541 goto comm_download_mode0 ; done, loop with timeout reset
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1542
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1543 ;-----------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1544
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1545 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1546 ; -------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1547 ; opt_gas_O2_ratio res 5 ; O2 ratios of OC/bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1548 ; opt_dil_O2_ratio res 5 ; O2 ratios of diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1549 ; opt_gas_He_ratio res 5 ; He ratios of OC/bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1550 ; opt_dil_He_ratio res 5 ; He ratios of diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1551 ; opt_gas_type res 5 ; OC/bailout gas type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1552 ; opt_dil_type res 5 ; dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1553 ; opt_gas_change res 5 ; change depths for OC/Bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1554 ; opt_dil_change res 5 ; change depths for diluents
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1555
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1556 comm_write_gas_dil:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1557 lfsr FSR0,opt_gas_O2_ratio ; load base address of gas data arrays
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1558 movf up,W ; load index (0-9) of gas/dil into WREG, addressing O2 ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1559 movff RCREG1,PLUSW0 ; receive O2 ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1560 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1561 addlw .10 ; increment index by 10, addressing He ratio now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1562 movff RCREG1,PLUSW0 ; receive He ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1563 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1564 addlw .10 ; increment index by 10, addressing gas/dil type now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1565 movff RCREG1,PLUSW0 ; receive gas/dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1566 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1567 addlw .10 ; increment index by 10, addressing change depth now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1568 movff RCREG1,PLUSW0 ; receive change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1569 bra comm_write_done ; done, loop with timeout reset
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1570
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1571
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1572 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1573 ; -------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1574 ; opt_setpoint_cbar res 5 ; setpoints in cbar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1575 ; opt_setpoint_change res 5 ; change depth for the setpoints in meter
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1576
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1577 comm_write_sp:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1578 lfsr FSR0,opt_setpoint_cbar ; load base address of setpoint cbar values
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1579 movf up,W ; load index (0-4) of setpoint into WREG, addressing cbar value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1580 movff RCREG1,PLUSW0 ; receive setpoint cbar value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1581 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1582 addlw .5 ; increment index by 5, addressing change depth now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1583 movff RCREG1,PLUSW0 ; receive change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1584 bra comm_write_done ; done, loop with timeout reset
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1585
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1586 ;-----------------------------------------------------------------------------
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1587
0
heinrichsweikamp
parents:
diff changeset
1588 comm_send_string:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1589 movlw "n" ; send echo
0
heinrichsweikamp
parents:
diff changeset
1590 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1591 call comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1592 WIN_SMALL comm_string_column, comm_string_row
0
heinrichsweikamp
parents:
diff changeset
1593 movlw .16
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1594 movwf lo ; counter
0
heinrichsweikamp
parents:
diff changeset
1595 comm_send_string_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1596 call comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1597 btfsc rs232_rx_timeout ; got a byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1598 bra comm_send_string_abort ; NO - abort
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1599 movff RCREG1,POSTINC2 ; store character
0
heinrichsweikamp
parents:
diff changeset
1600 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
1601 bra comm_send_string_loop
heinrichsweikamp
parents:
diff changeset
1602 comm_send_string_abort:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1603 STRCAT_PRINT "" ; show the text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1604 goto comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
1605
heinrichsweikamp
parents:
diff changeset
1606 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
1607
475
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1608 comm_write_button_polarity:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1609 ; store RCREG1 into EEPROM .897
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1610 movlw LOW .897
475
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1611 movwf EEADR
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1612 movlw HIGH .897
475
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1613 movwf EEADRH
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1614 movff RCREG1,EEDATA
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1615 movff EEDATA,button_polarity ; 0xFF (both normal), 0x00 (both inverted), 0x01 (left inverted only), 0x02 (right inverted only)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1616 call write_eeprom ; EEDATA into EEPROM@EEADR
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1617 clrf EEADRH ; reset EEADRH
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1618 goto comm_download_mode0 ; done, loop with timeout reset
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1619
0
heinrichsweikamp
parents:
diff changeset
1620 ;----------------------------------------------------------------------------
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1621 END