comparison src/sleepmode.asm @ 133:939f1e83c4c2

BUGFIX: Surface interval was not displayed correctly in some cases NEW: Store tissue load, date and time, surface interval, desat. time and nofly time every hour and reload them after battery change
author heinrichsweikamp
date Mon, 14 Jul 2014 15:17:07 +0200
parents d076e9c02438
children 4574aed5cd4c
comparison
equal deleted inserted replaced
132:ec0b1e829399 133:939f1e83c4c2
23 #include "external_flash.inc" 23 #include "external_flash.inc"
24 #include "ghostwriter.inc" 24 #include "ghostwriter.inc"
25 #include "i2c.inc" 25 #include "i2c.inc"
26 #include "mcp.inc" 26 #include "mcp.inc"
27 27
28
29 extern vault_decodata_into_eeprom
30
28 gui CODE 31 gui CODE
29 32
30 global sleeploop 33 global sleeploop
31 sleeploop: ; enter sleepmode! 34 sleeploop: ; enter sleepmode!
32 call disable_ir ; IR off 35 call disable_ir ; IR off
35 bcf LEDr 38 bcf LEDr
36 movff menupos3,customview_surfmode; save last customview 39 movff menupos3,customview_surfmode; save last customview
37 call TFT_Display_FadeOut 40 call TFT_Display_FadeOut
38 call TFT_DisplayOff ; display off 41 call TFT_DisplayOff ; display off
39 call disable_rs232 ; USB off 42 call disable_rs232 ; USB off
43 call vault_decodata_into_eeprom ; store deco data
40 call I2C_sleep_accelerometer 44 call I2C_sleep_accelerometer
41 call I2C_sleep_compass 45 call I2C_sleep_compass
42 call ext_flash_enable_protection ; enable write protection for external flash 46 call ext_flash_enable_protection ; enable write protection for external flash
43 call update_battery_registers ; update battery registers into EEPROM 47 call update_battery_registers ; update battery registers into EEPROM
44 clrf divemins+0 48 clrf divemins+0
48 bcf enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump) 52 bcf enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (Screen dump)
49 clrf ADCON0 ; Power-Down ADC Module 53 clrf ADCON0 ; Power-Down ADC Module
50 sleeploop_loop: 54 sleeploop_loop:
51 btfsc onehourupdate ; one hour in sleep? 55 btfsc onehourupdate ; one hour in sleep?
52 call update_battery_registers;update battery registers into EEPROM 56 call update_battery_registers;update battery registers into EEPROM
57 btfsc onehourupdate ; one hour in sleep?
58 call vault_decodata_into_eeprom ; update deco data
53 59
54 btfsc oneminupdate ; one minute in sleep? 60 btfsc oneminupdate ; one minute in sleep?
55 rcall onemin_sleep ; do oneminute tasks, e.g. calculate desaturation 61 rcall onemin_sleep ; do oneminute tasks, e.g. calculate desaturation
56 62
57 btfsc onesecupdate ; one second in sleep? 63 btfsc onesecupdate ; one second in sleep?