Mercurial > public > hwos_code
comparison src/isr.asm @ 319:cf929551d31c new_screen_layout
move flag13 into bank common
author | heinrichsweikamp |
---|---|
date | Thu, 11 Jun 2015 16:44:32 +0200 |
parents | 653a3ab08062 |
children | 36bd27f42362 |
comparison
equal
deleted
inserted
replaced
318:6d8c82fe5a01 | 319:cf929551d31c |
---|---|
333 isr_sensor_state2: | 333 isr_sensor_state2: |
334 banksel common | 334 banksel common |
335 movff sensor_state_counter,WREG | 335 movff sensor_state_counter,WREG |
336 btfss WREG,0 ; every 1/4 second | 336 btfss WREG,0 ; every 1/4 second |
337 bsf quarter_second_update ; Set flag | 337 bsf quarter_second_update ; Set flag |
338 banksel isr_backup ; Back to Bank0 ISR data | |
338 movlw d'2' | 339 movlw d'2' |
339 cpfseq speed_setting ; Set to normal in case it's not already in normal speed mode | 340 cpfseq speed_setting ; Set to normal in case it's not already in normal speed mode |
340 rcall isr_set_speed_to_normal | 341 rcall isr_set_speed_to_normal |
341 banksel isr_backup ; Back to Bank0 ISR data | 342 |
342 | |
343 incf sensor_state_counter,F ; counts to eight for state maschine | 343 incf sensor_state_counter,F ; counts to eight for state maschine |
344 | 344 |
345 ; State 1: Clear flags and average registers, get temperature (51us) and start pressure integration (73,5us) | 345 ; State 1: Clear flags and average registers, get temperature (51us) and start pressure integration (73,5us) |
346 ; State 2: Get pressure (51us), start temperature integration (73,5us) and calculate temperature compensated pressure (233us) | 346 ; State 2: Get pressure (51us), start temperature integration (73,5us) and calculate temperature compensated pressure (233us) |
347 ; State 3: Get temperature (51us) and start pressure integration (73,5us) | 347 ; State 3: Get temperature (51us) and start pressure integration (73,5us) |
612 movff PRODL,isr1_temp | 612 movff PRODL,isr1_temp |
613 movff PRODH,isr2_temp ; isr1_temp and isr2_temp hold value for backlight | 613 movff PRODH,isr2_temp ; isr1_temp and isr2_temp hold value for backlight |
614 | 614 |
615 ; Add current for CPU and GPU | 615 ; Add current for CPU and GPU |
616 ; speed_setting=1: ECO (3,1mA -> 861nAs), =2: NORMAL (5,50mA -> 1528nAs) or =3: FASTEST (8,04mA -> 2233nAs) | 616 ; speed_setting=1: ECO (3,1mA -> 861nAs), =2: NORMAL (5,50mA -> 1528nAs) or =3: FASTEST (8,04mA -> 2233nAs) |
617 banksel isr_backup ; Bank0 ISR data | |
617 movlw .1 | 618 movlw .1 |
618 cpfseq speed_setting | 619 cpfseq speed_setting |
619 bra isr_battery_gauge3 | 620 bra isr_battery_gauge3 |
620 banksel isr_backup ; Bank0 ISR data | |
621 movlw LOW current_speed_eco | 621 movlw LOW current_speed_eco |
622 addwf isr1_temp,F | 622 addwf isr1_temp,F |
623 movlw HIGH current_speed_eco | 623 movlw HIGH current_speed_eco |
624 addwfc isr2_temp,F | 624 addwfc isr2_temp,F |
625 bra isr_battery_gauge5 | 625 bra isr_battery_gauge5 |
626 isr_battery_gauge3: | 626 isr_battery_gauge3: |
627 movlw .2 | 627 movlw .2 |
628 cpfseq speed_setting | 628 cpfseq speed_setting |
629 bra isr_battery_gauge4 | 629 bra isr_battery_gauge4 |
630 banksel isr_backup ; Bank0 ISR data | |
631 movlw LOW current_speed_normal | 630 movlw LOW current_speed_normal |
632 addwf isr1_temp,F | 631 addwf isr1_temp,F |
633 movlw HIGH current_speed_normal | 632 movlw HIGH current_speed_normal |
634 addwfc isr2_temp,F | 633 addwfc isr2_temp,F |
635 bra isr_battery_gauge5 | 634 bra isr_battery_gauge5 |
636 isr_battery_gauge4: | 635 isr_battery_gauge4: |
637 banksel isr_backup ; Bank0 ISR data | |
638 movlw LOW current_speed_fastest | 636 movlw LOW current_speed_fastest |
639 addwf isr1_temp,F | 637 addwf isr1_temp,F |
640 movlw HIGH current_speed_fastest | 638 movlw HIGH current_speed_fastest |
641 addwfc isr2_temp,F | 639 addwfc isr2_temp,F |
642 isr_battery_gauge5: | 640 isr_battery_gauge5: |
812 | 810 |
813 ;============================================================================= | 811 ;============================================================================= |
814 | 812 |
815 isr_restore_clock: | 813 isr_restore_clock: |
816 banksel isr_backup | 814 banksel isr_backup |
817 movff speed_setting,isr1_temp ; Copy to Bank0 | |
818 movlw d'1' | 815 movlw d'1' |
819 cpfseq isr1_temp | 816 cpfseq speed_setting |
820 bra isr_restore_speed2 | 817 bra isr_restore_speed2 |
821 ; Reset to eco | 818 ; Reset to eco |
822 movlw b'00000000' | 819 movlw b'00000000' |
823 movwf OSCTUNE ; 4x PLL Disable (Bit6) - only works with 8 or 16MHz (=32 or 64MHz) | 820 movwf OSCTUNE ; 4x PLL Disable (Bit6) - only works with 8 or 16MHz (=32 or 64MHz) |
824 movlw b'00110010' | 821 movlw b'00110010' |
826 movlw T2CON_ECO | 823 movlw T2CON_ECO |
827 movwf T2CON | 824 movwf T2CON |
828 bra isr_restore_exit | 825 bra isr_restore_exit |
829 isr_restore_speed2: | 826 isr_restore_speed2: |
830 movlw d'2' | 827 movlw d'2' |
831 cpfseq isr1_temp | 828 cpfseq speed_setting |
832 bra isr_restore_speed3 | 829 bra isr_restore_speed3 |
833 ; Reset to normal | 830 ; Reset to normal |
834 movlw b'01110010' | 831 movlw b'01110010' |
835 movwf OSCCON ; 16MHz INTOSC | 832 movwf OSCCON ; 16MHz INTOSC |
836 movlw b'00000000' | 833 movlw b'00000000' |