comparison src/isr.asm @ 453:b4f28ab23b87

NEW: Show Uptime (Time since last firmware boot) in information menu
author heinrichsweikamp
date Mon, 19 Sep 2016 16:32:02 +0200
parents 66049b6f2c0b
children bab31db6e006
comparison
equal deleted inserted replaced
452:55dcf1b248f2 453:b4f28ab23b87
573 btfss sleepmode ; in Sleepmode? 573 btfss sleepmode ; in Sleepmode?
574 call get_ambient_level ; No, get ambient light level and set max_CCPR1L 574 call get_ambient_level ; No, get ambient light level and set max_CCPR1L
575 575
576 rcall isr_battery_gauge ; Add amount of battery consumption to battery_gauge:6 576 rcall isr_battery_gauge ; Add amount of battery consumption to battery_gauge:6
577 577
578 ; update uptime
579 banksel uptime+0
580 incf uptime+0,F
581 movlw .0
582 addwfc uptime+1,F
583 addwfc uptime+2,F
584 addwfc uptime+3,F
585
578 banksel common ; flag1 is in Bank1 586 banksel common ; flag1 is in Bank1
579 bsf onesecupdate ; A new second has begun 587 bsf onesecupdate ; A new second has begun
580 btfsc divemode ; in divemode? 588 btfsc divemode ; in divemode?
581 rcall isr_divemode_1sec ; Yes, do some divemode stuff in bank common 589 rcall isr_divemode_1sec ; Yes, do some divemode stuff in bank common
582 590
583 tstfsz secs ; Secs == 0 ? 591 btfss divemode ; in divemode?
584 return ; No, Done. 592 rcall isr_update_lastdive_time ; No, update the lastdive timer
593
594 tstfsz secs ; Secs == 0 ?
595 return ; No, Done.
585 596
586 bsf oneminupdate ; A new minute has begun 597 bsf oneminupdate ; A new minute has begun
587 598
588 btfss divemode ; In Divemode? 599 btfss divemode ; In Divemode?
589 rcall check_nofly_desat_time ; No, so reduce NoFly and Desat and increase interval 600 rcall check_nofly_desat_time ; No, so reduce NoFly and Desat and increase interval
595 606
596 isr_rtcc2: 607 isr_rtcc2:
597 banksel isr_backup ; Back to Bank0 ISR data 608 banksel isr_backup ; Back to Bank0 ISR data
598 return ; Done. 609 return ; Done.
599 610
611 isr_update_lastdive_time:
612 ; update uptime
613 banksel lastdive_time+0
614 incf lastdive_time+0,F
615 movlw .0
616 addwfc lastdive_time+1,F
617 addwfc lastdive_time+2,F
618 addwfc lastdive_time+3,F
619 banksel common
620 return
621
600 isr_battery_gauge: 622 isr_battery_gauge:
601 banksel isr_backup ; Bank0 ISR data 623 banksel isr_backup ; Bank0 ISR data
602 movlw current_sleepmode ; 100ľA/3600 -> nAs (Sleepmode current) 624 movlw current_sleepmode ; 100ľA/3600 -> nAs (Sleepmode current)
603 movwf isr1_temp ; Store value (low byte) 625 movwf isr1_temp ; Store value (low byte)
604 clrf isr2_temp ; High byte 626 clrf isr2_temp ; High byte