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