Mercurial > public > hwos_code
comparison src/comm.asm @ 346:cf9ce6053dee
New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
author | heinrichsweikamp |
---|---|
date | Tue, 21 Jul 2015 12:08:01 +0200 |
parents | 508d7fb98b34 |
children | 7e5772df60cd |
comparison
equal
deleted
inserted
replaced
345:3f2d0c0bc101 | 346:cf9ce6053dee |
---|---|
501 bra comm_hardware_descriptor ; Send hardware descriptor byte | 501 bra comm_hardware_descriptor ; Send hardware descriptor byte |
502 movlw "n" | 502 movlw "n" |
503 cpfseq RCREG1 | 503 cpfseq RCREG1 |
504 bra $+4 | 504 bra $+4 |
505 goto comm_send_string ; Send a 15byte string to the screen | 505 goto comm_send_string ; Send a 15byte string to the screen |
506 movlw "m" | |
507 cpfseq RCREG1 | |
508 bra $+4 | |
509 goto comm_send_compact_headers ; Send all 256 compact headers | |
506 movlw "l" | 510 movlw "l" |
507 cpfseq RCREG1 | 511 cpfseq RCREG1 |
508 bra $+4 | 512 bra $+4 |
509 call TFT_dump_screen ; Dump the screen contents | 513 call TFT_dump_screen ; Dump the screen contents |
510 movlw "r" | 514 movlw "r" |
559 movlw 0xC1 | 563 movlw 0xC1 |
560 cpfseq RCREG1 | 564 cpfseq RCREG1 |
561 bra $+4 | 565 bra $+4 |
562 bra comm_service_ll_bootloader ; Start low-level bootloader | 566 bra comm_service_ll_bootloader ; Start low-level bootloader |
563 bra comm_download_mode0 ; Loop with timeout reset | 567 bra comm_download_mode0 ; Loop with timeout reset |
568 | |
569 ;----------------------------------------------------------------------------- | |
570 | |
571 comm_send_compact_headers: | |
572 movlw "m" ; send echo | |
573 movwf TXREG1 | |
574 ; Send 16 bytes/dive (Compact Header) | |
575 ; 1st: 20000Ch-20001Ch | |
576 ; 2nd: 20100Ch-20101Ch | |
577 ; 3rd: 20200Ch-20201Ch | |
578 ; 100: 26400Ch-26401Ch | |
579 ; 256: 2FF00Ch-2FF01Ch | |
580 movlw 0x1F | |
581 movwf ext_flash_address+2 | |
582 movlw 0xF0 | |
583 movwf ext_flash_address+1 | |
584 | |
585 comm_send_compact_headers2: | |
586 movlw 0x0C | |
587 movwf ext_flash_address+0 | |
588 ; Adjust address for next dive | |
589 movlw 0x10 | |
590 addwf ext_flash_address+1 | |
591 movlw 0x00 | |
592 addwfc ext_flash_address+2 | |
593 | |
594 movlw 0x30 | |
595 cpfseq ext_flash_address+2 ; All 256 dive send? | |
596 bra comm_send_compact_headers4 ; No, continue | |
597 bra comm_download_mode0 ; Done. Loop with timeout reset | |
598 | |
599 comm_send_compact_headers4: | |
600 movlw .10 | |
601 movwf lo ; Counter | |
602 call rs232_wait_tx ; Wait for UART | |
603 call ext_flash_read_block_start ; 1st byte | |
604 movwf TXREG1 | |
605 bra comm_send_compact_headers3 ; counter 24bit | |
606 comm_send_compact_headers_loop: | |
607 call ext_flash_read_block ; Read one byte | |
608 movwf TXREG1 ; Start new transmit | |
609 comm_send_compact_headers3: | |
610 call rs232_wait_tx ; Wait for UART | |
611 decfsz lo,F | |
612 bra comm_send_compact_headers_loop | |
613 call ext_flash_read_block_stop | |
614 movlw .6 | |
615 movwf lo ; Counter | |
616 comm_send_compact_headers5: | |
617 movlw 0xFF | |
618 movwf TXREG1 | |
619 call rs232_wait_tx ; Wait for UART | |
620 decfsz lo,F | |
621 bra comm_send_compact_headers5 | |
622 bra comm_send_compact_headers2 ; continue | |
623 | |
564 | 624 |
565 ;----------------------------------------------------------------------------- | 625 ;----------------------------------------------------------------------------- |
566 | 626 |
567 comm_send_headers: | 627 comm_send_headers: |
568 movlw "a" ; send echo | 628 movlw "a" ; send echo |