Mercurial > public > hwos_code
annotate src/comm.asm @ 80:db920ca01491
new commands in download mode:
"w" - write setting
"x" - Reset all settings
author | mh@mh-THINK.localdomain |
---|---|
date | Thu, 27 Feb 2014 14:38:08 +0100 |
parents | 0fc8113ddf6d |
children | 8e13866b5496 |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
3 ; File comm.asm | |
4 ; | |
5 ; RS232 via USB | |
6 ; | |
7 ; Copyright (c) 2012, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2011-08-22 : [mH] Creation | |
11 ; 2012-02-11 : [jDG] Added "c" set custom text, and "i" identify. | |
12 | |
13 #include "ostc3.inc" | |
14 #include "eeprom_rs232.inc" | |
15 #include "tft.inc" | |
16 #include "wait.inc" | |
17 #include "strings.inc" | |
18 #include "convert.inc" | |
19 #include "external_flash.inc" | |
20 #include "tft_outputs.inc" | |
21 #include "surfmode.inc" | |
22 #include "rtc.inc" | |
23 #include "adc_lightsensor.inc" | |
24 | |
66
00636132cca6
BUGFIX: Maintain last selected customview in surface mode
heinrichsweikamp
parents:
50
diff
changeset
|
25 extern testloop,new_battery_menu,restart,option_reset_all |
79
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
26 extern char_I_deco_gas_change, char_I_dil_change, char_I_setpoint_cbar, char_I_setpoint_change |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
27 extern char_I_deco_model, char_I_extra_time, char_I_saturation_multiplier, char_I_desaturation_multiplier |
0 | 28 |
29 #DEFINE timeout_comm_pre_mode .120 ; Pre-loop | |
30 #DEFINE timeout_comm_mode .120 ; Download mode | |
31 #DEFINE timeout_service_mode .120 ; Service mode | |
32 | |
33 #DEFINE comm_title_row .0 | |
34 #DEFINE comm_title_column .50 | |
35 | |
36 #DEFINE comm_string_row .30 | |
37 #DEFINE comm_string_column .40 | |
38 | |
39 | |
40 #DEFINE comm_status1_row .70 | |
41 #DEFINE comm_status1_column .10 | |
42 #DEFINE comm_status2_row .100 | |
43 #DEFINE comm_status2_column comm_status1_column | |
44 #DEFINE comm_status3_row .130 | |
45 #DEFINE comm_status3_column comm_status1_column | |
46 | |
47 #DEFINE comm_warning_row .160 | |
48 #DEFINE comm_warning_column .65 | |
49 | |
50 comm code | |
51 | |
52 ; test for comm | |
53 global comm_mode | |
54 comm_mode: | |
55 call TFT_ClearScreen | |
56 WIN_COLOR color_greenish | |
57 WIN_SMALL comm_title_column, comm_title_row | |
58 STRCPY_TEXT_PRINT tUsbTitle ; comm Mode | |
59 call TFT_standard_color | |
60 WIN_TOP .10 | |
61 WIN_LEFT .1 | |
62 movlw 0xDE | |
63 movwf TBLPTRL | |
64 movlw 0xEE | |
65 movwf TBLPTRH | |
66 movlw 0x01 | |
67 movwf TBLPTRU | |
68 call color_image ; Show usb logo | |
69 WIN_SMALL comm_status1_column, comm_status1_row | |
70 STRCPY_TEXT_PRINT tUsbStarting ; Starting... | |
71 call TFT_serial ; Show serial and firmware version | |
72 bcf enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump) | |
73 bcf switch_right | |
74 bcf comm_service_enabled | |
75 bsf menubit | |
76 bcf battery_removed_in_usb ; =1: The battery has been removed in USB | |
77 movlw timeout_comm_pre_mode | |
78 movwf timeout_counter | |
79 WIN_SMALL comm_status1_column+.80, comm_status1_row | |
80 STRCPY_TEXT_PRINT tUsbStartDone ; Done... | |
81 call enable_rs232 ; Also sets to speed_normal ... | |
82 comm_mode1: | |
83 bcf onesecupdate | |
84 bcf LEDr | |
85 dcfsnz timeout_counter,F | |
86 bra comm_service_exit ; Timeout -> Exit | |
87 comm_mode2: | |
88 call get_battery_voltage ; gets battery voltage | |
89 movlw .3 | |
90 cpfslt batt_voltage+1 ; Batt Voltage less then 3*256mV? | |
91 bra comm_mode3 ; No | |
92 ; Set flag | |
93 bsf battery_removed_in_usb ; =1: The battery has been removed in USB | |
94 bra comm_mode4 | |
95 | |
96 comm_mode3: | |
97 ; Voltage ok. Do we have a new battery now? | |
98 btfsc battery_removed_in_usb ; =1: The battery has been removed in USB | |
99 goto new_battery_menu ; show "New battery dialog" | |
100 | |
101 comm_mode4: | |
102 call rs232_get_byte | |
103 | |
104 btfss vusb_in ; USB plugged in? | |
69 | 105 bra comm_service_exit_nousb_delay ; Disconnected -> Exit |
106 comm_mode4a: | |
0 | 107 |
108 btfsc switch_right ; Abort with right | |
109 bra comm_service_exit | |
110 | |
111 btfsc onesecupdate | |
112 bra comm_mode1 | |
113 | |
114 movlw 0xAA ; start byte=0xAA? | |
115 cpfseq RCREG1 | |
116 bra comm_mode2a | |
117 bra comm_mode2b ; Startbyte for service mode found | |
118 comm_mode2a: | |
119 movlw 0xBB ; start byte=0xBB? | |
120 cpfseq RCREG1 | |
121 bra comm_mode2 ; Cycle | |
122 bra comm_download_mode ; Startbyte for download mode found | |
123 | |
124 comm_mode2b: | |
125 ; Startbyte found | |
126 call rs232_wait_tx ; Wait for UART | |
127 movlw 0x4B | |
128 movwf TXREG1 ; Send Answer | |
129 ; Now, check comm command | |
130 | |
131 call rs232_get_byte ; first byte | |
132 call rs232_wait_tx ; Wait for UART | |
133 movff RCREG1,TXREG1 ; Echo | |
134 movlw UPPER comm_service_key | |
135 cpfseq RCREG1 | |
136 bra comm_mode1 ; Wrong -> Restart | |
137 call rs232_get_byte ; second byte | |
138 call rs232_wait_tx ; Wait for UART | |
139 movff RCREG1,TXREG1 ; Echo | |
140 movlw HIGH (comm_service_key & 0xFFFF) | |
141 cpfseq RCREG1 | |
142 bra comm_mode1 ; Wrong -> Restart | |
143 call rs232_get_byte ; third byte | |
144 call rs232_wait_tx ; Wait for UART | |
145 movff RCREG1,TXREG1 ; Echo | |
146 movlw LOW comm_service_key | |
147 cpfseq RCREG1 | |
148 bra comm_mode1 ; Wrong -> Restart | |
149 | |
150 ; Enable comm service mode | |
151 WIN_SMALL comm_status2_column, comm_status2_row | |
152 STRCPY_TEXT_PRINT tUsbServiceMode ; Service mode enabled | |
153 bsf comm_service_enabled | |
154 bra comm_download_mode0 ; Startbyte for download mode found | |
155 | |
69 | 156 |
157 comm_service_exit_nousb_delay: | |
158 WAITMS d'200' | |
159 btfss vusb_in ; USB plugged in? | |
160 bra comm_service_exit_nousb ; Disconnected -> Exit | |
161 bra comm_mode4a ; (Still) connected, return | |
162 | |
0 | 163 comm_service_exit_nousb: ; Disconnected -> Exit |
164 WIN_SMALL comm_status3_column, comm_status3_row | |
165 STRCPY_TEXT_PRINT tUsbClosed ; Port closed | |
166 bra comm_service_exit_common | |
167 | |
168 comm_service_exit: | |
169 WIN_SMALL comm_status3_column, comm_status3_row | |
170 STRCPY_TEXT_PRINT tUsbExit ; Exited | |
171 | |
172 comm_service_exit_common: | |
173 call rs232_wait_tx ; Wait for UART | |
174 movlw 0xFF ; Reply FF | |
175 movwf TXREG1 ; Send Answer | |
176 | |
177 ; Wait 1 second | |
178 bcf onesecupdate | |
179 btfss onesecupdate | |
180 bra $-2 | |
181 ; Wait 1 second | |
182 bcf onesecupdate | |
183 btfss onesecupdate | |
184 bra $-2 | |
185 | |
186 call disable_rs232 | |
187 bcf LEDr | |
188 goto restart | |
189 | |
190 ;----------------------------------------------------------------------------- | |
191 | |
192 comm_service_ll_bootloader: | |
193 bsf LEDr | |
194 WIN_SMALL comm_status3_column, comm_status3_row | |
195 STRCPY_TEXT_PRINT tUsbLlBld ; Low Level Bootloader started | |
196 WIN_TOP comm_warning_row | |
197 WIN_LEFT comm_warning_column | |
198 TFT_WRITE_PROM_IMAGE dive_warning_block ; Show Warning icon | |
199 goto 0x1FF0C | |
200 | |
201 ;----------------------------------------------------------------------------- | |
202 ; Sends external flash from 0x3E0000 to 0x3FD000 (118784bytes) via comm | |
203 ; | |
204 comm_send_firmware: | |
205 movlw 0x50 ; send echo | |
206 movwf TXREG1 | |
207 call rs232_wait_tx ; Wait for UART | |
208 | |
209 ; Read 5 bytes into buffer. | |
210 lfsr FSR2,buffer | |
211 movlw .5 ; counter | |
212 movwf lo | |
213 movlw 0x55 ; 5'ft byte checksum. | |
214 movwf hi | |
215 | |
216 comm_send_firmware_loop: | |
217 call rs232_get_byte | |
218 btfsc rs232_recieve_overflow ; Got byte? | |
219 bra comm_send_firmware_abort ; No, abort! | |
220 movf RCREG1,W | |
221 movwf POSTINC2 ; Store checksum byte. | |
222 xorwf hi,F ; Also xor into checksum | |
223 rlncf hi,F ; And rotate it. | |
224 decfsz lo,F | |
225 bra comm_send_firmware_loop | |
226 | |
227 ; Check that 5ft byte checksum's checksum | |
228 movf hi,W | |
229 bnz comm_send_firmware_failed | |
230 | |
231 movlw 0x4C ; send OK | |
232 movwf TXREG1 | |
233 call rs232_wait_tx ; Wait for UART | |
234 | |
235 ; Passed: goto second stage verification. | |
236 ; NOTE: Bootloader is Bank0. With buffer at address 0x200. | |
237 goto 0x1FDF0 ; And pray... | |
238 | |
239 comm_send_firmware_failed: | |
240 WIN_SMALL comm_string_column, comm_string_row | |
50 | 241 call TFT_warnings_color |
0 | 242 STRCPY_PRINT "Checksum failed" |
243 | |
244 comm_send_firmware_abort: | |
245 | |
246 movlw 0xFF ; send ABORTED byte. | |
247 movwf TXREG1 | |
248 call rs232_wait_tx ; Wait for UART | |
249 bra comm_download_mode0 ; Done. | |
250 | |
251 ;----------------------------------------------------------------------------- | |
252 ; Reset to Dive 1 in logbook | |
253 | |
254 comm_reset_logbook_pointers: | |
255 clrf EEADRH ; Make sure to select eeprom bank 0 | |
256 clrf EEDATA | |
257 write_int_eeprom .4 | |
258 write_int_eeprom .5 | |
259 write_int_eeprom .6 | |
260 write_int_eeprom .2 ; Also, delete total dive counter | |
79
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
261 write_int_eeprom .3 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
262 write_int_eeprom .15 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
263 write_int_eeprom .16 ; And the backup counter, too |
0 | 264 call ext_flash_erase_logbook ; And complete logbook (!) |
265 bra comm_download_mode0 ; Done. | |
266 | |
267 ;----------------------------------------------------------------------------- | |
268 comm_reset_battery_gauge: ; Resets battery gauge registers | |
269 call reset_battery_pointer ; Resets battery pointer 0x07-0x0C and battery_gauge:5 | |
270 bra comm_download_mode0 ; Done. | |
271 | |
272 ;----------------------------------------------------------------------------- | |
273 ; erases range in 4kB steps | |
274 | |
275 comm_erase_range4kb: | |
276 movlw 0x42 ; send echo | |
277 movwf TXREG1 | |
278 call rs232_wait_tx ; Wait for UART | |
279 | |
280 bcf INTCON,GIE ; All interrups off! | |
281 | |
282 rcall comm_get_flash_address ; Get three bytes address or return | |
283 btfsc rs232_recieve_overflow ; Got Data? | |
284 bra comm_download_mode0 ; No, Done. | |
285 | |
286 call rs232_get_byte | |
287 btfsc rs232_recieve_overflow ; Got byte? | |
288 bra comm_download_mode0 ; No, Done. | |
289 movff RCREG1,lo | |
290 ; Got 4bytes: 3bytes address and 1 bytes (lo) amount of 4kB blocks | |
291 | |
292 comm_erase_range4kb1: | |
293 call ext_flash_erase4kB ; Erase block! | |
294 | |
295 movlw 0x10 | |
296 addwf ext_flash_address+1,F | |
297 movlw .0 | |
298 addwfc ext_flash_address+2,F ; Increase address by .4096, or 0x1000 | |
299 decfsz lo,F | |
300 bra comm_erase_range4kb1 ; Loop until lo=zero | |
301 | |
302 bra comm_download_mode0 ; Done (Sends the 4C OK too). | |
303 | |
304 ;----------------------------------------------------------------------------- | |
305 | |
306 comm_erase_4kb: ; Get 3 bytes start address | |
307 bcf INTCON,GIE ; All interrups off! | |
308 | |
309 rcall comm_get_flash_address ; Get three bytes address or return | |
310 btfsc rs232_recieve_overflow ; Got Data? | |
311 bra comm_download_mode0 ; No, Done. | |
312 | |
313 call ext_flash_erase4kB ; Erase one block | |
314 bra comm_download_mode0 ; Done. | |
315 | |
316 ;----------------------------------------------------------------------------- | |
317 | |
318 comm_write_range: ; Get 3 bytes start address | |
319 movlw 0x30 ; send echo | |
320 movwf TXREG1 | |
321 call rs232_wait_tx ; Wait for UART | |
322 | |
323 bcf INTCON,GIE ; All interrups off! | |
324 | |
325 rcall comm_get_flash_address ; Get three bytes address or return | |
326 btfsc rs232_recieve_overflow ; Got Data? | |
327 bra comm_download_mode0 ; No, Done. | |
328 | |
329 comm_write_range_loop: | |
330 call rs232_get_byte | |
331 btfsc rs232_recieve_overflow ; Got byte? | |
332 bra comm_download_mode0 ; No, Done (and send OK byte too). | |
333 movf RCREG1,W | |
334 call ext_flash_byte_write ; write one byte | |
335 call incf_ext_flash_address_p1 ; increase address+1 | |
336 bra comm_write_range_loop | |
337 | |
338 ;----------------------------------------------------------------------------- | |
339 | |
340 comm_send_range: ; Get 3 bytes start address and 3 bytes amount | |
341 movlw 0x20 ; send echo | |
342 movwf TXREG1 | |
343 call rs232_wait_tx ; Wait for UART | |
344 | |
345 bcf INTCON,GIE ; All interrups off! | |
346 | |
347 rcall comm_get_flash_address ; Get three bytes address or return | |
348 btfsc rs232_recieve_overflow ; Got Data? | |
349 bra comm_download_mode0 ; No, Done. | |
350 | |
351 call rs232_get_byte | |
352 btfsc rs232_recieve_overflow ; Got byte? | |
353 bra comm_download_mode0 ; No, Done. | |
354 movff RCREG1,up | |
355 call rs232_get_byte | |
356 btfsc rs232_recieve_overflow ; Got byte? | |
357 bra comm_download_mode0 ; No, Done. | |
358 movff RCREG1,hi | |
359 call rs232_get_byte | |
360 btfsc rs232_recieve_overflow ; Got byte? | |
361 bra comm_download_mode0 ; No, Done. | |
362 movff RCREG1,lo | |
363 | |
364 ; If lo==0, we must precondition hi because there is to many bytes send ! | |
365 movf lo,W | |
366 bnz $+4 | |
367 decf hi,F | |
368 | |
369 ; 6bytes received, send data | |
370 comm_send_range2: ; needs ext_flash_address:3 start address and up:hi:lo amount | |
371 call ext_flash_read_block_start | |
372 movwf TXREG1 | |
373 | |
374 bra comm_send_range24 ; counter 24bit | |
375 comm_send_range24_loop: | |
376 call ext_flash_read_block ; Read one byte | |
377 movwf TXREG1 ; Start new transmit | |
378 comm_send_range24: | |
379 call rs232_wait_tx ; Wait for UART | |
380 decfsz lo,F | |
381 bra comm_send_range24_loop | |
382 decf hi,F | |
383 movlw 0xFF | |
384 cpfseq hi | |
385 bra comm_send_range24_loop | |
386 decf up,F | |
387 movlw 0xFF | |
388 cpfseq up | |
389 bra comm_send_range24_loop | |
390 call ext_flash_read_block_stop | |
391 | |
392 bra comm_download_mode0 ; Done. | |
393 | |
394 ;----------------------------------------------------------------------------- | |
395 | |
396 comm_get_flash_address: | |
397 call rs232_get_byte | |
398 btfsc rs232_recieve_overflow ; Got byte? | |
399 return ; No, return | |
400 movff RCREG1,ext_flash_address+2 | |
401 call rs232_get_byte | |
402 btfsc rs232_recieve_overflow ; Got byte? | |
403 return ; No, return | |
404 movff RCREG1,ext_flash_address+1 | |
405 call rs232_get_byte | |
406 btfsc rs232_recieve_overflow ; Got byte? | |
407 return ; No, return | |
408 movff RCREG1,ext_flash_address+0 | |
409 return | |
410 | |
411 ;----------------------------------------------------------------------------- | |
412 | |
413 comm_download_mode: | |
414 ; Enable comm download mode | |
415 WIN_SMALL comm_status2_column, comm_status2_row | |
416 STRCPY_TEXT_PRINT tUsbDownloadMode; Download mode enabled | |
417 bsf INTCON,GIE ; All interrups on | |
418 call rs232_wait_tx ; Wait for UART | |
419 movlw 0xBB ; Command Echo | |
420 movwf TXREG1 ; Send Answer | |
421 comm_download_mode0: | |
422 bsf INTCON,GIE ; All interrups on | |
423 call rs232_wait_tx ; Wait for UART | |
424 movlw 0x4C ; 4C in service mode | |
425 btfss comm_service_enabled | |
426 movlw 0x4D ; 4D in download mode | |
427 movwf TXREG1 ; Send Answer | |
428 movlw timeout_service_mode | |
429 movwf timeout_counter ; Timeout | |
430 bcf switch_right | |
431 comm_download_mode1: | |
432 bcf onesecupdate | |
433 dcfsnz timeout_counter,F | |
434 bra comm_service_exit ; Timeout -> Exit | |
435 comm_download_mode2: | |
436 call rs232_get_byte ; Check for a byte | |
437 btfsc comm_service_enabled | |
438 btg LEDr ; Blink in Service mode | |
439 btfss vusb_in ; USB plugged in? | |
440 bra comm_service_exit_nousb ; Disconnected -> Exit | |
441 btfsc switch_right ; Abort with right | |
442 bra comm_service_exit | |
443 btfsc onesecupdate | |
444 bra comm_download_mode1 | |
445 btfsc rs232_recieve_overflow | |
446 bra comm_download_mode2 ; Wait for command byte | |
447 | |
448 ; command received! | |
449 bcf LEDr | |
450 movlw 0xFF | |
451 cpfseq RCREG1 | |
452 bra $+4 | |
453 bra comm_service_exit ; exit | |
454 movlw "a" | |
455 cpfseq RCREG1 | |
456 bra $+4 | |
457 bra comm_send_headers ; Send all 256 dive headers | |
458 movlw "b" | |
459 cpfseq RCREG1 | |
460 bra $+4 | |
461 bra comm_set_time ; Read time and date from the PC and set clock | |
462 movlw "c" | |
463 cpfseq RCREG1 | |
464 bra $+4 | |
465 bra comm_set_custom_text ; Send a opt_name_length byte string of custom text. | |
466 movlw "f" | |
467 cpfseq RCREG1 | |
468 bra $+4 | |
469 bra comm_send_dive ; Send header and profile for one dive | |
470 movlw "i" | |
471 cpfseq RCREG1 | |
472 bra $+4 | |
473 bra comm_identify ; Send firmware, serial, etc. | |
474 movlw "n" | |
475 cpfseq RCREG1 | |
476 bra $+4 | |
80 | 477 goto comm_send_string ; Send a 15byte string to the screen |
0 | 478 movlw "l" |
479 cpfseq RCREG1 | |
480 bra $+4 | |
481 call TFT_dump_screen ; Dump the screen contents | |
79
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
482 movlw "r" |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
483 cpfseq RCREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
484 bra $+4 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
485 bra comm_read_setting ; Read a setting (And send via USB) |
80 | 486 movlw "w" |
487 cpfseq RCREG1 | |
488 bra $+4 | |
489 bra comm_write_setting ; Write a setting (Into RAM) | |
490 movlw "x" | |
491 cpfseq RCREG1 | |
492 bra $+4 | |
493 bra comm_option_reset_all ; Reset all options to factory default. | |
79
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
494 |
0 | 495 |
496 btfss comm_service_enabled ; Done for Download mode | |
497 bra comm_download_mode0 ; Loop with timeout reset | |
498 | |
499 movlw 0x20 | |
500 cpfseq RCREG1 | |
501 bra $+4 | |
502 bra comm_send_range ; send hi:lo:temp1 bytes starting from ext_flash_address:3 | |
503 movlw 0x22 | |
504 cpfseq RCREG1 | |
505 bra $+4 | |
506 bra comm_reset_logbook_pointers ; Resets all logbook pointers and the logbook (!) | |
507 movlw 0x23 | |
508 cpfseq RCREG1 | |
509 bra $+4 | |
510 bra comm_reset_battery_gauge ; Resets battery gauge registers | |
511 movlw 0x30 | |
512 cpfseq RCREG1 | |
513 bra $+4 | |
514 bra comm_write_range ; write bytes starting from ext_flash_address:3 (Stop when timeout) | |
515 movlw 0x40 | |
516 cpfseq RCREG1 | |
517 bra $+4 | |
518 bra comm_erase_4kb ; erases 4kB block from ext_flash_address:3 (Warning: No confirmation or built-in security here...) | |
519 movlw 0x42 | |
520 cpfseq RCREG1 | |
521 bra $+4 | |
522 bra comm_erase_range4kb ; erases range in 4kB steps (Get 3 bytes address and 1byte amount of 4kB blocks) | |
523 movlw 0x50 | |
524 cpfseq RCREG1 | |
525 bra $+4 | |
526 bra comm_send_firmware ; sends firmware from external flash from 0x3E0000 to 0x3FD000 (118784bytes) via comm | |
527 movlw "t" | |
528 cpfseq RCREG1 | |
529 bra $+4 | |
530 goto testloop ; Start raw-data testloop | |
531 movlw 0xC1 | |
532 cpfseq RCREG1 | |
533 bra $+4 | |
534 bra comm_service_ll_bootloader ; Start low-level bootloader | |
535 bra comm_download_mode0 ; Loop with timeout reset | |
536 | |
537 ;----------------------------------------------------------------------------- | |
538 | |
539 comm_send_headers: | |
540 movlw "a" ; send echo | |
541 movwf TXREG1 | |
542 ; Send 256 bytes/dive (Header) | |
543 ; 1st: 200000h-2000FFh | |
544 ; 2nd: 201000h-2010FFh | |
545 ; 3rd: 202000h-2020FFh | |
546 ; 100: 264000h-2640FFh | |
547 ; 256: 2FF000h-2FF0FFh | |
548 movlw 0x1F | |
549 movwf ext_flash_address+2 | |
550 movlw 0xF0 | |
551 movwf ext_flash_address+1 | |
552 | |
553 comm_send_headers2: | |
554 movlw 0x00 | |
555 movwf ext_flash_address+0 | |
556 ; Adjust address for next dive | |
557 movlw 0x10 | |
558 addwf ext_flash_address+1 | |
559 movlw 0x00 | |
560 addwfc ext_flash_address+2 | |
561 | |
562 movlw 0x30 | |
563 cpfseq ext_flash_address+2 ; All 256 dive send? | |
564 bra comm_send_headers4 ; No, continue | |
565 bra comm_download_mode0 ; Done. Loop with timeout reset | |
566 | |
567 comm_send_headers4: | |
568 clrf lo ; Counter | |
569 call rs232_wait_tx ; Wait for UART | |
570 call ext_flash_read_block_start ; 1st byte | |
571 movwf TXREG1 | |
572 bra comm_send_headers3 ; counter 24bit | |
573 comm_send_headers_loop: | |
574 call ext_flash_read_block ; Read one byte | |
575 movwf TXREG1 ; Start new transmit | |
576 comm_send_headers3: | |
577 call rs232_wait_tx ; Wait for UART | |
578 decfsz lo,F | |
579 bra comm_send_headers_loop | |
580 call ext_flash_read_block_stop | |
581 bra comm_send_headers2 ; continue | |
582 | |
583 ;----------------------------------------------------------------------------- | |
80 | 584 |
585 comm_option_reset_all: ; Reset all options to factory default. | |
586 movlw "x" ; send echo | |
587 movwf TXREG1 | |
588 call option_reset_all | |
589 bra comm_download_mode0 ; Done. back to loop with timeout reset | |
590 | |
591 ;----------------------------------------------------------------------------- | |
0 | 592 |
593 comm_set_time: | |
594 movlw "b" ; send echo | |
595 movwf TXREG1 | |
596 | |
597 call rs232_wait_tx ; wait for UART | |
598 call rs232_get_byte | |
599 btfsc rs232_recieve_overflow ; Got byte? | |
600 return ; No, abort! | |
601 movff RCREG1, hours | |
602 movlw d'24' | |
603 cpfslt hours | |
604 clrf hours | |
605 call rs232_get_byte | |
606 btfsc rs232_recieve_overflow ; Got byte? | |
607 return ; No, abort! | |
608 movff RCREG1, mins | |
609 movlw d'60' | |
610 cpfslt mins | |
611 clrf mins | |
612 call rs232_get_byte | |
613 btfsc rs232_recieve_overflow ; Got byte? | |
614 return ; No, abort! | |
615 movff RCREG1, secs | |
616 movlw d'60' | |
617 cpfslt secs | |
618 clrf secs | |
619 call rs232_get_byte | |
620 btfsc rs232_recieve_overflow ; Got byte? | |
621 return ; No, abort! | |
622 movff RCREG1, month | |
623 movlw d'13' | |
624 cpfslt month | |
625 movwf month | |
626 call rs232_get_byte | |
627 btfsc rs232_recieve_overflow ; Got byte? | |
628 return ; No, abort! | |
629 rcall comm_check_day ; Check day | |
630 call rs232_get_byte | |
631 btfsc rs232_recieve_overflow ; Got byte? | |
632 return ; No, abort! | |
633 movff RCREG1, year | |
634 movlw d'100' | |
635 cpfslt year | |
636 clrf year | |
637 ; All ok, set RTCC | |
638 call rtc_set_rtc ; writes mins,sec,hours,day,month and year to rtc module | |
639 bra comm_download_mode0 ; Done. back to loop with timeout reset | |
640 | |
641 ;----------------------------------------------------------------------------- | |
642 ; Set OSTC3 custom text string (opt_name_length ascii chars). | |
643 ; | |
644 | |
645 comm_set_custom_text: | |
646 movlw "c" ; send echo | |
647 movwf TXREG1 | |
648 call rs232_wait_tx ; wait for UART | |
649 lfsr FSR2,opt_name | |
650 movlw opt_name_length | |
651 movwf lo ; counter | |
652 comm_set_ctext_loop: | |
653 call rs232_get_byte | |
654 btfsc rs232_recieve_overflow ; Got byte? | |
7 | 655 bra comm_download_mode0 ; No, loop with timeout reset |
656 movff RCREG1,POSTINC2 ; Store character | |
0 | 657 decfsz lo,F |
658 bra comm_set_ctext_loop | |
7 | 659 bra comm_download_mode0 ; Done. Loop with timeout reset |
0 | 660 |
661 ;----------------------------------------------------------------------------- | |
662 ; Reply Serial (2 bytes low:high), firmware (major.minor) and custom text. | |
663 ; | |
664 | |
665 comm_identify: | |
666 movlw "i" ; send echo | |
667 movwf TXREG1 | |
668 call rs232_wait_tx ; wait for UART | |
669 | |
670 ;---- Read serial from internal EEPROM address 0000 | |
671 clrf EEADRH | |
672 clrf EEADR ; Get Serial number LOW | |
673 call read_eeprom ; read byte | |
674 movff EEDATA,lo | |
675 incf EEADR,F ; Get Serial number HIGH | |
676 call read_eeprom ; read byte | |
677 movff EEDATA,hi | |
678 | |
679 ;---- Emit serial number | |
680 movff lo,TXREG1 | |
681 call rs232_wait_tx | |
682 movff hi,TXREG1 | |
683 call rs232_wait_tx | |
684 | |
685 ;---- Emit fiwmware hi.lo | |
686 movlw softwareversion_x | |
687 movwf TXREG1 | |
688 call rs232_wait_tx | |
689 movlw softwareversion_y | |
690 movwf TXREG1 | |
691 call rs232_wait_tx | |
692 | |
693 ;---- Emit custom text | |
694 movlw opt_name_length | |
695 movwf hi | |
696 lfsr FSR2,opt_name | |
697 | |
698 common_identify_loop: | |
699 movff POSTINC2,TXREG1 | |
700 call rs232_wait_tx | |
701 decfsz hi,F | |
702 bra common_identify_loop | |
703 | |
704 bra comm_download_mode0 ; Done. | |
705 | |
706 | |
707 ;----------------------------------------------------------------------------- | |
708 | |
709 comm_send_dive: | |
710 movlw "f" ; send echo | |
711 movwf TXREG1 | |
712 | |
713 call rs232_get_byte | |
714 btfsc rs232_recieve_overflow ; Got byte? | |
715 bra comm_download_mode0 ; No, abort! | |
716 movff RCREG1,lo ; Store dive number (0-255) | |
717 ; First, send the header (again) | |
718 ; Set ext_flash_address:3 to TOC entry of this dive | |
719 ; 1st: 200000h-200FFFh -> lo=0 | |
720 ; 2nd: 201000h-201FFFh -> lo=1 | |
721 ; 3rd: 202000h-202FFFh -> lo=2 | |
722 ; 256: 2FF000h-2FFFFFh -> lo=255 | |
723 clrf ext_flash_address+0 | |
724 clrf ext_flash_address+1 | |
725 movlw 0x20 | |
726 movwf ext_flash_address+2 | |
727 movlw .16 | |
728 mulwf lo ; lo*16 = offset to 0x2000 (up:hi) | |
729 movf PRODL,W | |
730 addwf ext_flash_address+1,F | |
731 movf PRODH,W | |
732 addwfc ext_flash_address+2,F | |
733 | |
734 incf_ext_flash_address d'2' ; Skip 0xFA, 0xFA | |
735 call ext_flash_byte_read_plus ; Read start address of profile | |
736 movff temp1,ext_flash_log_pointer+0 | |
737 call ext_flash_byte_read_plus ; Read start address of profile | |
738 movff temp1,ext_flash_log_pointer+1 | |
739 call ext_flash_byte_read_plus ; Read start address of profile | |
740 movff temp1,ext_flash_log_pointer+2 | |
741 call ext_flash_byte_read_plus ; Read end address of profile | |
742 movff temp1,convert_value_temp+0 | |
743 call ext_flash_byte_read_plus ; Read end address of profile | |
744 movff temp1,convert_value_temp+1 | |
745 call ext_flash_byte_read_plus ; Read end address of profile | |
746 movff temp1,convert_value_temp+2 | |
747 decf_ext_flash_address d'8' ; Back again to first 0xFA in header | |
748 | |
749 movf ext_flash_log_pointer+0,W | |
750 cpfseq convert_value_temp+0 ; Equal? | |
751 bra comm_send_dive1 ; No, Send header | |
752 | |
753 movf ext_flash_log_pointer+1,W | |
754 cpfseq convert_value_temp+1 ; Equal? | |
755 bra comm_send_dive1 ; No, Send header | |
756 | |
757 movf ext_flash_log_pointer+2,W | |
758 cpfseq convert_value_temp+2 ; Equal? | |
759 bra comm_send_dive1 ; No, Send header | |
760 | |
761 ; Start=End -> Not good, abort | |
762 bra comm_download_mode0 ; Done. Loop with timeout reset | |
763 | |
764 comm_send_dive1: | |
765 ; Send header | |
766 clrf hi ; Counter | |
767 call rs232_wait_tx ; Wait for UART | |
768 call ext_flash_read_block_start ; 1st byte | |
769 movwf TXREG1 | |
770 bra comm_send_dive_header | |
771 comm_send_dive_header2: | |
772 call ext_flash_read_block ; Read one byte | |
773 movwf TXREG1 ; Start new transmit | |
774 comm_send_dive_header: | |
775 call rs232_wait_tx ; Wait for UART | |
776 decfsz hi,F | |
777 bra comm_send_dive_header2 | |
778 call ext_flash_read_block_stop | |
779 | |
780 ; Set address for profile | |
781 movff ext_flash_log_pointer+0,ext_flash_address+0 | |
782 movff ext_flash_log_pointer+1,ext_flash_address+1 | |
783 movff ext_flash_log_pointer+2,ext_flash_address+2 | |
784 | |
785 movlw .6 ; Skip 6byte short header in profile - only for internal use | |
786 call incf_ext_flash_address0_0x20 ; increases bytes in ext_flash_address:3 with 0x200000 bank switching | |
787 | |
788 comm_send_dive_profile: | |
789 call ext_flash_byte_read_plus_0x20 ; Read one byte into temp1, takes care of banking at 0x200000 | |
790 call rs232_wait_tx ; Wait for UART | |
791 movff temp1,TXREG1 ; Send a byte | |
792 | |
793 ; 24bit compare with end address | |
794 movff convert_value_temp+0,WREG | |
795 cpfseq ext_flash_address+0 | |
796 bra comm_send_dive_profile | |
797 movff convert_value_temp+1,WREG | |
798 cpfseq ext_flash_address+1 | |
799 bra comm_send_dive_profile | |
800 movff convert_value_temp+2,WREG | |
801 cpfseq ext_flash_address+2 | |
802 bra comm_send_dive_profile | |
803 | |
804 call rs232_wait_tx ; Wait for UART | |
805 bra comm_download_mode0 ; Done. Loop with timeout reset | |
806 | |
807 ;----------------------------------------------------------------------------- | |
808 | |
79
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
809 comm_read_setting: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
810 movlw "r" |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
811 movwf TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
812 call rs232_get_byte |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
813 btfsc rs232_recieve_overflow ; Got byte? |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
814 bra comm_read_abort ; No, abort! |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
815 call rs232_wait_tx ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
816 movf RCREG1,W ; Copy |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
817 bz comm_read_unused ; RCREG1=0 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
818 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
819 bra comm_read_unused ; RCREG1=1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
820 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
821 bra comm_read_unused ; RCREG1=2 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
822 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
823 bra comm_read_unused ; RCREG1=3 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
824 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
825 bra comm_read_unused ; RCREG1=4 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
826 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
827 bra comm_read_unused ; RCREG1=5 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
828 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
829 bra comm_read_unused ; RCREG1=6 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
830 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
831 bra comm_read_unused ; RCREG1=7 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
832 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
833 bra comm_read_unused ; RCREG1=8 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
834 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
835 bra comm_read_unused ; RCREG1=9 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
836 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
837 bra comm_read_unused ; RCREG1=10 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
838 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
839 bra comm_read_unused ; RCREG1=11 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
840 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
841 bra comm_read_unused ; RCREG1=12 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
842 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
843 bra comm_read_unused ; RCREG1=13 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
844 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
845 bra comm_read_unused ; RCREG1=14 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
846 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
847 bra comm_read_unused ; RCREG1=15 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
848 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
849 bra comm_read_gas1 ; RCREG1=0x10 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
850 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
851 bra comm_read_gas2 ; RCREG1=0x11 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
852 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
853 bra comm_read_gas3 ; RCREG1=0x12 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
854 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
855 bra comm_read_gas4 ; RCREG1=0x13 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
856 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
857 bra comm_read_gas5 ; RCREG1=0x14 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
858 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
859 bra comm_read_dil1 ; RCREG1=0x15 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
860 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
861 bra comm_read_dil2 ; RCREG1=0x16 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
862 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
863 bra comm_read_dil3 ; RCREG1=0x17 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
864 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
865 bra comm_read_dil4 ; RCREG1=0x18 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
866 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
867 bra comm_read_dil5 ; RCREG1=0x19 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
868 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
869 bra comm_read_sp1 ; RCREG1=0x1A |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
870 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
871 bra comm_read_sp2 ; RCREG1=0x1B |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
872 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
873 bra comm_read_sp3 ; RCREG1=0x1C |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
874 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
875 bra comm_read_sp4 ; RCREG1=0x1D |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
876 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
877 bra comm_read_sp5 ; RCREG1=0x1E |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
878 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
879 bra comm_read_ccr_mode ; RCREG1=0x1F |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
880 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
881 bra comm_read_dive_mode ; RCREG1=0x20 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
882 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
883 bra comm_read_decotype ; RCREG1=0x21 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
884 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
885 bra comm_read_ppo2_max ; RCREG1=0x22 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
886 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
887 bra comm_read_ppo2_min ; RCREG1=0x23 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
888 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
889 bra comm_read_ftts ; RCREG1=0x24 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
890 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
891 bra comm_read_gf_low ; RCREG1=0x25 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
892 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
893 bra comm_read_gf_high ; RCREG1=0x26 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
894 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
895 bra comm_read_agf_low ; RCREG1=0x27 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
896 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
897 bra comm_read_agf_high ; RCREG1=0x28 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
898 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
899 bra comm_read_agf_selectable ; RCREG1=0x29 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
900 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
901 bra comm_read_saturation ; RCREG1=0x2A |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
902 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
903 bra comm_read_desaturation ; RCREG1=0x2B |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
904 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
905 bra comm_read_last_deco ; RCREG1=0x2C |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
906 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
907 bra comm_read_brightness ; RCREG1=0x2D |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
908 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
909 bra comm_read_units ; RCREG1=0x2E |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
910 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
911 bra comm_read_samplingrate ; RCREG1=0x2F |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
912 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
913 bra comm_read_salinity ; RCREG1=0x30 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
914 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
915 bra comm_read_divemode_colour ; RCREG1=0x31 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
916 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
917 bra comm_read_language ; RCREG1=0x32 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
918 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
919 bra comm_read_date_format ; RCREG1=0x33 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
920 dcfsnz WREG |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
921 bra comm_read_compass_gain ; RCREG1=0x34 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
922 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
923 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
924 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
925 comm_read_unused: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
926 comm_read_abort: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
927 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
928 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
929 comm_read_setting_wait: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
930 call rs232_wait_tx ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
931 return |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
932 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
933 comm_read_gas1: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
934 movff opt_gas_O2_ratio+0, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
935 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
936 movff opt_gas_He_ratio+0, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
937 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
938 movff opt_gas_type+0, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
939 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
940 movff char_I_deco_gas_change+0,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
941 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
942 comm_read_gas2: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
943 movff opt_gas_O2_ratio+1, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
944 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
945 movff opt_gas_He_ratio+1, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
946 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
947 movff opt_gas_type+1, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
948 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
949 movff char_I_deco_gas_change+1,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
950 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
951 comm_read_gas3: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
952 movff opt_gas_O2_ratio+2, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
953 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
954 movff opt_gas_He_ratio+2, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
955 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
956 movff opt_gas_type+2, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
957 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
958 movff char_I_deco_gas_change+2,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
959 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
960 comm_read_gas4: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
961 movff opt_gas_O2_ratio+3, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
962 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
963 movff opt_gas_He_ratio+3, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
964 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
965 movff opt_gas_type+3, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
966 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
967 movff char_I_deco_gas_change+3,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
968 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
969 comm_read_gas5: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
970 movff opt_gas_O2_ratio+4, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
971 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
972 movff opt_gas_He_ratio+4, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
973 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
974 movff opt_gas_type+4, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
975 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
976 movff char_I_deco_gas_change+4,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
977 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
978 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
979 comm_read_dil1: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
980 movff opt_dil_O2_ratio+0, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
981 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
982 movff opt_dil_He_ratio+0, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
983 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
984 movff opt_dil_type+0, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
985 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
986 movff char_I_dil_change+0,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
987 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
988 comm_read_dil2: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
989 movff opt_dil_O2_ratio+1, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
990 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
991 movff opt_dil_He_ratio+1, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
992 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
993 movff opt_dil_type+1, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
994 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
995 movff char_I_dil_change+1,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
996 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
997 comm_read_dil3: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
998 movff opt_dil_O2_ratio+2, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
999 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1000 movff opt_dil_He_ratio+2, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1001 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1002 movff opt_dil_type+2, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1003 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1004 movff char_I_dil_change+2,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1005 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1006 comm_read_dil4: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1007 movff opt_dil_O2_ratio+3, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1008 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1009 movff opt_dil_He_ratio+3, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1010 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1011 movff opt_dil_type+3, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1012 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1013 movff char_I_dil_change+3,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1014 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1015 comm_read_dil5: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1016 movff opt_dil_O2_ratio+4, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1017 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1018 movff opt_dil_He_ratio+4, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1019 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1020 movff opt_dil_type+4, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1021 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1022 movff char_I_dil_change+4,TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1023 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1024 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1025 comm_read_sp1: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1026 movff char_I_setpoint_cbar+0, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1027 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1028 movff char_I_setpoint_change+0, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1029 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1030 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1031 comm_read_sp2: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1032 movff char_I_setpoint_cbar+1, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1033 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1034 movff char_I_setpoint_change+1, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1035 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1036 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1037 comm_read_sp3: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1038 movff char_I_setpoint_cbar+2, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1039 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1040 movff char_I_setpoint_change+2, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1041 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1042 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1043 comm_read_sp4: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1044 movff char_I_setpoint_cbar+3, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1045 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1046 movff char_I_setpoint_change+3, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1047 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1048 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1049 comm_read_sp5: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1050 movff char_I_setpoint_cbar+4, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1051 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1052 movff char_I_setpoint_change+4, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1053 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1054 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1055 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1056 comm_read_ccr_mode: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1057 movff opt_ccr_mode, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1058 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1059 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1060 comm_read_dive_mode: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1061 movff opt_dive_mode, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1062 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1063 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1064 comm_read_decotype: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1065 movff char_I_deco_model, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1066 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1067 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1068 comm_read_ppo2_max: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1069 movff opt_ppO2_max, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1070 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1071 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1072 comm_read_ppo2_min: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1073 movff opt_ppO2_min, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1074 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1075 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1076 comm_read_ftts: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1077 movff char_I_extra_time, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1078 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1079 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1080 comm_read_gf_low: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1081 movff opt_GF_low, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1082 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1083 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1084 comm_read_gf_high: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1085 movff opt_GF_high, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1086 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1087 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1088 comm_read_agf_low: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1089 movff opt_aGF_low, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1090 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1091 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1092 comm_read_agf_high: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1093 movff opt_aGF_high, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1094 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1095 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1096 comm_read_agf_selectable: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1097 movff opt_enable_aGF, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1098 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1099 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1100 comm_read_saturation: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1101 movff char_I_saturation_multiplier, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1102 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1103 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1104 comm_read_desaturation: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1105 movff char_I_desaturation_multiplier, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1106 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1107 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1108 comm_read_last_deco: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1109 movff opt_last_stop, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1110 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1111 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1112 comm_read_brightness: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1113 movff opt_brightness, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1114 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1115 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1116 comm_read_units: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1117 movff opt_units, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1118 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1119 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1120 comm_read_samplingrate: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1121 movff opt_sampling_rate, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1122 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1123 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1124 comm_read_salinity: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1125 movff opt_salinity, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1126 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1127 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1128 comm_read_divemode_colour: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1129 movff opt_dive_color_scheme, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1130 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1131 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1132 comm_read_language: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1133 movff opt_language, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1134 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1135 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1136 comm_read_date_format: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1137 movff opt_dateformat, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1138 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1139 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1140 comm_read_compass_gain: |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1141 movff opt_compass_gain, TXREG1 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1142 rcall comm_read_setting_wait ; Wait for UART |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1143 bra comm_download_mode0 ; Done. Loop with timeout reset |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1144 |
80 | 1145 ;----------------------------------------------------------------------------- |
1146 | |
1147 | |
1148 comm_write_setting: | |
1149 movlw "w" | |
1150 movwf TXREG1 | |
1151 call rs232_get_byte | |
1152 btfsc rs232_recieve_overflow ; Got byte? | |
1153 bra comm_write_abort ; No, abort! | |
1154 call rs232_wait_tx ; Wait for UART | |
1155 movf RCREG1,W ; Copy | |
1156 bz comm_write_unused ; RCREG1=0 | |
1157 dcfsnz WREG | |
1158 bra comm_write_unused ; RCREG1=1 | |
1159 dcfsnz WREG | |
1160 bra comm_write_unused ; RCREG1=2 | |
1161 dcfsnz WREG | |
1162 bra comm_write_unused ; RCREG1=3 | |
1163 dcfsnz WREG | |
1164 bra comm_write_unused ; RCREG1=4 | |
1165 dcfsnz WREG | |
1166 bra comm_write_unused ; RCREG1=5 | |
1167 dcfsnz WREG | |
1168 bra comm_write_unused ; RCREG1=6 | |
1169 dcfsnz WREG | |
1170 bra comm_write_unused ; RCREG1=7 | |
1171 dcfsnz WREG | |
1172 bra comm_write_unused ; RCREG1=8 | |
1173 dcfsnz WREG | |
1174 bra comm_write_unused ; RCREG1=9 | |
1175 dcfsnz WREG | |
1176 bra comm_write_unused ; RCREG1=10 | |
1177 dcfsnz WREG | |
1178 bra comm_write_unused ; RCREG1=11 | |
1179 dcfsnz WREG | |
1180 bra comm_write_unused ; RCREG1=12 | |
1181 dcfsnz WREG | |
1182 bra comm_write_unused ; RCREG1=13 | |
1183 dcfsnz WREG | |
1184 bra comm_write_unused ; RCREG1=14 | |
1185 dcfsnz WREG | |
1186 bra comm_write_unused ; RCREG1=15 | |
1187 dcfsnz WREG | |
1188 bra comm_write_gas1 ; RCREG1=0x10 | |
1189 dcfsnz WREG | |
1190 bra comm_write_gas2 ; RCREG1=0x11 | |
1191 dcfsnz WREG | |
1192 bra comm_write_gas3 ; RCREG1=0x12 | |
1193 dcfsnz WREG | |
1194 bra comm_write_gas4 ; RCREG1=0x13 | |
1195 dcfsnz WREG | |
1196 bra comm_write_gas5 ; RCREG1=0x14 | |
1197 dcfsnz WREG | |
1198 bra comm_write_dil1 ; RCREG1=0x15 | |
1199 dcfsnz WREG | |
1200 bra comm_write_dil2 ; RCREG1=0x16 | |
1201 dcfsnz WREG | |
1202 bra comm_write_dil3 ; RCREG1=0x17 | |
1203 dcfsnz WREG | |
1204 bra comm_write_dil4 ; RCREG1=0x18 | |
1205 dcfsnz WREG | |
1206 bra comm_write_dil5 ; RCREG1=0x19 | |
1207 dcfsnz WREG | |
1208 bra comm_write_sp1 ; RCREG1=0x1A | |
1209 dcfsnz WREG | |
1210 bra comm_write_sp2 ; RCREG1=0x1B | |
1211 dcfsnz WREG | |
1212 bra comm_write_sp3 ; RCREG1=0x1C | |
1213 dcfsnz WREG | |
1214 bra comm_write_sp4 ; RCREG1=0x1D | |
1215 dcfsnz WREG | |
1216 bra comm_write_sp5 ; RCREG1=0x1E | |
1217 dcfsnz WREG | |
1218 bra comm_write_ccr_mode ; RCREG1=0x1F | |
1219 dcfsnz WREG | |
1220 bra comm_write_dive_mode ; RCREG1=0x20 | |
1221 dcfsnz WREG | |
1222 bra comm_write_decotype ; RCREG1=0x21 | |
1223 dcfsnz WREG | |
1224 bra comm_write_ppo2_max ; RCREG1=0x22 | |
1225 dcfsnz WREG | |
1226 bra comm_write_ppo2_min ; RCREG1=0x23 | |
1227 dcfsnz WREG | |
1228 bra comm_write_ftts ; RCREG1=0x24 | |
1229 dcfsnz WREG | |
1230 bra comm_write_gf_low ; RCREG1=0x25 | |
1231 dcfsnz WREG | |
1232 bra comm_write_gf_high ; RCREG1=0x26 | |
1233 dcfsnz WREG | |
1234 bra comm_write_agf_low ; RCREG1=0x27 | |
1235 dcfsnz WREG | |
1236 bra comm_write_agf_high ; RCREG1=0x28 | |
1237 dcfsnz WREG | |
1238 bra comm_write_agf_selectable ; RCREG1=0x29 | |
1239 dcfsnz WREG | |
1240 bra comm_write_saturation ; RCREG1=0x2A | |
1241 dcfsnz WREG | |
1242 bra comm_write_desaturation ; RCREG1=0x2B | |
1243 dcfsnz WREG | |
1244 bra comm_write_last_deco ; RCREG1=0x2C | |
1245 dcfsnz WREG | |
1246 bra comm_write_brightness ; RCREG1=0x2D | |
1247 dcfsnz WREG | |
1248 bra comm_write_units ; RCREG1=0x2E | |
1249 dcfsnz WREG | |
1250 bra comm_write_samplingrate ; RCREG1=0x2F | |
1251 dcfsnz WREG | |
1252 bra comm_write_salinity ; RCREG1=0x30 | |
1253 dcfsnz WREG | |
1254 bra comm_write_divemode_colour ; RCREG1=0x31 | |
1255 dcfsnz WREG | |
1256 bra comm_write_language ; RCREG1=0x32 | |
1257 dcfsnz WREG | |
1258 bra comm_write_date_format ; RCREG1=0x33 | |
1259 dcfsnz WREG | |
1260 bra comm_write_compass_gain ; RCREG1=0x34 | |
1261 | |
1262 comm_write_unused: | |
1263 comm_write_abort: | |
1264 bra comm_download_mode0 ; Done. Loop with timeout reset | |
1265 | |
1266 comm_write_gas1: | |
1267 call rs232_get_byte | |
1268 movff RCREG1,opt_gas_O2_ratio+0 | |
1269 call rs232_get_byte | |
1270 movff RCREG1,opt_gas_He_ratio+0 | |
1271 call rs232_get_byte | |
1272 movff RCREG1,opt_gas_type+0 | |
1273 call rs232_get_byte | |
1274 movff RCREG1,char_I_deco_gas_change+0 | |
1275 bra comm_write_abort ; Done. Loop with timeout reset | |
1276 comm_write_gas2: | |
1277 call rs232_get_byte | |
1278 movff RCREG1,opt_gas_O2_ratio+1 | |
1279 call rs232_get_byte | |
1280 movff RCREG1,opt_gas_He_ratio+1 | |
1281 call rs232_get_byte | |
1282 movff RCREG1,opt_gas_type+1 | |
1283 call rs232_get_byte | |
1284 movff RCREG1,char_I_deco_gas_change+1 | |
1285 bra comm_write_abort ; Done. Loop with timeout reset | |
1286 comm_write_gas3: | |
1287 call rs232_get_byte | |
1288 movff RCREG1,opt_gas_O2_ratio+2 | |
1289 call rs232_get_byte | |
1290 movff RCREG1,opt_gas_He_ratio+2 | |
1291 call rs232_get_byte | |
1292 movff RCREG1,opt_gas_type+2 | |
1293 call rs232_get_byte | |
1294 movff RCREG1,char_I_deco_gas_change+2 | |
1295 bra comm_write_abort ; Done. Loop with timeout reset | |
1296 comm_write_gas4: | |
1297 call rs232_get_byte | |
1298 movff RCREG1,opt_gas_O2_ratio+3 | |
1299 call rs232_get_byte | |
1300 movff RCREG1,opt_gas_He_ratio+3 | |
1301 call rs232_get_byte | |
1302 movff RCREG1,opt_gas_type+3 | |
1303 call rs232_get_byte | |
1304 movff RCREG1,char_I_deco_gas_change+3 | |
1305 bra comm_write_abort ; Done. Loop with timeout reset | |
1306 comm_write_gas5: | |
1307 call rs232_get_byte | |
1308 movff RCREG1,opt_gas_O2_ratio+4 | |
1309 call rs232_get_byte | |
1310 movff RCREG1,opt_gas_He_ratio+4 | |
1311 call rs232_get_byte | |
1312 movff RCREG1,opt_gas_type+4 | |
1313 call rs232_get_byte | |
1314 movff RCREG1,char_I_deco_gas_change+4 | |
1315 bra comm_write_abort ; Done. Loop with timeout reset | |
1316 | |
1317 comm_write_dil1: | |
1318 call rs232_get_byte | |
1319 movff RCREG1,opt_dil_O2_ratio+0 | |
1320 call rs232_get_byte | |
1321 movff RCREG1,opt_dil_He_ratio+0 | |
1322 call rs232_get_byte | |
1323 movff RCREG1,opt_dil_type+0 | |
1324 call rs232_get_byte | |
1325 movff RCREG1,char_I_dil_change+0 | |
1326 bra comm_write_abort ; Done. Loop with timeout reset | |
1327 comm_write_dil2: | |
1328 call rs232_get_byte | |
1329 movff RCREG1,opt_dil_O2_ratio+1 | |
1330 call rs232_get_byte | |
1331 movff RCREG1,opt_dil_He_ratio+1 | |
1332 call rs232_get_byte | |
1333 movff RCREG1,opt_dil_type+1 | |
1334 call rs232_get_byte | |
1335 movff RCREG1,char_I_dil_change+1 | |
1336 bra comm_write_abort ; Done. Loop with timeout reset | |
1337 comm_write_dil3: | |
1338 call rs232_get_byte | |
1339 movff RCREG1,opt_dil_O2_ratio+2 | |
1340 call rs232_get_byte | |
1341 movff RCREG1,opt_dil_He_ratio+2 | |
1342 call rs232_get_byte | |
1343 movff RCREG1,opt_dil_type+2 | |
1344 call rs232_get_byte | |
1345 movff RCREG1,char_I_dil_change+2 | |
1346 bra comm_write_abort ; Done. Loop with timeout reset | |
1347 comm_write_dil4: | |
1348 call rs232_get_byte | |
1349 movff RCREG1,opt_dil_O2_ratio+3 | |
1350 call rs232_get_byte | |
1351 movff RCREG1,opt_dil_He_ratio+3 | |
1352 call rs232_get_byte | |
1353 movff RCREG1,opt_dil_type+3 | |
1354 call rs232_get_byte | |
1355 movff RCREG1,char_I_dil_change+3 | |
1356 bra comm_write_abort ; Done. Loop with timeout reset | |
1357 comm_write_dil5: | |
1358 call rs232_get_byte | |
1359 movff RCREG1,opt_dil_O2_ratio+4 | |
1360 call rs232_get_byte | |
1361 movff RCREG1,opt_dil_He_ratio+4 | |
1362 call rs232_get_byte | |
1363 movff RCREG1,opt_dil_type+4 | |
1364 call rs232_get_byte | |
1365 movff RCREG1,char_I_dil_change+4 | |
1366 bra comm_write_abort ; Done. Loop with timeout reset | |
1367 | |
1368 comm_write_sp1: | |
1369 call rs232_get_byte | |
1370 movff RCREG1,char_I_setpoint_cbar+0 | |
1371 call rs232_get_byte | |
1372 movff RCREG1,char_I_setpoint_change+0 | |
1373 bra comm_write_abort ; Done. Loop with timeout reset | |
1374 comm_write_sp2: | |
1375 call rs232_get_byte | |
1376 movff RCREG1,char_I_setpoint_cbar+1 | |
1377 call rs232_get_byte | |
1378 movff RCREG1,char_I_setpoint_change+1 | |
1379 bra comm_write_abort ; Done. Loop with timeout reset | |
1380 comm_write_sp3: | |
1381 call rs232_get_byte | |
1382 movff RCREG1,char_I_setpoint_cbar+2 | |
1383 call rs232_get_byte | |
1384 movff RCREG1,char_I_setpoint_change+2 | |
1385 bra comm_write_abort ; Done. Loop with timeout reset | |
1386 comm_write_sp4: | |
1387 call rs232_get_byte | |
1388 movff RCREG1,char_I_setpoint_cbar+3 | |
1389 call rs232_get_byte | |
1390 movff RCREG1,char_I_setpoint_change+3 | |
1391 bra comm_write_abort ; Done. Loop with timeout reset | |
1392 comm_write_sp5: | |
1393 call rs232_get_byte | |
1394 movff RCREG1,char_I_setpoint_cbar+4 | |
1395 call rs232_get_byte | |
1396 movff RCREG1,char_I_setpoint_change+4 | |
1397 bra comm_write_abort ; Done. Loop with timeout reset | |
1398 | |
1399 comm_write_ccr_mode: | |
1400 call rs232_get_byte | |
1401 movff RCREG1, opt_ccr_mode | |
1402 bra comm_write_abort ; Done. Loop with timeout reset | |
1403 comm_write_dive_mode: | |
1404 call rs232_get_byte | |
1405 movff RCREG1, opt_dive_mode | |
1406 bra comm_write_abort ; Done. Loop with timeout reset | |
1407 comm_write_decotype: | |
1408 call rs232_get_byte | |
1409 movff RCREG1, char_I_deco_model | |
1410 bra comm_write_abort ; Done. Loop with timeout reset | |
1411 comm_write_ppo2_max: | |
1412 call rs232_get_byte | |
1413 movff RCREG1, opt_ppO2_max | |
1414 bra comm_write_abort ; Done. Loop with timeout reset | |
1415 comm_write_ppo2_min: | |
1416 call rs232_get_byte | |
1417 movff RCREG1, opt_ppO2_min | |
1418 bra comm_write_abort ; Done. Loop with timeout reset | |
1419 comm_write_ftts: | |
1420 call rs232_get_byte | |
1421 movff RCREG1, char_I_extra_time | |
1422 bra comm_write_abort ; Done. Loop with timeout reset | |
1423 comm_write_gf_low: | |
1424 call rs232_get_byte | |
1425 movff RCREG1, opt_GF_low | |
1426 bra comm_write_abort ; Done. Loop with timeout reset | |
1427 comm_write_gf_high: | |
1428 call rs232_get_byte | |
1429 movff RCREG1, opt_GF_high | |
1430 bra comm_write_abort ; Done. Loop with timeout reset | |
1431 comm_write_agf_low: | |
1432 call rs232_get_byte | |
1433 movff RCREG1, opt_aGF_low | |
1434 bra comm_write_abort ; Done. Loop with timeout reset | |
1435 comm_write_agf_high: | |
1436 call rs232_get_byte | |
1437 movff RCREG1, opt_aGF_high | |
1438 bra comm_write_abort ; Done. Loop with timeout reset | |
1439 comm_write_agf_selectable: | |
1440 call rs232_get_byte | |
1441 movff RCREG1, opt_enable_aGF | |
1442 bra comm_write_abort ; Done. Loop with timeout reset | |
1443 comm_write_saturation: | |
1444 call rs232_get_byte | |
1445 movff RCREG1, char_I_saturation_multiplier | |
1446 bra comm_write_abort ; Done. Loop with timeout reset | |
1447 comm_write_desaturation: | |
1448 call rs232_get_byte | |
1449 movff RCREG1, char_I_desaturation_multiplier | |
1450 bra comm_write_abort ; Done. Loop with timeout reset | |
1451 comm_write_last_deco: | |
1452 call rs232_get_byte | |
1453 movff RCREG1, opt_last_stop | |
1454 bra comm_write_abort ; Done. Loop with timeout reset | |
1455 comm_write_brightness: | |
1456 call rs232_get_byte | |
1457 movff RCREG1, opt_brightness | |
1458 bra comm_write_abort ; Done. Loop with timeout reset | |
1459 comm_write_units: | |
1460 call rs232_get_byte | |
1461 movff RCREG1, opt_units | |
1462 bra comm_write_abort ; Done. Loop with timeout reset | |
1463 comm_write_samplingrate: | |
1464 call rs232_get_byte | |
1465 movff RCREG1, opt_sampling_rate | |
1466 bra comm_write_abort ; Done. Loop with timeout reset | |
1467 comm_write_salinity: | |
1468 call rs232_get_byte | |
1469 movff RCREG1, opt_salinity | |
1470 bra comm_write_abort ; Done. Loop with timeout reset | |
1471 comm_write_divemode_colour: | |
1472 call rs232_get_byte | |
1473 movff RCREG1, opt_dive_color_scheme | |
1474 bra comm_write_abort ; Done. Loop with timeout reset | |
1475 comm_write_language: | |
1476 call rs232_get_byte | |
1477 movff RCREG1, opt_language | |
1478 bra comm_write_abort ; Done. Loop with timeout reset | |
1479 comm_write_date_format: | |
1480 call rs232_get_byte | |
1481 movff RCREG1, opt_dateformat | |
1482 bra comm_write_abort ; Done. Loop with timeout reset | |
1483 comm_write_compass_gain: | |
1484 call rs232_get_byte | |
1485 movff RCREG1, opt_compass_gain | |
1486 bra comm_write_abort ; Done. Loop with timeout reset | |
79
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1487 |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1488 ;----------------------------------------------------------------------------- |
0fc8113ddf6d
new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents:
69
diff
changeset
|
1489 |
0 | 1490 comm_send_string: |
1491 movlw "n" ; send echo | |
1492 movwf TXREG1 | |
1493 call rs232_wait_tx ; Wait for UART | |
1494 WIN_SMALL comm_string_column, comm_string_row | |
1495 lfsr FSR2,buffer | |
1496 movlw .16 | |
1497 movwf lo ; counter | |
1498 comm_send_string_loop: | |
1499 call rs232_get_byte | |
1500 btfsc rs232_recieve_overflow ; Got byte? | |
1501 bra comm_send_string_abort ; No, abort! | |
1502 movff RCREG1,POSTINC2 ; Store character | |
1503 decfsz lo,F | |
1504 bra comm_send_string_loop | |
1505 comm_send_string_abort: | |
1506 STRCAT_PRINT "" ; Show the text | |
80 | 1507 goto comm_download_mode0 ; Done. Loop with timeout reset |
0 | 1508 |
1509 ;----------------------------------------------------------------------------- | |
1510 | |
1511 comm_check_day: | |
1512 movff RCREG1, day | |
1513 movff month,lo ; new month | |
1514 dcfsnz lo,F | |
1515 movlw .31 | |
1516 dcfsnz lo,F | |
1517 movlw .28 | |
1518 dcfsnz lo,F | |
1519 movlw .31 | |
1520 dcfsnz lo,F | |
1521 movlw .30 | |
1522 dcfsnz lo,F | |
1523 movlw .31 | |
1524 dcfsnz lo,F | |
1525 movlw .30 | |
1526 dcfsnz lo,F | |
1527 movlw .31 | |
1528 dcfsnz lo,F | |
1529 movlw .31 | |
1530 dcfsnz lo,F | |
1531 movlw .30 | |
1532 dcfsnz lo,F | |
1533 movlw .31 | |
1534 dcfsnz lo,F | |
1535 movlw .30 | |
1536 dcfsnz lo,F | |
1537 movlw .31 | |
1538 cpfsgt day ; day ok? | |
1539 return ; OK | |
1540 movlw .1 ; not OK, set to 1st | |
1541 movwf day | |
1542 return | |
1543 | |
1544 ;---------------------------------------------------------------------------- | |
1545 END |