# HG changeset patch # User heinrichsweikamp # Date 1344691830 -7200 # Node ID bab5a9fc1b108d343e920fe922ffefed089c1935 # Parent 7743cf997648aa4859584095ff084414390a29de restore last used customview in dive- and surface-mode diff -r 7743cf997648 -r bab5a9fc1b10 code_part1/OSTC_code_asm_part1/customview.asm --- a/code_part1/OSTC_code_asm_part1/customview.asm Thu Aug 09 09:15:26 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/customview.asm Sat Aug 11 15:30:30 2012 +0200 @@ -190,10 +190,11 @@ bcf menu3_active ;=1: menu entry three in divemode menu is active ostc_debug 'X' ; Sends debug-information to screen if debugmode active + incf menupos3,F ; Number of customview to show +customview_toggle2: btfsc FLAG_apnoe_mode ; In Apnoe mode? bra customview_toggle_exit ; Yes, ignore custom view in divemode completely - incf menupos3,F ; Number of customview to show movlw d'10' ; Max number cpfsgt menupos3 ; Max reached? bra customview_mask ; No, show @@ -349,6 +350,7 @@ surfcustomview_toggle: incf menupos3,F ; Number of customview to show +surfcustomview_toggle2: movlw d'4' ; Max number cpfsgt menupos3 ; Max reached? bra surfcustomview_mask ; No, show diff -r 7743cf997648 -r bab5a9fc1b10 code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Thu Aug 09 09:15:26 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Sat Aug 11 15:30:30 2012 +0200 @@ -37,6 +37,11 @@ call PLED_active_gas_divemode ; Display gas, if required call PLED_temp_divemode ; Displays temperature +; Reload last customview + read_int_eeprom d'94' ; Read last selected customview dive mode into EEDATA + movff EEDATA,menupos3 ; Copy to menupos3 + call customview_toggle2 ; Show customview + btfsc FLAG_apnoe_mode bsf realdive ; Set Realdive flag in Apnoe mode @@ -1499,6 +1504,10 @@ movff temp2,EEDATA write_int_eeprom d'3' ; write byte stored in EEDATA +; Save dive mode custom view + movff menupos3,EEDATA ; Copy to EEDATA + write_int_eeprom d'94' ; Write last selected customview dive mode into EEPROM + GETCUSTOM15 .28 ; Logbook Offset -> lo, hi tstfsz lo ; lo=0? bra change_logbook_offset1 ; No, adjust offset @@ -1890,7 +1899,6 @@ call PLED_brightness_full bcf timeout_display - clrf menupos3 bcf menu3_active clrf divesecs clrf samplesecs diff -r 7743cf997648 -r bab5a9fc1b10 code_part1/OSTC_code_asm_part1/sleepmode.asm --- a/code_part1/OSTC_code_asm_part1/sleepmode.asm Thu Aug 09 09:15:26 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/sleepmode.asm Sat Aug 11 15:30:30 2012 +0200 @@ -35,6 +35,11 @@ sleeploop2: call PLED_DisplayOff ; display off call disable_rs232 ; disable UART module + +; Save surface mode custom view + movff menupos3,EEDATA ; Copy to EEDATA + write_int_eeprom d'93' ; Write last selected customview surface mode into EEPROM + clrf divemins+0 clrf divemins+1 bcf TRISB,6 diff -r 7743cf997648 -r bab5a9fc1b10 code_part1/OSTC_code_asm_part1/surfmode.asm --- a/code_part1/OSTC_code_asm_part1/surfmode.asm Thu Aug 09 09:15:26 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/surfmode.asm Sat Aug 11 15:30:30 2012 +0200 @@ -42,7 +42,10 @@ movff last_surfpressure_30min+0,int_I_pres_surface+0 ; copy surface air pressure to deco routine movff last_surfpressure_30min+1,int_I_pres_surface+1 ; 30min old values - clrf menupos3 ; Reset Custom views (Default: No custom view) +; Reload last customview + read_int_eeprom d'93' ; Read last selected customview surface mode into EEDATA + movff EEDATA,menupos3 ; Copy to menupos3 + call surfcustomview_toggle2 ; Show customview btfsc gauge_mode ; Ignore in gauge mode bra surfloop1 diff -r 7743cf997648 -r bab5a9fc1b10 docu/ostc_interface_description.odt Binary file docu/ostc_interface_description.odt has changed