comparison code_part1/OSTC_code_asm_part1/menu_logbook.asm @ 41:3ab1188651af

1.63 in work...
author heinrichsweikamp
date Sun, 20 Jun 2010 17:16:32 +0200
parents 6e5db85382a2
children da553e5c7a90
comparison
equal deleted inserted replaced
40:92001c045088 41:3ab1188651af
300 movff SSPBUF,lo ; 300 movff SSPBUF,lo ;
301 301
302 call I2CREAD2 ; Skip Profile version 302 call I2CREAD2 ; Skip Profile version
303 movff SSPBUF,lo ; read month 303 movff SSPBUF,lo ; read month
304 304
305 movff eeprom_address+0, EventByte ; Store current EEPROM position 305 ; movff eeprom_address+0, EventByte ; Store current EEPROM position
306 movff eeprom_address+1, ProfileFlagByte 306 ; movff eeprom_address+1, ProfileFlagByte
307 ; Offset to SamplingRate 307 ; Offset to SamplingRate
308 incf_eeprom_address d'32' ; Macro, that adds 8Bit to eeprom_address:2 with banking at 0x8000 308 incf_eeprom_address d'32' ; Macro, that adds 8Bit to eeprom_address:2 with banking at 0x8000
309 call I2CREAD ; Read Sampling rate 309 call I2CREAD ; Read Sampling rate
310 movff SSPBUF,samplesecs_value ; Copy sampling rate 310 movff SSPBUF,samplesecs_value ; Copy sampling rate
311 311 decf_eeprom_address d'32' ; Macro, that subtracts 8Bit from eeprom_address:2 with banking at 0x8000
312 movff EventByte, eeprom_address+0 ; Re-Store current EEPROM position 312 ; movff EventByte, eeprom_address+0 ; Re-Store current EEPROM position
313 movff ProfileFlagByte, eeprom_address+1 ; Re-Store current EEPROM position 313 ; movff ProfileFlagByte, eeprom_address+1 ; Re-Store current EEPROM position
314 314
315 ;display_profile2a: 315 ;display_profile2a:
316 316
317 movff lo,convert_value_temp+0 ; Month (in lo, see above) 317 movff lo,convert_value_temp+0 ; Month (in lo, see above)
318 call I2CREAD2 ; Day 318 call I2CREAD2 ; Day
558 movff lo,xA+0 558 movff lo,xA+0
559 movff hi,xA+1 559 movff hi,xA+1
560 call div16x16 ; xA/xB=xC 560 call div16x16 ; xA/xB=xC
561 movlw d'75' 561 movlw d'75'
562 addwf xC+0,F ; add 75 pixel offset to result 562 addwf xC+0,F ; add 75 pixel offset to result
563
564 btfsc STATUS,C ; Ignore potential profile errors
565 movff apnoe_mins,xC+0
566
563 call profile_display_fill ; In this column between this row (xC+0) and the last row (apnoe_mins) 567 call profile_display_fill ; In this column between this row (xC+0) and the last row (apnoe_mins)
564 movff xC+0,apnoe_mins ; Store last row for fill routine 568 movff xC+0,apnoe_mins ; Store last row for fill routine
565 movf xC+0,W 569 movf xC+0,W
566 call PLED_SetRow ; 0...259 570 call PLED_SetRow ; 0...259
567 571
678 bra profile_view_get_depth_new1 ; no 0xFD 682 bra profile_view_get_depth_new1 ; no 0xFD
679 bsf second_FD ; End found! Set Flag! Skip remaining pixels! 683 bsf second_FD ; End found! Set Flag! Skip remaining pixels!
680 return 684 return
681 685
682 profile_view_get_depth_new1: 686 profile_view_get_depth_new1:
683 decfsz divisor_deco,F ; Check divisor 687 ;bra profile_view_get_depth_new1_1 ; Skip all data to ignore...
684 bra profile_view_get_depth_new1_1 ; Divisor not zero... 688
685 689 ; decfsz divisor_deco,F ; Check divisor
686 ; tstfsz timeout_counter2 ; Any bytes to ignore 690 ; bra profile_view_get_depth_new1_1 ; Divisor not zero...
687 ; bra profile_view_get_depth_new2 ; Yes (1-127) 691 ;
688 ; return ; No (0) 692 ;; tstfsz timeout_counter2 ; Any bytes to ignore
689 693 ;; bra profile_view_get_depth_new2 ; Yes (1-127)
690 movff logbook_temp2,divisor_deco ; Restore divisor value! 694 ;; return ; No (0)
691 ; check for event byte and the extra informations 695 ;
692 btfss event_occured 696 ; movff logbook_temp2,divisor_deco ; Restore divisor value!
693 bra profile_view_get_depth_new2 ; No event! 697 ;; check for event byte and the extra informations
694 698 ; btfss event_occured
695 call I2CREAD2 ; read event byte 699 ; bra profile_view_get_depth_new2 ; No event!
696 decf timeout_counter2,F ; Reduce number of bytes to ignore 700 ;
697 701 ; call I2CREAD2 ; read event byte
698 movlw d'0' ; Extra bytes to ignore because of event 702 ; decf timeout_counter2,F ; Reduce number of bytes to ignore
699 btfsc SSPBUF,4 703 ;
700 addlw d'2' ; two bytes for manual gas set 704 ; movlw d'0' ; Extra bytes to ignore because of event
701 btfsc SSPBUF,5 705 ; btfsc SSPBUF,4
702 addlw d'1' ; one byte for gas change 706 ; addlw d'2' ; two bytes for manual gas set
703 movwf logbook_temp5 ; store extra bytes to ignore 707 ; btfsc SSPBUF,5
704 708 ; addlw d'1' ; one byte for gas change
705 tstfsz logbook_temp5 ; Anything to ignore? 709 ; movwf logbook_temp5 ; store extra bytes to ignore
706 bra profile_view_get_depth_new1_2 ; Yes 710 ;
707 bra profile_view_get_depth_new2 ; No, continue with normal routine 711 ; tstfsz logbook_temp5 ; Anything to ignore?
708 712 ; bra profile_view_get_depth_new1_2 ; Yes
709 profile_view_get_depth_new1_2: 713 ; bra profile_view_get_depth_new2 ; No, continue with normal routine
710 call I2CREAD2 ; ignore byte 714 ;
711 decf timeout_counter2,F ; Reduce number of bytes to ignore 715 ;profile_view_get_depth_new1_2:
712 decfsz logbook_temp5,F ; reduce extra bytes ignore counter 716 ; call I2CREAD2 ; ignore byte
713 bra profile_view_get_depth_new1_2 ; loop 717 ; decf timeout_counter2,F ; Reduce number of bytes to ignore
714 718 ; decfsz logbook_temp5,F ; reduce extra bytes ignore counter
715 profile_view_get_depth_new2: 719 ; bra profile_view_get_depth_new1_2 ; loop
716 movlw d'4' ; Temp (2) and Deko (2) in the sample? 720 ;
717 cpfseq timeout_counter2 721 ;profile_view_get_depth_new2:
718 bra profile_view_get_depth_new2_2 ; No 722 ; movlw d'4' ; Temp (2) and Deko (2) in the sample?
719 ; Yes, skip Temp! 723 ; cpfseq timeout_counter2
720 call I2CREAD2 ; ignore byte 724 ; bra profile_view_get_depth_new2_2 ; No
721 decf timeout_counter2,F ; Reduce number of bytes to ignore 725 ; ; Yes, skip Temp!
722 call I2CREAD2 ; ignore byte 726 ; call I2CREAD2 ; ignore byte
723 decf timeout_counter2,F ; Reduce number of bytes to ignore 727 ; decf timeout_counter2,F ; Reduce number of bytes to ignore
724 728 ; call I2CREAD2 ; ignore byte
725 profile_view_get_depth_new2_2: 729 ; decf timeout_counter2,F ; Reduce number of bytes to ignore
726 call I2CREAD2 ; ignore byte 730 ;
727 731 ;profile_view_get_depth_new2_2:
728 decfsz timeout_counter2,F ; reduce counter 732 ; call I2CREAD2 ; ignore byte
729 bra profile_view_get_depth_new2_2; Loop 733 ;
730 return 734 ; decfsz timeout_counter2,F ; reduce counter
735 ; bra profile_view_get_depth_new2_2; Loop
736 ; return
731 737
732 profile_view_get_depth_new1_1: 738 profile_view_get_depth_new1_1:
733 tstfsz timeout_counter2 ; Any bytes to ignore 739 tstfsz timeout_counter2 ; Any bytes to ignore
734 bra profile_view_get_depth_new3 ; Yes (1-127) 740 bra profile_view_get_depth_new3 ; Yes (1-127)
735 return ; No (0) 741 return ; No (0)