annotate src/comm.asm @ 623:c40025d8e750

3.03 beta released
author heinrichsweikamp
date Mon, 03 Jun 2019 14:01:48 +0200
parents ca4556fb60b9
children cd58f7fc86db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
3 ; File comm.asm combined next generation V3.03.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
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
94 TFT_WRITE_PROM_IMAGE_BY_ADDR usb_ble_logo_block ; show USB/BLE logo, respective logo is stored in bootloader section dependent on OSTC type
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
95 WIN_SMALL comm_status1_column,comm_status1_row ; positioning of status message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
96 STRCPY_TEXT_PRINT tUsbStarting ; print status message "starting..."
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
97 WIN_TINY .40,.240-.16 ; set output position to bottom line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
98 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
99 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
100
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
101 IFDEF _screendump
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
102 bcf screen_dump_avail ; disable screen dump function
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
103 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
104
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
105 bcf switch_right ; clear left-over right button event
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
106 bcf comm_service_enabled ; communication is not yet established
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
107 bsf surfmode_menu ; flag that restart will be entered from surface menu / comm mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
108 movlw timeout_comm_pre_mode ; get timeout for phase without communication established yet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
109 movwf comm_timeout_timer ; initialize timeout counter
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
110 WIN_SMALL comm_status1_column+.80,comm_status1_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
111 STRCPY_TEXT_PRINT tUsbStartDone ; add to status message "done..."
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
112 call enable_rs232 ; enable serial comm, also sets CPU to normal speed
0
heinrichsweikamp
parents:
diff changeset
113 comm_mode1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
114 bcf trigger_full_second ; clear 'one second elapsed' flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
115 bcf LEDr ; switch off red LED / power down TR co-processor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
116 dcfsnz comm_timeout_timer,F ; decrement timeout, reached zero?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
117 bra comm_service_exit ; YES - timeout, exit comm mode
0
heinrichsweikamp
parents:
diff changeset
118 comm_mode2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
119 rcall comm_get_byte ; read 1 byte from RX buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
120 movlw 0xAA ; coding of service mode start byte: 0xAA
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
121 cpfseq RCREG1 ; received service mode start byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
122 bra comm_mode2a ; NO - probe for download mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
123 bra comm_mode2b ; YES - received start byte for service mode
0
heinrichsweikamp
parents:
diff changeset
124 comm_mode2a:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
125 movlw 0xBB ; coding of download mode start byte: 0xBB
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
126 cpfseq RCREG1 ; received download mode start byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
127 bra comm_mode2c ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
128 bra comm_download_mode ; YES - received start byte for download mode
393
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
129 comm_mode2c:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
130 btfss vusb_in ; USB plugged in?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
131 bra comm_service_exit_nousb_delay; NO - disconnected, exit comm mode
393
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
132 comm_mode4a:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
133 btfsc switch_right ; right button pressed?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
134 bra comm_service_exit ; YES - exit comm mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
135 btfsc trigger_full_second ; NO - did 1 second elapsed meanwhile?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
136 bra comm_mode1 ; YES - loop with clocking down timeout counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
137 bra comm_mode2 ; NO - loop without clocking down timeout counter
0
heinrichsweikamp
parents:
diff changeset
138
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
139 ; received start byte for service mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
140 comm_mode2b:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
141 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
142 movlw 0x4B ; prepare answer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
143 movwf TXREG1 ; send answer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
144 ; check if correct service key is received
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
145 rcall comm_get_byte ; receive first byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
146 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
147 movff RCREG1,TXREG1 ; echo received byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
148 movlw UPPER comm_service_key ; load expected byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
149 cpfseq RCREG1 ; received expected byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
150 bra comm_mode1 ; NO - restart
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
151 rcall comm_get_byte ; receive second byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
152 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
153 movff RCREG1,TXREG1 ; echo received byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
154 movlw HIGH (comm_service_key & 0xFFFF) ; load expected byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
155 cpfseq RCREG1 ; received expected byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
156 bra comm_mode1 ; NO - restart
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
157 rcall comm_get_byte ; receive third byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
158 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
159 movff RCREG1,TXREG1 ; echo received byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
160 movlw LOW comm_service_key ; load expected byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
161 cpfseq RCREG1 ; received expected byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
162 bra comm_mode1 ; NO - restart
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
163 ; YES to all - enable com service mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
164 WIN_SMALL comm_status2_column, comm_status2_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
165 STRCPY_TEXT_PRINT tUsbServiceMode ; print service mode enabled message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
166 bsf comm_service_enabled ; set flag for com service mode enabled
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
167 bra comm_download_mode0 ; continue using common routine
69
50697bd41c54 +CHANGE: Some French Translations
heinrichsweikamp
parents: 66
diff changeset
168
50697bd41c54 +CHANGE: Some French Translations
heinrichsweikamp
parents: 66
diff changeset
169 comm_service_exit_nousb_delay:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
170 WAITMS d'200' ; wait 200 ms
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
171 btfsc vusb_in ; USB plugged in?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
172 bra comm_mode4a ; YES - (still) connected, return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
173 comm_service_exit_nousb: ; NO - disconnected
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
174 WIN_SMALL comm_status3_column, comm_status3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
175 STRCPY_TEXT_PRINT tUsbClosed ; print port closed message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
176 bra comm_service_exit_common ; exit to restart
0
heinrichsweikamp
parents:
diff changeset
177
heinrichsweikamp
parents:
diff changeset
178 comm_service_exit:
heinrichsweikamp
parents:
diff changeset
179 WIN_SMALL comm_status3_column, comm_status3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
180 STRCPY_TEXT_PRINT tUsbExit ; print exited message
0
heinrichsweikamp
parents:
diff changeset
181 comm_service_exit_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
182 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
183 movlw 0xFF ; prepare reply "FF"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
184 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
185 call wait_1s ; wait <= 1 second
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
186 call wait_1s ; wait 1 second
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
187 call disable_rs232 ; shut down comm port
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
188 goto restart ; restart
0
heinrichsweikamp
parents:
diff changeset
189
heinrichsweikamp
parents:
diff changeset
190
heinrichsweikamp
parents:
diff changeset
191 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
192 ; Start Bootloader
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
193 ;
0
heinrichsweikamp
parents:
diff changeset
194 comm_service_ll_bootloader:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
195 bsf LEDr ; switch on red LED
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
196 WIN_SMALL comm_status3_column, comm_status3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
197 STRCPY_TEXT_PRINT tUsbLlBld ; print low level bootloader started message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
198 WIN_TOP comm_warning_row ; set row for icon
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
199 WIN_LEFT comm_warning_column ; set column for icon
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
200 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; show the warning icon
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
201 goto 0x1FF0C ; jump into the bootloader code
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
202
0
heinrichsweikamp
parents:
diff changeset
203
heinrichsweikamp
parents:
diff changeset
204 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
205 ; Send Firmware to Bootloader
0
heinrichsweikamp
parents:
diff changeset
206 ;
heinrichsweikamp
parents:
diff changeset
207 comm_send_firmware:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
208 movlw 0x50 ; prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
209 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
210 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
211 lfsr FSR2,buffer ; load base address of buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
212 movlw .5 ; read 5 bytes into buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
213 movwf lo ; initialize loop counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
214 movlw 0x55 ; initialize checksum byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
215 movwf hi ; store in hi
0
heinrichsweikamp
parents:
diff changeset
216 comm_send_firmware_loop:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
217 rcall comm_get_byte ; receive one byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
218 btfsc rs232_rx_timeout ; got a byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
219 bra comm_send_firmware_abort ; NO - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
220 movf RCREG1,W ; YES - copy received byte to WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
221 movwf POSTINC2 ; - copy received byte to buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
222 xorwf hi,F ; - xor received byte into checksum
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
223 rlncf hi,F ; - rotate checksum byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
224 decfsz lo,F ; - decrement loop counter, done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
225 bra comm_send_firmware_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
226 movf hi,W ; YES - copy checksum to WREG, zero flag set?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
227 bnz comm_send_firmware_failed ; NO - checksum test failed
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
228 movlw 0x4C ; YES - checksum ok, prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
229 movwf TXREG1 ; - send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
230 rcall comm_write_byte ; - wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
231 call vault_decodata_into_eeprom ; - store last deco data (and time/date) to EEPROM
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
232 goto 0x1FDF0 ; - jump into the bootloader code
0
heinrichsweikamp
parents:
diff changeset
233
heinrichsweikamp
parents:
diff changeset
234 comm_send_firmware_failed:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
235 WIN_SMALL comm_string_column, comm_string_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
236 call TFT_warning_color ; set warning color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
237 STRCPY_PRINT "Checksum failed" ; print failure message
0
heinrichsweikamp
parents:
diff changeset
238 comm_send_firmware_abort:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
239 movlw 0xFF ; prepare reply for ABORTED
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
240 movwf TXREG1 ; send reply
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
241 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
242
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
243
0
heinrichsweikamp
parents:
diff changeset
244 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
245 ; Reset to Dive 1 in Logbook
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
246 ;
0
heinrichsweikamp
parents:
diff changeset
247 comm_reset_logbook_pointers:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
248 call eeprom_reset_logbook_pointers ; clear logbook pointers in EEPROM
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
249 call ext_flash_erase_logbook ; clear complete logbook(!)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
250 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
251
heinrichsweikamp
parents:
diff changeset
252 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
253 ; Reset Battery Gauge
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
254 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
255 comm_reset_battery_gauge: ; reset battery gauge registers
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
256 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
257 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
258
heinrichsweikamp
parents:
diff changeset
259 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
260 ; Erase a Memory Range given byte Start Address and Number of 4 kB Blocks
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
261 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
262 comm_erase_range4kb:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
263 movlw 0x42 ; prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
264 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
265 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
266 bcf INTCON,GIE ; disable all interrupts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
267 rcall comm_get_flash_address ; get three bytes start address or return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
268 btfsc rs232_rx_timeout ; got start address?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
269 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
270 rcall comm_get_byte ; YES - get number of blocks
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
271 btfsc rs232_rx_timeout ; - got number?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
272 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
273 movff RCREG1,lo ; YES - copy number of blocks to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
274 comm_erase_range4kb_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
275 call ext_flash_erase4kB ; - erase a memory block
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
276 movlw 0x10 ; - increase start address by 4096 (0x1000)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
277 addwf ext_flash_address+1,F ; - ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
278 movlw .0 ; - ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
279 addwfc ext_flash_address+2,F ; - ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
280 decfsz lo,F ; - decrement block counter, all blocks done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
281 bra comm_erase_range4kb_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
282 bra comm_download_mode0 ; YES - done
0
heinrichsweikamp
parents:
diff changeset
283
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
284 ;-----------------------------------------------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
285 ; Erase one Memory Block of 4 kB Size
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
286 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
287 comm_erase_4kb:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
288 bcf INTCON,GIE ; disable all interrupts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
289 rcall comm_get_flash_address ; get three bytes start address or return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
290 btfsc rs232_rx_timeout ; got start address?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
291 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
292 call ext_flash_erase4kB ; YES - erase memory block
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
293 bra comm_download_mode0 ; - done
0
heinrichsweikamp
parents:
diff changeset
294
heinrichsweikamp
parents:
diff changeset
295 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
296 ; Write a Stream of Data Bytes to Memory
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
297 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
298 comm_write_range:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
299 movlw 0x30 ; prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
300 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
301 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
302 bcf INTCON,GIE ; disable all interrupts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
303 rcall comm_get_flash_address ; get three bytes starts address or return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
304 btfsc rs232_rx_timeout ; got start address?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
305 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
306 comm_write_range_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
307 rcall comm_get_byte ; YES - get data byte to write to memory
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
308 btfsc rs232_rx_timeout ; got byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
309 bra comm_download_mode0 ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
310 movf RCREG1,W ; YES - copy received data byte to WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
311 ; bsf NCTS ; - hold Bluetooth chip (requires PC/Android/iOS side to use flow control...)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
312 call ext_flash_byte_write_comms ; - write data byte to flash memory
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
313 ; bcf NCTS ; - release Bluetooth chip (requires PC/Android/iOS side to use flow control...)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
314 call incf_ext_flash_address_p1 ; - increase address
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
315 bra comm_write_range_loop ; - loop
0
heinrichsweikamp
parents:
diff changeset
316
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
317
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
318 ;-----------------------------------------------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
319 ; Read a Memory Section given by Start Address and Length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
320 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
321 comm_send_range:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
322 movlw 0x20 ; prepare reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
323 movwf TXREG1 ; send reply
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
324 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
325 bcf INTCON,GIE ; disable all interrupts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
326 rcall comm_get_flash_address ; get three bytes start address or return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
327 btfsc rs232_rx_timeout ; got start address?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
328 bra comm_download_mode0 ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
329 rcall comm_get_byte ; get length, 3rd byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
330 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
331 bra comm_download_mode0 ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
332 movff RCREG1,up ; store length, 3rd byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
333 rcall comm_get_byte ; get length, 2nd byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
334 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
335 bra comm_download_mode0 ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
336 movff RCREG1,hi ; store length, 2nd byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
337 rcall comm_get_byte ; get length, 1st byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
338 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
339 bra comm_download_mode0 ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
340 movff RCREG1,lo ; store length, 1st byte
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
341 ; 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
342 movf lo,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
343 bnz $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
344 decf hi,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
345 movlw 0x40
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
346 cpfslt up ; up > 0x3F ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
347 bra comm_download_mode0 ; YES - abort
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
348 ; 6 bytes received, send data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
349 ; needs ext_flash_address:3 start address and up:hi:lo amount
0
heinrichsweikamp
parents:
diff changeset
350 call ext_flash_read_block_start
heinrichsweikamp
parents:
diff changeset
351 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
352 bra comm_send_range24 ; counter 24 bit
0
heinrichsweikamp
parents:
diff changeset
353 comm_send_range24_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
354 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
355 movwf TXREG1 ; start new transmit
0
heinrichsweikamp
parents:
diff changeset
356 comm_send_range24:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
357 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
358 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
359 bra comm_send_range24_loop
heinrichsweikamp
parents:
diff changeset
360 decf hi,F
heinrichsweikamp
parents:
diff changeset
361 movlw 0xFF
heinrichsweikamp
parents:
diff changeset
362 cpfseq hi
heinrichsweikamp
parents:
diff changeset
363 bra comm_send_range24_loop
heinrichsweikamp
parents:
diff changeset
364 decf up,F
heinrichsweikamp
parents:
diff changeset
365 movlw 0xFF
heinrichsweikamp
parents:
diff changeset
366 cpfseq up
heinrichsweikamp
parents:
diff changeset
367 bra comm_send_range24_loop
heinrichsweikamp
parents:
diff changeset
368 call ext_flash_read_block_stop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
369 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
370
heinrichsweikamp
parents:
diff changeset
371 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
372
heinrichsweikamp
parents:
diff changeset
373 comm_get_flash_address:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
374 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
375 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
376 return ; NO - return
0
heinrichsweikamp
parents:
diff changeset
377 movff RCREG1,ext_flash_address+2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
378 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
379 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
380 return ; NO - return
0
heinrichsweikamp
parents:
diff changeset
381 movff RCREG1,ext_flash_address+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
382 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
383 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
384 return ; NO - return
0
heinrichsweikamp
parents:
diff changeset
385 movff RCREG1,ext_flash_address+0
heinrichsweikamp
parents:
diff changeset
386 return
heinrichsweikamp
parents:
diff changeset
387
heinrichsweikamp
parents:
diff changeset
388 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
389
heinrichsweikamp
parents:
diff changeset
390 comm_download_mode:
heinrichsweikamp
parents:
diff changeset
391 ; Enable comm download mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
392 WIN_SMALL comm_status2_column, comm_status2_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
393 STRCPY_TEXT_PRINT tUsbDownloadMode ; download mode enabled
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
394 bsf INTCON,GIE ; all interrupts on
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
395 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
396 movlw 0xBB ; command echo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
397 movwf TXREG1 ; send answer
0
heinrichsweikamp
parents:
diff changeset
398 comm_download_mode0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
399 bsf INTCON,GIE ; all interrupts on
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
400 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
401 movlw 0x4C ; default reply is 4C for service mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
402 btfss comm_service_enabled ; com service enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
403 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
404 movwf TXREG1 ; send answer
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
405 movlw timeout_service_mode ; get timeout value
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
406 movwf comm_timeout_timer ; load into timeout counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
407 bcf switch_right ; clear left-over button event
0
heinrichsweikamp
parents:
diff changeset
408 comm_download_mode1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
409 bcf trigger_full_second ; clear 'one second elapsed' flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
410 dcfsnz comm_timeout_timer,F ; decrement timeout, reached zero?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
411 bra comm_service_exit ; YES - exit
0
heinrichsweikamp
parents:
diff changeset
412 comm_download_mode2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
413 rcall comm_get_byte ; No - check for a byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
414 btfsc comm_service_enabled ; com service mode enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
415 btg LEDr ; YES - blink in service mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
416 btfss vusb_in ; USB plugged in?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
417 bra comm_service_exit_nousb ; NO - disconnected -> exit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
418 btfsc switch_right ; YES - shall abort?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
419 bra comm_service_exit ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
420 btfsc trigger_full_second ; NO - did 1 second elapsed meanwhile?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
421 bra comm_download_mode1 ; YES - check for timeout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
422 btfsc rs232_rx_timeout ; NO - got a byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
423 bra comm_download_mode2 ; NO - loop waiting for command byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
424 ; YES - command received
0
heinrichsweikamp
parents:
diff changeset
425 bcf LEDr
heinrichsweikamp
parents:
diff changeset
426 movlw 0xFF
heinrichsweikamp
parents:
diff changeset
427 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
428 bra $+4
heinrichsweikamp
parents:
diff changeset
429 bra comm_service_exit ; exit
heinrichsweikamp
parents:
diff changeset
430 movlw "a"
heinrichsweikamp
parents:
diff changeset
431 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
432 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
433 bra comm_send_headers ; send all 256 dive headers
0
heinrichsweikamp
parents:
diff changeset
434 movlw "b"
heinrichsweikamp
parents:
diff changeset
435 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
436 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
437 bra comm_set_time ; read time and date from the PC and set clock
0
heinrichsweikamp
parents:
diff changeset
438 movlw "c"
heinrichsweikamp
parents:
diff changeset
439 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
440 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
441 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
442 movlw "f" ; 0x66
0
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_dive ; send header and profile for one dive
0
heinrichsweikamp
parents:
diff changeset
446 movlw "i"
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_identify ; send firmware, serial, etc.
235
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
450 movlw "j"
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
451 cpfseq RCREG1
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
452 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
453 bra comm_hardware_descriptor ; send hardware descriptor byte
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
454 movlw 0x60
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
455 cpfseq RCREG1
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
456 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
457 bra comm_feature_and_hardware ; send more detailed information
0
heinrichsweikamp
parents:
diff changeset
458 movlw "n"
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 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
462 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
463 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
464 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
465 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
466 IFDEF _screendump
0
heinrichsweikamp
parents:
diff changeset
467 movlw "l"
heinrichsweikamp
parents:
diff changeset
468 cpfseq RCREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
469 bra $+4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
470 call TFT_dump_screen ; dump the screen contents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
471 ENDIF
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
472 movlw "r"
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
473 cpfseq RCREG1
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
474 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
475 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
476 movlw "w"
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
477 cpfseq RCREG1
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
478 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
479 bra comm_write_setting ; write a setting (into RAM)
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
480 movlw "x"
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
481 cpfseq RCREG1
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
482 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
483 bra comm_option_reset_all ; reset all options to factory default
0
heinrichsweikamp
parents:
diff changeset
484
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
485 btfss comm_service_enabled ; done for download mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
486 bra comm_download_mode0 ; loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
487
heinrichsweikamp
parents:
diff changeset
488 movlw 0x20
heinrichsweikamp
parents:
diff changeset
489 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
490 bra $+4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
491 bra comm_send_range ; send hi:lo:ext_flash_rw bytes starting from ext_flash_address:3
0
heinrichsweikamp
parents:
diff changeset
492 movlw 0x22
heinrichsweikamp
parents:
diff changeset
493 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
494 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
495 bra comm_reset_logbook_pointers ; reset all logbook pointers and the logbook
0
heinrichsweikamp
parents:
diff changeset
496 movlw 0x23
heinrichsweikamp
parents:
diff changeset
497 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
498 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
499 bra comm_reset_battery_gauge ; reset battery gauge registers
0
heinrichsweikamp
parents:
diff changeset
500 movlw 0x30
heinrichsweikamp
parents:
diff changeset
501 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
502 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
503 bra comm_write_range ; write bytes starting from ext_flash_address:3 (stop when timeout)
0
heinrichsweikamp
parents:
diff changeset
504 movlw 0x40
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_erase_4kb ; erase 4 kB block from ext_flash_address:3 (Warning: no confirmation or built-in security here...)
0
heinrichsweikamp
parents:
diff changeset
508 movlw 0x42
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_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
512 movlw 0x50
heinrichsweikamp
parents:
diff changeset
513 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
514 bra $+4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
515 bra comm_send_firmware ; send firmware to bootloader
147
fdd4e30846ae some cleanup
heinrichsweikamp
parents: 136
diff changeset
516 ; movlw "t"
fdd4e30846ae some cleanup
heinrichsweikamp
parents: 136
diff changeset
517 ; cpfseq RCREG1
fdd4e30846ae some cleanup
heinrichsweikamp
parents: 136
diff changeset
518 ; bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
519 ; goto testloop ; start raw-data test loop
0
heinrichsweikamp
parents:
diff changeset
520 movlw 0xC1
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_service_ll_bootloader ; start low-level bootloader
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
524 bra comm_download_mode0 ; loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
525
heinrichsweikamp
parents:
diff changeset
526 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
527
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
528 comm_send_compact_headers:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
529 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
530 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
531 ; send 13 bytes/dive (compact header)
347
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
532 ; 1st: 200009h-200016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
533 ; 2nd: 201009h-201016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
534 ; 3rd: 202009h-202016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
535 ; 100: 264009h-264016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
536 ; 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
537 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
538 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
539 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
540 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
541
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 comm_send_compact_headers2:
347
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
543 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
544 movwf ext_flash_address+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
545 ; 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
546 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
547 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
548 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
549 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
550
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 0x30
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
552 cpfseq ext_flash_address+2 ; all 256 dive send?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
553 bra comm_send_compact_headers4 ; NO - continue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
554 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
555
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 comm_send_compact_headers4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
557 movlw .13
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
558 movwf lo ; counter
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
559 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
560 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
561 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
562 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
563 comm_send_compact_headers_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
564 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
565 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
566 comm_send_compact_headers3:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
567 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
568 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
569 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
570 call ext_flash_read_block_stop
347
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
571
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
572 ; Offset to total dive counter
356
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
573 movlw .80
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
574 movwf ext_flash_address+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
575 call ext_flash_read_block_start ; 1st byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
576 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
577 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
578 call ext_flash_read_block ; 2nd byte
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
579 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
580 call ext_flash_read_block_stop
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
581 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
582
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
583 ; Offset to Logbook-Profile version
391
682199d87b5c add profile version to compact headers
heinrichsweikamp
parents: 378
diff changeset
584 movlw .8
682199d87b5c add profile version to compact headers
heinrichsweikamp
parents: 378
diff changeset
585 movwf ext_flash_address+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
586 call ext_flash_byte_read ; get byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
587 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
588 rcall comm_write_byte ; wait for completion of transmit
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
589 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
590
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
591
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
592 ;-----------------------------------------------------------------------------
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
593
0
heinrichsweikamp
parents:
diff changeset
594 comm_send_headers:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
595 movlw "a" ; send echo
0
heinrichsweikamp
parents:
diff changeset
596 movwf TXREG1
heinrichsweikamp
parents:
diff changeset
597 ; Send 256 bytes/dive (Header)
heinrichsweikamp
parents:
diff changeset
598 ; 1st: 200000h-2000FFh
heinrichsweikamp
parents:
diff changeset
599 ; 2nd: 201000h-2010FFh
heinrichsweikamp
parents:
diff changeset
600 ; 3rd: 202000h-2020FFh
heinrichsweikamp
parents:
diff changeset
601 ; 100: 264000h-2640FFh
heinrichsweikamp
parents:
diff changeset
602 ; 256: 2FF000h-2FF0FFh
heinrichsweikamp
parents:
diff changeset
603 movlw 0x1F
heinrichsweikamp
parents:
diff changeset
604 movwf ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
605 movlw 0xF0
heinrichsweikamp
parents:
diff changeset
606 movwf ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
607 comm_send_headers2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
608 clrf ext_flash_address+0
0
heinrichsweikamp
parents:
diff changeset
609 ; Adjust address for next dive
heinrichsweikamp
parents:
diff changeset
610 movlw 0x10
heinrichsweikamp
parents:
diff changeset
611 addwf ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
612 movlw 0x00
heinrichsweikamp
parents:
diff changeset
613 addwfc ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
614 movlw 0x30
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
615 cpfseq ext_flash_address+2 ; all 256 dive send?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
616 bra comm_send_headers4 ; NO - continue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
617 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
618 comm_send_headers4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
619 clrf lo ; counter
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
620 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
621 call ext_flash_read_block_start ; 1st byte
heinrichsweikamp
parents:
diff changeset
622 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
623 bra comm_send_headers3 ; counter 24 bit
0
heinrichsweikamp
parents:
diff changeset
624 comm_send_headers_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
625 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
626 movwf TXREG1 ; start new transmit
0
heinrichsweikamp
parents:
diff changeset
627 comm_send_headers3:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
628 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
629 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
630 bra comm_send_headers_loop
heinrichsweikamp
parents:
diff changeset
631 call ext_flash_read_block_stop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
632 bra comm_send_headers2 ; continue
0
heinrichsweikamp
parents:
diff changeset
633
heinrichsweikamp
parents:
diff changeset
634 ;-----------------------------------------------------------------------------
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
635
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
636 comm_option_reset_all: ; reset all options to factory default
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
637 movlw "x" ; send echo
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
638 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
639 call option_reset_all
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
640 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
641
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
642 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
643
heinrichsweikamp
parents:
diff changeset
644 comm_set_time:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
645 movlw "b" ; send echo
0
heinrichsweikamp
parents:
diff changeset
646 movwf TXREG1
heinrichsweikamp
parents:
diff changeset
647
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
648 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
649 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
650 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
651 bra comm_download_mode0 ; NO - abort
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
652 movff RCREG1, rtc_latched_hour
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
653 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
654 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
655 bra comm_download_mode0 ; NO - abort
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
656 movff RCREG1, rtc_latched_mins
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
657 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
658 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
659 bra comm_download_mode0 ; NO - abort
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
660 movff RCREG1, rtc_latched_secs
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_month
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_day
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
669 rcall comm_get_byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
670 btfsc rs232_rx_timeout ; got byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
671 bra comm_download_mode0 ; NO - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
672 movff RCREG1, rtc_latched_year
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
673 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
674 bra comm_download_mode0 ; done, back to loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
675
heinrichsweikamp
parents:
diff changeset
676 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
677 ; Set custom text string (opt_name_length ASCII chars)
0
heinrichsweikamp
parents:
diff changeset
678 ;
heinrichsweikamp
parents:
diff changeset
679
heinrichsweikamp
parents:
diff changeset
680 comm_set_custom_text:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
681 movlw "c" ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
682 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
683 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
684 lfsr FSR2,opt_name
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
685 movlw opt_name_length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
686 movwf lo ; counter
0
heinrichsweikamp
parents:
diff changeset
687 comm_set_ctext_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
688 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
689 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
690 bra comm_set_ctext_loop_done ; NO - abort
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
691 movff RCREG1,POSTINC2 ; store character
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
692 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
693 bra comm_set_ctext_loop
136
9a637c9bb19a rename Deco Planner to Simulator
heinrichsweikamp
parents: 128
diff changeset
694 comm_set_ctext_loop_done:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
695 tstfsz lo ; got opt_name_length bytes?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
696 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
697 bra comm_download_mode0 ; done, loop with timeout reset
136
9a637c9bb19a rename Deco Planner to Simulator
heinrichsweikamp
parents: 128
diff changeset
698 comm_set_ctext_loop_done2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
699 clrf POSTINC2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
700 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
701 bra comm_set_ctext_loop_done2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
702 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
703
heinrichsweikamp
parents:
diff changeset
704 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
705 ; Reply Serial (2 bytes low:high), firmware (major.minor) and custom text
0
heinrichsweikamp
parents:
diff changeset
706 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
707
0
heinrichsweikamp
parents:
diff changeset
708 comm_identify:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
709 movlw "i" ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
710 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
711 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
712
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
713 ;---- Read serial from internal EEPROM address 0000
0
heinrichsweikamp
parents:
diff changeset
714 clrf EEADRH
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
715 clrf EEADR ; get serial number LOW
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
716 call read_eeprom ; read byte
0
heinrichsweikamp
parents:
diff changeset
717 movff EEDATA,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
718 incf EEADR,F ; get serial number HIGH
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
719 call read_eeprom ; read byte
0
heinrichsweikamp
parents:
diff changeset
720 movff EEDATA,hi
heinrichsweikamp
parents:
diff changeset
721
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
722 ;---- Emit serial number
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
723 movff lo,TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
724 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
725 movff hi,TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
726 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
727
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
728 ;---- Emit firmware hi.lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
729 movlw softwareversion_x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
730 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
731 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
732 movlw softwareversion_y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
733 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
734 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
735
heinrichsweikamp
parents:
diff changeset
736 ;---- Emit custom text
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
737 movlw opt_name_length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
738 movwf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
739 lfsr FSR2,opt_name
0
heinrichsweikamp
parents:
diff changeset
740
heinrichsweikamp
parents:
diff changeset
741 common_identify_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
742 movff POSTINC2,TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
743 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
744 decfsz hi,F
heinrichsweikamp
parents:
diff changeset
745 bra common_identify_loop
heinrichsweikamp
parents:
diff changeset
746
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
747 bra comm_download_mode0 ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
748
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
749 ;-----------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
750
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
751 comm_get_byte:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
752 goto rs232_get_byte ; ... and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
753
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
754 comm_write_byte: ; wait for completion of transmit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
755 goto rs232_wait_tx ; ... and return
0
heinrichsweikamp
parents:
diff changeset
756
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
757
235
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
758 ;-----------------------------------------------------------------------------
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
759 ; Reply hardware descriptor byte
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
760 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
761 comm_hardware_descriptor:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
762 movlw "j" ; prepare echo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
763 movwf TXREG1 ; send echo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
764 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
765
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
766 movf HW_descriptor,W ; get hardware descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
767 bcf WREG,6 ; clear bit 6 for reason of compatibility with 3rd party software
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
768 bcf WREG,7 ; clear bit 7 for reason of compatibility with 3rd party software
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
769 movwf TXREG1 ; send hardware descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
770
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
771 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
772
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
773 comm_feature_and_hardware:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
774 movlw 0x60 ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
775 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
776 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
777
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
778 movlw 0x00 ; hardware high byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
779 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
780 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
781
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
782 movf HW_descriptor,W ; get hardware descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
783 bcf WREG,6 ; clear bit 6 for reason of compatibility with 3rd party software
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
784 bcf WREG,7 ; clear bit 7 for reason of compatibility with 3rd party software
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
785 movwf TXREG1 ; send hardware descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
786 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
787
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
788 movlw 0x00 ; feature high Byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
789 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
790 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
791
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
792 movlw 0x00 ; feature low Byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
793 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
794 rcall comm_write_byte ; wait for completion of transmit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
795
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
796 movlw 0x00 ; model descriptor byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
797 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
798
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
799 bra comm_download_mode0 ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
800
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
801 ;-----------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
802
0
heinrichsweikamp
parents:
diff changeset
803 comm_send_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
804 movlw "f"; 0x66 ; send echo
0
heinrichsweikamp
parents:
diff changeset
805 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
806
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
807 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
808 btfsc rs232_rx_timeout ; got byte?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
809 bra comm_download_mode0 ; NO - abort!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
810 movff RCREG1,lo ; store dive number (0-255)
0
heinrichsweikamp
parents:
diff changeset
811 ; First, send the header (again)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
812 ; set ext_flash_address:3 to TOC entry of this dive
0
heinrichsweikamp
parents:
diff changeset
813 ; 1st: 200000h-200FFFh -> lo=0
heinrichsweikamp
parents:
diff changeset
814 ; 2nd: 201000h-201FFFh -> lo=1
heinrichsweikamp
parents:
diff changeset
815 ; 3rd: 202000h-202FFFh -> lo=2
heinrichsweikamp
parents:
diff changeset
816 ; 256: 2FF000h-2FFFFFh -> lo=255
heinrichsweikamp
parents:
diff changeset
817 clrf ext_flash_address+0
heinrichsweikamp
parents:
diff changeset
818 clrf ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
819 movlw 0x20
heinrichsweikamp
parents:
diff changeset
820 movwf ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
821 movlw .16
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
822 mulwf lo ; lo*16 = offset to 0x2000 (up:hi)
0
heinrichsweikamp
parents:
diff changeset
823 movf PRODL,W
heinrichsweikamp
parents:
diff changeset
824 addwf ext_flash_address+1,F
heinrichsweikamp
parents:
diff changeset
825 movf PRODH,W
heinrichsweikamp
parents:
diff changeset
826 addwfc ext_flash_address+2,F
heinrichsweikamp
parents:
diff changeset
827
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
828 incf_ext_flash_address d'2' ; skip 0xFA, 0xFA
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
829 call ext_flash_byte_read_plus ; read start address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
830 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
831 call ext_flash_byte_read_plus ; read start address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
832 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
833 call ext_flash_byte_read_plus ; read start address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
834 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
835 call ext_flash_byte_read_plus ; read end address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
836 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
837 call ext_flash_byte_read_plus ; read end address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
838 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
839 call ext_flash_byte_read_plus ; read end address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
840 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
841 decf_ext_flash_address d'8' ; back again to first 0xFA in header
0
heinrichsweikamp
parents:
diff changeset
842
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
843 movf ext_flash_log_pointer+0,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
844 cpfseq ext_flash_end_pointer+0 ; equal?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
845 bra comm_send_dive1 ; NO - send header
0
heinrichsweikamp
parents:
diff changeset
846
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
847 movf ext_flash_log_pointer+1,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
848 cpfseq ext_flash_end_pointer+1 ; equal?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
849 bra comm_send_dive1 ; NO - send header
0
heinrichsweikamp
parents:
diff changeset
850
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
851 movf ext_flash_log_pointer+2,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
852 cpfseq ext_flash_end_pointer+2 ; equal?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
853 bra comm_send_dive1 ; NO - send header
0
heinrichsweikamp
parents:
diff changeset
854
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
855 ; Start=End -> Not good, abort
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
856 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
857
heinrichsweikamp
parents:
diff changeset
858 comm_send_dive1:
heinrichsweikamp
parents:
diff changeset
859 ; Send header
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
860 clrf hi ; counter
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
861 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
862 call ext_flash_read_block_start ; 1st byte
0
heinrichsweikamp
parents:
diff changeset
863 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
864 bra comm_send_dive_header
0
heinrichsweikamp
parents:
diff changeset
865 comm_send_dive_header2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
866 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
867 movwf TXREG1 ; start new transmit
0
heinrichsweikamp
parents:
diff changeset
868 comm_send_dive_header:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
869 rcall comm_write_byte ; wait for completion of transmit
0
heinrichsweikamp
parents:
diff changeset
870 decfsz hi,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
871 bra comm_send_dive_header2
0
heinrichsweikamp
parents:
diff changeset
872 call ext_flash_read_block_stop
heinrichsweikamp
parents:
diff changeset
873
heinrichsweikamp
parents:
diff changeset
874 ; Set address for profile
heinrichsweikamp
parents:
diff changeset
875 movff ext_flash_log_pointer+0,ext_flash_address+0
heinrichsweikamp
parents:
diff changeset
876 movff ext_flash_log_pointer+1,ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
877 movff ext_flash_log_pointer+2,ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
878
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
879 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
880 call incf_ext_flash_address0_0x20 ; increases bytes in ext_flash_address:3 with 0x200000 bank switching
0
heinrichsweikamp
parents:
diff changeset
881
512
heinrichsweikamp
parents: 507
diff changeset
882 ; Set address for short header/compact header, Byte 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
883
0
heinrichsweikamp
parents:
diff changeset
884 comm_send_dive_profile:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
885 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
886 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
887 movff ext_flash_rw,TXREG1 ; send a byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
888
0
heinrichsweikamp
parents:
diff changeset
889 ; 24bit compare with end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
890 movff ext_flash_end_pointer+0,WREG
0
heinrichsweikamp
parents:
diff changeset
891 cpfseq ext_flash_address+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
892 bra comm_send_dive_profile
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
893 movff ext_flash_end_pointer+1,WREG
0
heinrichsweikamp
parents:
diff changeset
894 cpfseq ext_flash_address+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
895 bra comm_send_dive_profile
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
896 movff ext_flash_end_pointer+2,WREG
0
heinrichsweikamp
parents:
diff changeset
897 cpfseq ext_flash_address+2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
898 bra comm_send_dive_profile
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
899
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
900 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
901 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
902
heinrichsweikamp
parents:
diff changeset
903 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
904
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
905 comm_read_setting:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
906 movlw "r"
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
907 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
908 rcall comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
909 btfsc rs232_rx_timeout ; got byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
910 bra comm_read_abort ; NO - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
911 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
912 movlw 0x0F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
913 cpfsgt RCREG1 ; 0x00-0x0F: unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
914 bra comm_read_abort ; abort!
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
915 subwf RCREG1,W ; subtract unused commands
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
916
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
917 clrf up ; set gas/dil index to 0 (0 = gas 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
918 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
919 bra comm_read_gas_dil ; RCREG1=0x10
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
920 incf up ; increment gas/dil index (1 = gas 2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
921 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
922 bra comm_read_gas_dil ; RCREG1=0x11
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
923 incf up ; increment gas/dil index (2 = gas 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
924 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
925 bra comm_read_gas_dil ; RCREG1=0x12
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
926 incf up ; increment gas/dil index (3 = gas 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
927 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
928 bra comm_read_gas_dil ; RCREG1=0x13
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
929 incf up ; increment gas/dil index (4 = gas 5)
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=0x14
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
932 incf up ; increment gas/dil index (5 = dil 1)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
933 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
934 bra comm_read_gas_dil ; RCREG1=0x15
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
935 incf up ; increment gas/dil index (6 = dil 2)
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=0x16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
938 incf up ; increment gas/dil index (7 = dil 3)
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=0x17
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
941 incf up ; increment gas/dil index (8 = dil 4)
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=0x18
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
944 incf up ; increment gas/dil index (9 = dil 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
945 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
946 bra comm_read_gas_dil ; RCREG1=0x19
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
947
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
948 clrf up ; set setpoint index to 0 (0 = SP 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
949 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
950 bra comm_read_sp ; RCREG1=0x1A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
951 incf up ; increment setpoint index (1 = SP2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
952 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
953 bra comm_read_sp ; RCREG1=0x1B
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
954 incf up ; increment setpoint index (2 = SP3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
955 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
956 bra comm_read_sp ; RCREG1=0x1C
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
957 incf up ; increment setpoint index (3 = SP4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
958 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
959 bra comm_read_sp ; RCREG1=0x1D
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
960 incf up ; increment setpoint index (4 = SP5)
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=0x1E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
963
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 movff opt_ccr_mode, TXREG1 ; RCREG1=0x1F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
966 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
967 movff opt_dive_mode, TXREG1 ; RCREG1=0x20
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
968 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
969 movff char_I_deco_model, TXREG1 ; RCREG1=0x21
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
970 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
971 movff char_I_ppO2_max_work, TXREG1 ; RCREG1=0x22
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
972 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
973 movff char_I_ppO2_min, TXREG1 ; RCREG1=0x23
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
974 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
975 movff char_I_extra_time, TXREG1 ; RCREG1=0x24
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
976 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
977 movff opt_GF_low, TXREG1 ; RCREG1=0x25
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
978 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
979 movff opt_GF_high, TXREG1 ; RCREG1=0x26
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
980 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
981 movff opt_aGF_low, TXREG1 ; RCREG1=0x27
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
982 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
983 movff opt_aGF_high, TXREG1 ; RCREG1=0x28
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
984 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
985 movff opt_enable_aGF, TXREG1 ; RCREG1=0x29
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 opt_sat_multiplier_non_gf, TXREG1 ; RCREG1=0x2A
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_desat_multiplier_non_gf,TXREG1 ; RCREG1=0x2B
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_last_stop, TXREG1 ; RCREG1=0x2C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
992 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
993 movff opt_brightness, TXREG1 ; RCREG1=0x2D
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_units, TXREG1 ; RCREG1=0x2E
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_sampling_rate, TXREG1 ; RCREG1=0x2F
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_salinity, TXREG1 ; RCREG1=0x30
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_dive_color_scheme, TXREG1 ; RCREG1=0x31
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_language, TXREG1 ; RCREG1=0x32
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1004 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1005 movff opt_dateformat, TXREG1 ; RCREG1=0x33
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_compass_gain, TXREG1 ; RCREG1=0x34
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1008 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1009 movff opt_pressure_adjust, TXREG1 ; RCREG1=0x35
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_enable_safetystop, TXREG1 ; RCREG1=0x36
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_calibration_O2_ratio, TXREG1 ; RCREG1=0x37
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 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
1016 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1017 movff opt_flip_screen, TXREG1 ; RCREG1=0x39
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_cR_button_left, TXREG1 ; RCREG1=0x3A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1020 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1021 movff opt_cR_button_right, TXREG1 ; RCREG1=0x3B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1022 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1023 movff char_I_SAC_work, TXREG1 ; RCREG1=0x3C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1024 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1025 movff char_I_SAC_deco, TXREG1 ; RCREG1=0x3D
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 movff opt_modwarning, TXREG1 ; RCREG1=0x3E
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_vsitextv2, TXREG1 ; RCREG1=0x3F
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_vsigraph, TXREG1 ; RCREG1=0x40
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1032 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1033 movff opt_showppo2, TXREG1 ; RCREG1=0x41, always show ppO2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1034 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1035 movff opt_temperature_adjust, TXREG1 ; RCREG1=0x42
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1036 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1037 movff opt_safety_stop_length, TXREG1 ; RCREG1=0x43
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_safety_stop_start, TXREG1 ; RCREG1=0x44
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1040 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1041 movff opt_safety_stop_end, TXREG1 ; RCREG1=0x45
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_safety_stop_reset, TXREG1 ; RCREG1=0x46
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1044 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1045 clrf TXREG1 ; RCREG1=0x47, ignore conservatism in hwOS tech firmware
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_diveTimeout, TXREG1 ; RCREG1=0x48
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 button_polarity, TXREG1 ; RCREG1=0x49
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 char_I_PSCR_drop, TXREG1 ; RCREG1=0x4A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1052 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1053 movff char_I_PSCR_lungratio, TXREG1 ; RCREG1=0x4B
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 char_I_ppO2_max_deco, TXREG1 ; RCREG1=0x4C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1056 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1057 movff char_I_ppO2_min_loop, TXREG1 ; RCREG1=0x4D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1058 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1059 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
1060 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1061 movff char_I_gas_avail_size+1, TXREG1 ; RCREG1=0x4F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1062 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1063 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
1064 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1065 movff char_I_gas_avail_size+3, TXREG1 ; RCREG1=0x51
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1066 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1067 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
1068 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1069 movff char_I_gas_avail_pres+0, TXREG1 ; RCREG1=0x53
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_pres+1, TXREG1 ; RCREG1=0x54
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1072 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1073 movff char_I_gas_avail_pres+2, TXREG1 ; RCREG1=0x55
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_pres+3, TXREG1 ; RCREG1=0x56
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_pres+4, TXREG1 ; RCREG1=0x57
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_CC_max_frac_O2, TXREG1 ; RCREG1=0x58
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1080 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1081 movff opt_sim_setpoint_number, TXREG1 ; RCREG1=0x59
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1082 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1083 movff opt_calc_asc_gasvolume, TXREG1 ; RCREG1=0x5A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1084 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1085 movff opt_sim_use_aGF, TXREG1 ; RCREG1=0x5B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1086 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1087 movff char_I_altitude_wait, TXREG1 ; RCREG1=0x5C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1088 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1089 movff opt_enable_IBCD, TXREG1 ; RCREG1=0x5D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1090 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1091 movff opt_sat_multiplier_gf, TXREG1 ; RCREG1=0x5E
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_desat_multiplier_gf, TXREG1 ; RCREG1=0x5F
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_transmitter_id_1+0, TXREG1 ; RCREG1=0x60
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_transmitter_id_1+1, TXREG1 ; RCREG1=0x61
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 opt_transmitter_id_2+0, TXREG1 ; RCREG1=0x62
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1100 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1101 movff opt_transmitter_id_2+1, TXREG1 ; RCREG1=0x63
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_transmitter_id_3+0, TXREG1 ; RCREG1=0x64
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1104 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1105 movff opt_transmitter_id_3+1, TXREG1 ; RCREG1=0x65
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_4+0, TXREG1 ; RCREG1=0x66
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_4+1, TXREG1 ; RCREG1=0x67
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_5+0, TXREG1 ; RCREG1=0x68
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_5+1, TXREG1 ; RCREG1=0x69
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_6+0, TXREG1 ; RCREG1=0x6A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1116 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1117 movff opt_transmitter_id_6+1, TXREG1 ; RCREG1=0x6B
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_7+0, TXREG1 ; RCREG1=0x6C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1120 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1121 movff opt_transmitter_id_7+1, TXREG1 ; RCREG1=0x6D
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_8+0, TXREG1 ; RCREG1=0x6E
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_8+1, TXREG1 ; RCREG1=0x6F
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_9+0, TXREG1 ; RCREG1=0x70
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_9+1, TXREG1 ; RCREG1=0x71
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_10+0, TXREG1 ; RCREG1=0x72
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1132 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1133 movff opt_transmitter_id_10+1, TXREG1 ; RCREG1=0x73
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1134 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1135 movff char_I_gas_avail_size+5, TXREG1 ; RCREG1=0x74
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1136 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1137 movff char_I_gas_avail_size+6, TXREG1 ; RCREG1=0x75
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1138 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1139 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
1140 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1141 movff char_I_gas_avail_size+8, TXREG1 ; RCREG1=0x77
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1142 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1143 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
1144 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1145 movff char_I_gas_avail_pres+5, TXREG1 ; RCREG1=0x79
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_pres+6, TXREG1 ; RCREG1=0x7A
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1148 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1149 movff char_I_gas_avail_pres+7, TXREG1 ; RCREG1=0x7B
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_pres+8, TXREG1 ; RCREG1=0x7C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1152 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1153 movff char_I_gas_avail_pres+9, TXREG1 ; RCREG1=0x7D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1154 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1155 movff opt_TR_mode, TXREG1 ; RCREG1=0x7E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1156 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1157 movff opt_TR_1st_pres, TXREG1 ; RCREG1=0x7F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1158 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1159 movff opt_TR_2nd_pres, TXREG1 ; RCREG1=0x80
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1160 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1161 movff opt_TR_Bail_pres, TXREG1 ; RCREG1=0x81
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1162 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1163 movff char_I_max_pres_diff, TXREG1 ; RCREG1=0x82
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1164 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1165 movff opt_ZfactorUse, TXREG1 ; RCREG1=0x83
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_ZfactorTemp, TXREG1 ; RCREG1=0x84
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1168 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1169 movff opt_2ndDepthDisp, TXREG1 ; RCREG1=0x85
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1170 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1171 movff opt_max_depth, TXREG1 ; RCREG1=0x86
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1172 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1173 movff char_I_descent_speed, TXREG1 ; RCREG1=0x87
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1174 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1175 movff opt_store_apnoe_dive, TXREG1 ; RCREG1=0x88
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1176 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1177 movff opt_tissue_graphics, TXREG1 ; RCREG1=0x89
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1178 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1179 movff opt_layout, TXREG1 ; RCREG1=0x90
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1180 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1181 movff opt_extended_stops, TXREG1 ; RCREG1=0x91
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1182
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1183 comm_read_abort:
255
ad62dff7739a add bearing option to compass
heinrichsweikamp
parents: 252
diff changeset
1184 comm_read_done:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1185 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
1186
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1187 ;-----------------------------------------------------------------------------
157
5ee76921e359 make new parameters configurable through pc
heinrichsweikamp
parents: 150
diff changeset
1188
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1189 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1190 ; -------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1191 ; 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
1192 ; 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
1193 ; 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
1194 ; 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
1195 ; opt_gas_type res 5 ; OC/bailout gas type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1196 ; opt_dil_type res 5 ; dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1197 ; 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
1198 ; 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
1199
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1200 comm_read_gas_dil:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1201 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
1202 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
1203 movff PLUSW0, TXREG1 ; transmit O2 ratio
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1204 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
1205 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
1206 movff PLUSW0, TXREG1 ; transmit He ratio
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1207 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
1208 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
1209 movff PLUSW0, TXREG1 ; transmit gas/dil type
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1210 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
1211 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
1212 movff PLUSW0,TXREG1 ; transmit change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1213 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
1214
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1215
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1216 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1217 ; -------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1218 ; opt_setpoint_cbar res 5 ; setpoints in cbar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1219 ; 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
1220
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1221 comm_read_sp:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1222 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
1223 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
1224 movff PLUSW0, TXREG1 ; transmit setpoint cbar value
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 .5 ; increment index by 5, addressing change depth now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1227 movff PLUSW0, TXREG1 ; transmit change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1228 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
1229
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1230 ;-----------------------------------------------------------------------------
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1231
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1232 comm_write_setting:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1233 movlw "w"
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1234 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1235 rcall comm_get_byte ; "Byte 2"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1236 btfsc rs232_rx_timeout ; got a byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1237 bra comm_write_abort ; NO - abort
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1238 movff RCREG1,lo ; copy
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1239 rcall comm_get_byte ; "Byte 3"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1240 rcall comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1241 movlw 0x0F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1242 cpfsgt lo ; 0x00-0x0F: unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1243 bra comm_write_abort ; abort!
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1244 subwf lo,W ; subtract unused commands
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1245
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1246 clrf up ; set gas/dil index to 0 (0 = gas 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1247 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1248 bra comm_write_gas_dil ; RCREG1=0x10
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1249 incf up ; increment gas/dil index (1 = gas 2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1250 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1251 bra comm_write_gas_dil ; RCREG1=0x11
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1252 incf up ; increment gas/dil index (2 = gas 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1253 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1254 bra comm_write_gas_dil ; RCREG1=0x12
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1255 incf up ; increment gas/dil index (3 = gas 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1256 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1257 bra comm_write_gas_dil ; RCREG1=0x13
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1258 incf up ; increment gas/dil index (4 = gas 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1259 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1260 bra comm_write_gas_dil ; RCREG1=0x14
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1261 incf up ; increment gas/dil index (5 = dil 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1262 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1263 bra comm_write_gas_dil ; RCREG1=0x15
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1264 incf up ; increment gas/dil index (6 = dil 2)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1265 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1266 bra comm_write_gas_dil ; RCREG1=0x16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1267 incf up ; increment gas/dil index (7 = dil 3)
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=0x17
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1270 incf up ; increment gas/dil index (8 = dil 4)
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=0x18
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1273 incf up ; increment gas/dil index (9 = dil 5)
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=0x19
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1276
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1277 clrf up ; set setpoint index to 0 (0 = SP 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1278 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1279 bra comm_write_sp ; RCREG1=0x1A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1280 incf up ; increment setpoint index (1 = SP2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1281 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1282 bra comm_write_sp ; RCREG1=0x1B
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1283 incf up ; increment setpoint index (2 = SP3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1284 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1285 bra comm_write_sp ; RCREG1=0x1C
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1286 incf up ; increment setpoint index (3 = SP4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1287 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1288 bra comm_write_sp ; RCREG1=0x1D
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1289 incf up ; increment setpoint index (4 = SP5)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1290 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1291 bra comm_write_sp ; RCREG1=0x1E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1292
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1293 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1294 movff RCREG1, opt_ccr_mode ; RCREG1=0x1F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1295 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1296 movff RCREG1, opt_dive_mode ; RCREG1=0x20
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1297 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1298 movff RCREG1, char_I_deco_model ; RCREG1=0x21
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1299 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1300 movff RCREG1, char_I_ppO2_max_work ; RCREG1=0x22
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1301 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1302 movff RCREG1, char_I_ppO2_min ; RCREG1=0x23
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1303 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1304 movff RCREG1, char_I_extra_time ; RCREG1=0x24
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1305 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1306 movff RCREG1, opt_GF_low ; RCREG1=0x25
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1307 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1308 movff RCREG1, opt_GF_high ; RCREG1=0x26
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1309 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1310 movff RCREG1, opt_aGF_low ; RCREG1=0x27
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_aGF_high ; RCREG1=0x28
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_enable_aGF ; RCREG1=0x29
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, opt_sat_multiplier_non_gf ; RCREG1=0x2A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1317 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1318 movff RCREG1, opt_desat_multiplier_non_gf ; RCREG1=0x2B
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, opt_last_stop ; RCREG1=0x2C
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, opt_brightness ; RCREG1=0x2D
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_units ; RCREG1=0x2E
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_sampling_rate ; RCREG1=0x2F
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_salinity ; RCREG1=0x30
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_dive_color_scheme ; RCREG1=0x31
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_language ; RCREG1=0x32
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_dateformat ; RCREG1=0x33
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_compass_gain ; RCREG1=0x34
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_pressure_adjust ; RCREG1=0x35
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_enable_safetystop ; RCREG1=0x36
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_calibration_O2_ratio; RCREG1=0x37
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1343 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1344 nop ; RCREG1=0x38 NOT USED ANYMORE (ex opt_sensor_fallback)
582
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_flip_screen ; RCREG1=0x39
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_cR_button_left ; RCREG1=0x3A
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_cR_button_right ; RCREG1=0x3B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1351 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1352 movff RCREG1, char_I_SAC_work ; RCREG1=0x3C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1353 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1354 movff RCREG1, char_I_SAC_deco ; RCREG1=0x3D
582
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_modwarning ; RCREG1=0x3E
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_vsitextv2 ; RCREG1=0x3F
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_vsigraph ; RCREG1=0x40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1361 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1362 movff RCREG1, opt_showppo2 ; RCREG1=0x41, always show ppO2
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_temperature_adjust ; RCREG1=0x42
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_safety_stop_length ; RCREG1=0x43
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_safety_stop_start ; RCREG1=0x44
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1369 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1370 movff RCREG1, opt_safety_stop_end ; RCREG1=0x45
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1371 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1372 movff RCREG1, opt_safety_stop_reset ; RCREG1=0x46
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 nop ; RCREG1=0x47, ignore conservatism for standard hwOS
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_diveTimeout ; RCREG1=0x48
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 bra comm_write_button_polarity ; RCREG1=0x49
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1379 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1380 movff RCREG1, char_I_PSCR_drop ; RCREG1=0x4A
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, char_I_PSCR_lungratio ; RCREG1=0x4B
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, char_I_ppO2_max_deco ; RCREG1=0x4C
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, char_I_ppO2_min_loop ; RCREG1=0x4D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1387 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1388 movff RCREG1, char_I_gas_avail_size+0 ; RCREG1=0x4E
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1389 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1390 movff RCREG1, char_I_gas_avail_size+1 ; RCREG1=0x4F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1391 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1392 movff RCREG1, char_I_gas_avail_size+2 ; RCREG1=0x50
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1393 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1394 movff RCREG1, char_I_gas_avail_size+3 ; RCREG1=0x51
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1395 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1396 movff RCREG1, char_I_gas_avail_size+4 ; RCREG1=0x52
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1397 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1398 movff RCREG1, char_I_gas_avail_pres+0 ; RCREG1=0x53
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1399 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1400 movff RCREG1, char_I_gas_avail_pres+1 ; RCREG1=0x54
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1401 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1402 movff RCREG1, char_I_gas_avail_pres+2 ; RCREG1=0x55
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1403 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1404 movff RCREG1, char_I_gas_avail_pres+3 ; RCREG1=0x56
582
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_pres+4 ; RCREG1=0x57
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_CC_max_frac_O2 ; RCREG1=0x58
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1409 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1410 movff RCREG1, opt_sim_setpoint_number ; RCREG1=0x59
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1411 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1412 movff RCREG1, opt_calc_asc_gasvolume ; RCREG1=0x5A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1413 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1414 movff RCREG1, opt_sim_use_aGF ; RCREG1=0x5B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1415 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1416 movff RCREG1, char_I_altitude_wait ; RCREG1=0x5C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1417 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1418 movff RCREG1, opt_enable_IBCD ; RCREG1=0x5D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1419 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1420 movff RCREG1, opt_sat_multiplier_gf ; RCREG1=0x5E
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1421 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1422 movff RCREG1, opt_desat_multiplier_gf ; RCREG1=0x5F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1423 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1424 movff RCREG1, opt_transmitter_id_1+0 ; RCREG1=0x60
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1425 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1426 movff RCREG1, opt_transmitter_id_1+1 ; RCREG1=0x61
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1427 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1428 movff RCREG1, opt_transmitter_id_2+0 ; RCREG1=0x62
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1429 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1430 movff RCREG1, opt_transmitter_id_2+1 ; RCREG1=0x63
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1431 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1432 movff RCREG1, opt_transmitter_id_3+0 ; RCREG1=0x64
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1433 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1434 movff RCREG1, opt_transmitter_id_3+1 ; RCREG1=0x65
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1435 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1436 movff RCREG1, opt_transmitter_id_4+0 ; RCREG1=0x66
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1437 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1438 movff RCREG1, opt_transmitter_id_4+1 ; RCREG1=0x67
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1439 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1440 movff RCREG1, opt_transmitter_id_5+0 ; RCREG1=0x68
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_5+1 ; RCREG1=0x69
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_6+0 ; RCREG1=0x6A
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_6+1 ; RCREG1=0x6B
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_7+0 ; RCREG1=0x6C
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_7+1 ; RCREG1=0x6D
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_8+0 ; RCREG1=0x6E
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_8+1 ; RCREG1=0x6F
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_9+0 ; RCREG1=0x70
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_9+1 ; RCREG1=0x71
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_10+0 ; RCREG1=0x72
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_10+1 ; RCREG1=0x73
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1463 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1464 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
1465 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1466 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
1467 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1468 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
1469 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1470 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
1471 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1472 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
1473 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1474 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
1475 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1476 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
1477 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1478 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
1479 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1480 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
1481 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1482 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
1483 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1484 movff RCREG1, opt_TR_mode ; RCREG1=0x7E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1485 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1486 movff RCREG1, opt_TR_1st_pres ; RCREG1=0x7F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1487 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1488 movff RCREG1, opt_TR_2nd_pres ; RCREG1=0x80
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1489 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1490 movff RCREG1, opt_TR_Bail_pres ; RCREG1=0x81
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1491 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1492 movff RCREG1, char_I_max_pres_diff ; RCREG1=0x82
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1493 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1494 movff RCREG1, opt_ZfactorUse ; RCREG1=0x83
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1495 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1496 movff RCREG1, opt_ZfactorTemp ; RCREG1=0x84
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1497 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1498 movff RCREG1, opt_2ndDepthDisp ; RCREG1=0x85
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1499 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1500 movff RCREG1, opt_max_depth ; RCREG1=0x86
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1501 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1502 movff RCREG1, char_I_descent_speed ; RCREG1=0x87
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1503 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1504 movff RCREG1, opt_store_apnoe_dive ; RCREG1=0x88
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1505 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1506 movff RCREG1, opt_tissue_graphics ; RCREG1=0x89
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1507 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1508 movff RCREG1, opt_layout ; RCREG1=0x90
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1509 dcfsnz WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1510 movff RCREG1, opt_extended_stops ; RCREG1=0x91
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1511
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
1512
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1513 comm_write_abort:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1514 comm_write_done:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1515 ; check options, gases and diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1516 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
1517 goto comm_download_mode0 ; done, loop with timeout reset
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1518
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1519 ;-----------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1520
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1521 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1522 ; -------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1523 ; 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
1524 ; 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
1525 ; 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
1526 ; 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
1527 ; opt_gas_type res 5 ; OC/bailout gas type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1528 ; opt_dil_type res 5 ; dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1529 ; 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
1530 ; opt_dil_change res 5 ; change depths for diluents
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1531
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1532 comm_write_gas_dil:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1533 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
1534 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
1535 movff RCREG1,PLUSW0 ; receive O2 ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1536 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1537 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
1538 movff RCREG1,PLUSW0 ; receive He ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1539 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1540 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
1541 movff RCREG1,PLUSW0 ; receive gas/dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1542 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1543 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
1544 movff RCREG1,PLUSW0 ; receive change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1545 bra comm_write_done ; done, loop with timeout reset
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1546
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1547
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1548 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1549 ; -------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1550 ; opt_setpoint_cbar res 5 ; setpoints in cbar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1551 ; 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
1552
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1553 comm_write_sp:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1554 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
1555 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
1556 movff RCREG1,PLUSW0 ; receive setpoint cbar value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1557 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1558 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
1559 movff RCREG1,PLUSW0 ; receive change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1560 bra comm_write_done ; done, loop with timeout reset
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1561
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1562 ;-----------------------------------------------------------------------------
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1563
0
heinrichsweikamp
parents:
diff changeset
1564 comm_send_string:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1565 movlw "n" ; send echo
0
heinrichsweikamp
parents:
diff changeset
1566 movwf TXREG1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1567 call comm_write_byte ; wait for completion of transmit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1568 WIN_SMALL comm_string_column, comm_string_row
0
heinrichsweikamp
parents:
diff changeset
1569 movlw .16
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1570 movwf lo ; counter
0
heinrichsweikamp
parents:
diff changeset
1571 comm_send_string_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1572 call comm_get_byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1573 btfsc rs232_rx_timeout ; got a byte?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
1574 bra comm_send_string_abort ; NO - abort
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1575 movff RCREG1,POSTINC2 ; store character
0
heinrichsweikamp
parents:
diff changeset
1576 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
1577 bra comm_send_string_loop
heinrichsweikamp
parents:
diff changeset
1578 comm_send_string_abort:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1579 STRCAT_PRINT "" ; show the text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1580 goto comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
1581
heinrichsweikamp
parents:
diff changeset
1582 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
1583
475
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1584 comm_write_button_polarity:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1585 ; store RCREG1 into EEPROM .897
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1586 movlw LOW .897
475
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1587 movwf EEADR
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1588 movlw HIGH .897
475
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1589 movwf EEADRH
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1590 movff RCREG1,EEDATA
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1591 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
1592 call write_eeprom ; EEDATA into EEPROM@EEADR
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1593 clrf EEADRH ; reset EEADRH
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1594 goto comm_download_mode0 ; done, loop with timeout reset
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1595
0
heinrichsweikamp
parents:
diff changeset
1596 ;----------------------------------------------------------------------------
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1597 END