comparison src/logbook.asm @ 496:a0247e9f71d0

show battery % in logbook (For dives made with 2.15 or newer)
author heinrichsweikamp
date Sun, 02 Apr 2017 21:14:01 +0200
parents 2b1239e6ea85
children 989917fe2d9f
comparison
equal deleted inserted replaced
495:2b1239e6ea85 496:a0247e9f71d0
1798 WIN_SMALL .110,.65 1798 WIN_SMALL .110,.65
1799 STRCAT "V:" 1799 STRCAT "V:"
1800 LOG_POINT_TO log_firmware 1800 LOG_POINT_TO log_firmware
1801 call ext_flash_byte_read_plus ; read firmware xx 1801 call ext_flash_byte_read_plus ; read firmware xx
1802 movff temp1,lo 1802 movff temp1,lo
1803 bsf neg_flag ; set flag for 2.15 or newer
1804 movlw .1
1805 cpfsgt lo ; >1?
1806 bcf neg_flag ; No, clear flag
1803 bsf leftbind 1807 bsf leftbind
1804 output_8 1808 output_8
1805 PUTC "." 1809 PUTC "."
1806 call ext_flash_byte_read_plus ; read firmware yy 1810 call ext_flash_byte_read_plus ; read firmware yy
1807 movff temp1,lo 1811 movff temp1,lo
1812 movlw .14
1813 cpfsgt lo ; >14?
1814 bcf neg_flag ; No, clear flag
1808 output_99x 1815 output_99x
1809 STRCAT_PRINT "" 1816 STRCAT_PRINT ""
1817
1818 btfss neg_flag ; set flag for 2.15 or newer
1819 bra logbook_no_batt_info
1820
1821 ; Battery percent (for dives with 2.15 or newer)
1822 WIN_SMALL .110,.140
1823 LOG_POINT_TO log_batt_info ; Battery percent
1824 call ext_flash_byte_read_plus ; read battery low
1825 movff temp1,lo
1826 output_8
1827 STRCAT_PRINT "%"
1828
1829 logbook_no_batt_info: ; dives with firmware <2.15
1810 1830
1811 ; Battery voltage 1831 ; Battery voltage
1812 WIN_SMALL .110,.90 1832 WIN_SMALL .110,.90
1813 STRCAT_PRINT "Batt:" 1833 STRCAT_PRINT "Batt:"
1814 WIN_SMALL .110,.115 1834 WIN_SMALL .110,.115
1817 movff temp1,lo 1837 movff temp1,lo
1818 call ext_flash_byte_read_plus ; read battery high 1838 call ext_flash_byte_read_plus ; read battery high
1819 movff temp1,hi 1839 movff temp1,hi
1820 output_16dp .2 1840 output_16dp .2
1821 STRCAT_PRINT "V" 1841 STRCAT_PRINT "V"
1822 1842
1823 ; surface pressure in mbar 1843 ; surface pressure in mbar
1824 LOG_POINT_TO log_surface_press 1844 LOG_POINT_TO log_surface_press
1825 call ext_flash_byte_read_plus ; read surface pressure 1845 call ext_flash_byte_read_plus ; read surface pressure
1826 movff temp1,lo 1846 movff temp1,lo
1827 call ext_flash_byte_read_plus ; read surface pressure 1847 call ext_flash_byte_read_plus ; read surface pressure
1828 movff temp1,hi 1848 movff temp1,hi
1829 WIN_SMALL .110,.140 1849 WIN_SMALL .110,.165
1830 lfsr FSR2,buffer 1850 lfsr FSR2,buffer
1831 bsf leftbind 1851 bsf leftbind
1832 output_16 ; Air pressure before dive 1852 output_16 ; Air pressure before dive
1833 STRCAT_TEXT tMBAR 1853 STRCAT_TEXT tMBAR
1834 clrf WREG 1854 clrf WREG