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