# HG changeset patch # User heinrichsweikamp # Date 1293007044 -3600 # Node ID ed7826c740a0bee80730d7557545af2108420708 # Parent 8aa8acada0fd3ac8b7c8c7b98689e4010fe5ebae 1.74beta rc1 diff -r 8aa8acada0fd -r ed7826c740a0 code_part1/OSTC_code_asm_part1/changelog.txt --- a/code_part1/OSTC_code_asm_part1/changelog.txt Wed Dec 22 03:23:55 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/changelog.txt Wed Dec 22 09:37:24 2010 +0100 @@ -1,8 +1,11 @@ New in 1.74 Beta: BETA Version - Do NOT use for diving! NEW: Added END (Equivalent narcotic depth) for GasSetup -CHANGE: Limits for several Custom Functions +CHANGE: Limits for several Custom Functions (OSTC MK.2 only) BUGFIX: Realtime Simulator menu +NEW: Customview for Surfacemode (OSTC MK.2 only) +NEW: Icon for Tank mix on Surface screen (OSTC MK.2 only) +BUGFIX: Stopwatch Reset New in 1.73 Beta: BETA Version - Do NOT use for diving! diff -r 8aa8acada0fd -r ed7826c740a0 code_part1/OSTC_code_asm_part1/customview.asm --- a/code_part1/OSTC_code_asm_part1/customview.asm Wed Dec 22 03:23:55 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/customview.asm Wed Dec 22 09:37:24 2010 +0100 @@ -100,8 +100,8 @@ customview_toggle: ; Yes, show next customview (and delete this flag) incf menupos3,F ; Number of customview to show - movlw d'5' ; Max number+1 - cpfseq menupos3 ; Max reached? + movlw d'4' ; Max number + cpfsgt menupos3 ; Max reached? bra customview_mask ; No, show clrf menupos3 ; Reset to zero (Zero=no custom view) customview_mask: @@ -144,8 +144,8 @@ surfcustomview_toggle: ; Yes, show next customview (and delete this flag) incf menupos3,F ; Number of customview to show - movlw d'3' ; Max number+1 - cpfseq menupos3 ; Max reached? + movlw d'4' ; Max number + cpfsgt menupos3 ; Max reached? bra surfcustomview_mask ; No, show clrf menupos3 ; Reset to zero (Zero=no custom view) surfcustomview_mask: @@ -155,6 +155,10 @@ bra surfcustomview_init_graphs ; Show the tissue graphs dcfsnz temp1,F bra surfcustomview_init_gaslist ; Show pre-dive gaslist/setpoint list + dcfsnz temp1,F + bra surfcustomview_init_interval ; Show the interval counter + dcfsnz temp1,F + bra surfcustomview_init_cfview ; Show the interval counter ; bra surfcustomview_init_nocustomview ; menupos3=0 -> No Customview surfcustomview_init_nocustomview: bra surfcustomview_toggle_exit @@ -167,6 +171,30 @@ call PLED_pre_dive_screen ; Show the Gaslist/Setpoint list bra surfcustomview_toggle_exit +surfcustomview_init_interval: + DISPLAYTEXT d'189' ; Surface + DISPLAYTEXT d'240' ; Interval: + call PLED_interval ; Display the interval + bra surfcustomview_toggle_exit + +surfcustomview_init_cfview: + read_int_eeprom d'34' ; Get Decomode + incf EEDATA,W ; +1 -> WREG + movwf temp10 + dcfsnz temp10,F + call PLED_show_cf11_cf12_cf29 ; =0 (ZH-L16 OC) + dcfsnz temp10,F + bra surfcustomview_toggle_exit ; =1 (Gauge) + dcfsnz temp10,F + call PLED_show_cf11_cf12_cf29 ; =2 (ZH-L16 CC) + dcfsnz temp10,F + bra surfcustomview_toggle_exit ; =3 (Apnoe) + dcfsnz temp10,F + call PLED_show_cf32_cf33_cf29 ; =4 (L16-GF OC) + dcfsnz temp10,F + call PLED_show_cf32_cf33_cf29 ; =5 (L16-GF CC) + bra surfcustomview_toggle_exit + surfcustomview_toggle_exit: bcf toggle_customview ; Clear flag @@ -179,11 +207,16 @@ bra surfcustomview_1sec_graphs ; Update the Graphs dcfsnz temp1,F bra surfcustomview_1sec_gaslist ; Update the Gaslist/SetPoint List + dcfsnz temp1,F + bra surfcustomview_1sec_interval ; Update the Interval display + dcfsnz temp1,F + bra surfcustomview_1sec_cfview ; Update the critical cf view ; Menupos3=0, do nothing return - +surfcustomview_1sec_cfview: ; Do nothing extra surfcustomview_1sec_graphs: ; Do nothing extra -surfcustomview_1sec_gaslist: ; Do nothing extra +surfcustomview_1sec_gaslist: ; Do nothing extra +surfcustomview_1sec_interval: ; Do nothing extra return @@ -193,6 +226,10 @@ bra surfcustomview_minute_graphs ; Update the Graphs dcfsnz temp1,F bra surfcustomview_minute_gaslist ; Update the Gaslist/SetPoint List + dcfsnz temp1,F + bra surfcustomview_minute_interval ; Update the Interval display + dcfsnz temp1,F + bra surfcustomview_minute_cfview ; Update the critical cf view ; Menupos3=0, do nothing return @@ -200,5 +237,10 @@ call PLED_tissue_saturation_graph ; Draw/Update the graphs return +surfcustomview_minute_interval: + call PLED_interval ; Display the interval + return + surfcustomview_minute_gaslist: ; Do nothing extra - return +surfcustomview_minute_cfview: ; Do nothing extra + return \ No newline at end of file diff -r 8aa8acada0fd -r ed7826c740a0 code_part1/OSTC_code_asm_part1/definitions.asm --- a/code_part1/OSTC_code_asm_part1/definitions.asm Wed Dec 22 03:23:55 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Wed Dec 22 09:37:24 2010 +0100 @@ -645,7 +645,7 @@ #DEFINE toggle_customview flag13,7 ;=1: Next customview #DEFINE enter_error_sleep flag14,0 ;=1: Sleep immediately displaying the error using LED codes -#DEFINE stopwatch_active flag14,1 ;=1: Show Stopwatch in Divemode +;unused flag14,1 ;=1: #DEFINE is_bailout flag14,2 ;=1: CC mode, but bailout active! #DEFINE standalone_simulator flag14,3 ;=1: Standalone Simulator active #DEFINE display_set_simulator flag14,4 ;=1: Show Divemode simulator menu @@ -655,10 +655,10 @@ #DEFINE restore_deco_data flag15,0 ;=1: Restore Decodata after the dive from 0x380 buffer #DEFINE uart_store_tissue_data flag15,1 ;=1: Store tissue data for next simualted dive! -;unused flag15,2 ;=1: +#DEFINE reset_average_depth flag15,2 ;=1: Average Depth will be resetted #DEFINE blinking_better_gas flag15,3 ;=1: Gas is currently blinking #DEFINE menu3_active flag15,4 ;=1: menu entry three in divemode menu is active -#DEFINE lock_stopwatch_reset flag15,5 ;=1: Locks the Reset of the Stopwtach/Average depth for 1 second +;unused flag15,5 ;=1: #DEFINE maxdepth_greater_100m flag15,6 ;=1: Max Depth greater>100m -#DEFINE show_interval flag15,7 ;=1: Show Interval, =0: Show Clock in Surfacemode +;unused flag15,7 ;=1: diff -r 8aa8acada0fd -r ed7826c740a0 code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Wed Dec 22 03:23:55 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Wed Dec 22 09:37:24 2010 +0100 @@ -1471,7 +1471,9 @@ return calc_average_depth: - bcf lock_stopwatch_reset ; Un-Lock the stopwatch reset option + btfsc reset_average_depth ; Reset the Avewrage depth? + rcall reset_average1 ; Reset the resettable average depth + ; 1. Add new 2xdepth to the Sum of depths registers movff rel_pressure+0,b0_lo movff rel_pressure+1,b0_hi @@ -1506,6 +1508,16 @@ movff xC+1,avr_rel_pressure+1 return +reset_average1: + clrf average_depth_hold+0 + clrf average_depth_hold+1 + clrf average_depth_hold+2 + clrf average_depth_hold+3 ; Clear average depth register + movlw d'2' + movwf average_divesecs+0 + clrf average_divesecs+1 + bcf reset_average_depth ; Clear flag + return diveloop_boot: ostc_debug 'Q' ; Sends debug-information to screen if debugmode active @@ -1521,14 +1533,6 @@ cpfsgt EEDATA call PLED_brightness_full - clrf average_depth_hold+0 - clrf average_depth_hold+1 - clrf average_depth_hold+2 - clrf average_depth_hold+3 ; Clear average depth register - movlw d'2' - movwf average_divesecs+0 - clrf average_divesecs+1 - movlw d'1' movwf apnoe_max_pressure+0 clrf apnoe_max_pressure+1 @@ -1547,7 +1551,7 @@ clrf timeout_counter2 ; Here: counts to six, then store deco data and temperature clrf AlarmType ; Clear all alarms bcf event_occured ; clear flag - bcf lock_stopwatch_reset ; clear flag + rcall reset_average1 ; Reset the resettable average depth bcf depth_greater_100m ; clear flag setf last_diluent ; to be displayed after first calculation (range: 0 to 100 [%]) bcf dekostop_active @@ -1583,13 +1587,13 @@ clrf POSTINC0 clrf POSTINC0 -; Start with active Stopwatch? - bsf stopwatch_active - GETCUSTOM8 d'41' ; =1: Start with active Stopwatch - movwf lo - movlw d'1' - cpfseq lo ; CF41=1? - bcf stopwatch_active ; No! +;; Start with active Stopwatch? +; bsf stopwatch_active +; GETCUSTOM8 d'41' ; =1: Start with active Stopwatch +; movwf lo +; movlw d'1' +; cpfseq lo ; CF41=1? +; bcf stopwatch_active ; No! ; Init profile recording parameters GETCUSTOM8 d'20' ; sample rate diff -r 8aa8acada0fd -r ed7826c740a0 code_part1/OSTC_code_asm_part1/divemode_menu.asm --- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm Wed Dec 22 03:23:55 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm Wed Dec 22 09:37:24 2010 +0100 @@ -87,20 +87,6 @@ bcf switch_left ; Left button pressed! return -reset_stopwatch: - btfsc lock_stopwatch_reset ; Reset locked? - return ; Yes, do not reset (now)... -; Maker Set, also reset average Depth.... - clrf average_depth_hold+0 - clrf average_depth_hold+1 - clrf average_depth_hold+2 - clrf average_depth_hold+3 ; Clear average depth register - movlw d'2' - movwf average_divesecs+0 - clrf average_divesecs+1 - call calc_average_depth - return - test_switches_divemode_menu: btfsc switch_left bra test_switches_divemode_menu3 @@ -197,23 +183,7 @@ bra timeout_divemenu2 ; quit menu! toggle_stopwatch: - btg stopwatch_active ; Toggle Flag - - btfss stopwatch_active ; Show Stopwatch? - bra toggle_stopwatch2 ; No, remove outputs - - clrf average_depth_hold+0 - clrf average_depth_hold+1 - clrf average_depth_hold+2 - clrf average_depth_hold+3 ; Clear average depth register - movlw d'3' - movwf average_divesecs+0 - clrf average_divesecs+1 - call calc_average_depth - bra timeout_divemenu2 ; quit menu! - -toggle_stopwatch2: - call PLED_clear_customview_divemode ; Remove Stopwatch Outputs + bsf reset_average_depth ; Average Depth will be resetted in divemode.asm bra timeout_divemenu2 ; quit menu! divemode_toggle_brightness: @@ -681,7 +651,6 @@ bcf display_set_simulator bcf switch_left ; and debounce switches bcf switch_right - bsf lock_stopwatch_reset ; Lock the stopwatch reset for at least one second (Cleared in "calc_average_depth:") return timeout_divemenu3: diff -r 8aa8acada0fd -r ed7826c740a0 code_part1/OSTC_code_asm_part1/isr.asm --- a/code_part1/OSTC_code_asm_part1/isr.asm Wed Dec 22 03:23:55 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/isr.asm Wed Dec 22 09:37:24 2010 +0100 @@ -305,9 +305,9 @@ bsf store_sample ; ...and set bit for profile storage RTCisr1: ; Increase re-setable average depth divetime counter - incf average_divesecs+0,F ; increase divetime registers + incf average_divesecs+0,F ; increase stopwatch registers btfsc STATUS,Z - incf average_divesecs+1,F ; increase divetime registers + incf average_divesecs+1,F ; increase stopwatch registers btfss divemode2 ; displayed divetime is running? bra RTCisr2 ; No (e.g. too shallow) diff -r 8aa8acada0fd -r ed7826c740a0 code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Wed Dec 22 03:23:55 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Wed Dec 22 09:37:24 2010 +0100 @@ -680,89 +680,12 @@ PLED_clock: ostc_debug 'c' - - ;If > 0 display surface_interval:2 and clock changing every 5 seconds - ;use timeout_counter for this WIN_TOP .50 WIN_LEFT .1 WIN_FONT FT_SMALL WIN_INVERT .0 ; Init new Wordprocessor call PLED_standard_color - lfsr FSR2,letter - - movff surface_interval+0,lo - tstfsz lo - bra PLED_clock0 ; Not Zero, switch between Interval and clock - movff surface_interval+1,lo - tstfsz lo - bra PLED_clock0 ; Not Zero, switch between Interval and clock - bra PLED_clock3 ; surface_interval=0, always display clock! - -PLED_clock0: - btfss show_interval ; Show Interval? - bra PLED_clock2 ; No, display clock and reset counter - -PLED_clock1: - decfsz timeout_counter,F ; =0? - bra PLED_clock1a ; No... - bra PLED_clock3 ; Yes, display clock and reset counter - -PLED_clock1a: - bsf show_interval - movlw d'6' - cpfslt timeout_counter ; f < w? -> timeout_counter>5? - rcall PLED_clock_reload_timer ; No, reload counter - - movff surface_interval+0,lo - movff surface_interval+1,hi - call convert_time ; lo=mins, hi=hours - - movf hi,W - movff lo,hi - movwf lo ; exchange lo and hi - - movlw 'I' - movwf POSTINC2 - movlw 'n' - movwf POSTINC2 - movlw 't' - movwf POSTINC2 - movlw ':' - movwf POSTINC2 - output_99x - movlw ':' - movwf POSTINC2 - movff hi,lo - output_99x - movlw ' ' - movwf POSTINC2 - call word_processor - return - -PLED_clock_reload_timer: - bcf show_interval - movlw d'5' - movwf timeout_counter - return - -PLED_interval_reload_timer: - bsf show_interval - movlw d'5' - movwf timeout_counter - return - -PLED_clock2: - decfsz timeout_counter,F ; =0? - bra PLED_clock3 ; No... - bra PLED_clock1a ; Yes, display interval and reset counter - -PLED_clock3: - bcf show_interval - movlw d'6' - cpfslt timeout_counter ; f < w? -> timeout_counter>5? - rcall PLED_interval_reload_timer; No, reload counter - movff hours,lo output_99x movlw ':' @@ -778,6 +701,153 @@ call word_processor return +PLED_interval: + WIN_TOP .75 + WIN_LEFT .90 + WIN_FONT FT_SMALL + WIN_INVERT .0 ; Init new Wordprocessor + call PLED_standard_color + lfsr FSR2,letter + + movff surface_interval+0,lo + movff surface_interval+1,hi + call convert_time ; lo=mins, hi=hours + + movf hi,W + movff lo,hi + movwf lo ; exchange lo and hi + output_99x + movlw ':' + movwf POSTINC2 + movff hi,lo + output_99x + movlw ' ' + movwf POSTINC2 + call word_processor + return + + +PLED_show_cf11_cf12_cf29:; Display saturations/desaturation multiplier and last deco in the customview field + WIN_TOP .25 + WIN_LEFT .90 + WIN_FONT FT_SMALL + WIN_INVERT .0 ; Init new Wordprocessor + call PLED_standard_color + lfsr FSR2,letter + GETCUSTOM8 d'11' + movwf lo + movlw 'C' + movwf POSTINC2 + movlw 'F' + movwf POSTINC2 + movlw '1' + movwf POSTINC2 + movlw '1' + movwf POSTINC2 + movlw ':' + movwf POSTINC2 + bsf leftbind + output_8 + movlw '%' + movwf POSTINC2 + call word_processor + + WIN_TOP .50 + lfsr FSR2,letter + GETCUSTOM8 d'12' + movwf lo + movlw 'C' + movwf POSTINC2 + movlw 'F' + movwf POSTINC2 + movlw '1' + movwf POSTINC2 + movlw '2' + movwf POSTINC2 + movlw ':' + movwf POSTINC2 + bsf leftbind + output_8 + movlw '%' + movwf POSTINC2 + call word_processor + +PLED_show_cf11_cf12_cf29_2: + WIN_TOP .75 + lfsr FSR2,letter + GETCUSTOM8 d'29' + movwf lo + movlw 'C' + movwf POSTINC2 + movlw 'F' + movwf POSTINC2 + movlw '2' + movwf POSTINC2 + movlw '9' + movwf POSTINC2 + movlw ':' + movwf POSTINC2 + bsf leftbind + output_8 + movlw 'm' + movwf POSTINC2 + call word_processor + bcf leftbind + return + + +PLED_show_cf32_cf33_cf29:; Display GF_LOW, GF_HIGH and last deco in the customview field + WIN_TOP .25 + WIN_LEFT .90 + WIN_FONT FT_SMALL + WIN_INVERT .0 ; Init new Wordprocessor + call PLED_standard_color + lfsr FSR2,letter + GETCUSTOM8 d'32' + movwf lo + movlw 'G' + movwf POSTINC2 + movlw 'F' + movwf POSTINC2 + movlw '_' + movwf POSTINC2 + movlw 'l' + movwf POSTINC2 + movlw 'o' + movwf POSTINC2 + movlw ':' + movwf POSTINC2 + bsf leftbind + output_8 + movlw '%' + movwf POSTINC2 + call word_processor + + WIN_TOP .50 + lfsr FSR2,letter + GETCUSTOM8 d'33' + movwf lo + movlw 'G' + movwf POSTINC2 + movlw 'F' + movwf POSTINC2 + movlw '_' + movwf POSTINC2 + movlw 'h' + movwf POSTINC2 + movlw 'i' + movwf POSTINC2 + movlw ':' + movwf POSTINC2 + bsf leftbind + output_8 + movlw '%' + movwf POSTINC2 + call word_processor + + bra PLED_show_cf11_cf12_cf29_2 ; Display CF29 in the third row and RETURN + + PLED_logbook_cursor: PLED_menu_cursor: @@ -1232,17 +1302,17 @@ return PLED_pre_dive_screen: ;Display Pre-Dive Screen - movlw .0 - movff WREG,box_temp+0 ; Data - movlw .25 - movff WREG,box_temp+1 ; row top (0-239) - movlw .120 - movff WREG,box_temp+2 ; row bottom (0-239) - movlw .82 - movff WREG,box_temp+3 ; column left (0-159) - movlw .159 - movff WREG,box_temp+4 ; column right (0-159) - call PLED_box +; movlw .0 +; movff WREG,box_temp+0 ; Data +; movlw .25 +; movff WREG,box_temp+1 ; row top (0-239) +; movlw .120 +; movff WREG,box_temp+2 ; row bottom (0-239) +; movlw .82 +; movff WREG,box_temp+3 ; column left (0-159) +; movlw .159 +; movff WREG,box_temp+4 ; column right (0-159) +; call PLED_box ; List active gases/Setpoints @@ -2911,23 +2981,23 @@ call PLED_standard_color return -PLED_saturation_graph_divemode: - ostc_debug 'h' ; Sends debug-information to screen if debugmode active +;PLED_saturation_graph_divemode: +; ostc_debug 'h' ; Sends debug-information to screen if debugmode active PLED_tissue_saturation_graph: ostc_debug 'i' ; Sends debug-information to screen if debugmode active -; Clear graph area... - movlw .0 - movff WREG,box_temp+0 ; Data - movlw .25 - movff WREG,box_temp+1 ; row top (0-239) - movlw .120 - movff WREG,box_temp+2 ; row bottom (0-239) - movlw .82 - movff WREG,box_temp+3 ; column left (0-159) - movlw .159 - movff WREG,box_temp+4 ; column right (0-159) - call PLED_box +;; Clear graph area... +; movlw .0 +; movff WREG,box_temp+0 ; Data +; movlw .25 +; movff WREG,box_temp+1 ; row top (0-239) +; movlw .120 +; movff WREG,box_temp+2 ; row bottom (0-239) +; movlw .82 +; movff WREG,box_temp+3 ; column left (0-159) +; movlw .159 +; movff WREG,box_temp+4 ; column right (0-159) +; call PLED_box ; Draw Frame GETCUSTOM8 d'35' ; Standard output color diff -r 8aa8acada0fd -r ed7826c740a0 code_part1/OSTC_code_asm_part1/text_table.asm --- a/code_part1/OSTC_code_asm_part1/text_table.asm Wed Dec 22 03:23:55 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/text_table.asm Wed Dec 22 09:37:24 2010 +0100 @@ -73,7 +73,7 @@ DB .16,.16,.16,.16 DB .16,.16,.16,.16 ; 32 Custom funtion descriptors with length 16 - DB .20,.14,.14,.14,.8,.8 ;t186;t187;t188;t189;t190;t191 + DB .20,.14,.14,.8,.8,.8 ;t186;t187;t188;t189;t190;t191 DB .6,.20,.20,.20,.20,.20 ;t192;t193;t194;t195;t196;t197 DB .20,.20,.20,.20,.20,.20 ;t198......t203 DB .20,.20,.20,.20,.20,.20 ;t204......t209 @@ -82,7 +82,7 @@ DB .20,.20,.20,.20,.20,.20 ;t222......t227 DB .20,.20,.20,.20,.20,.20 ;t228......t233 DB .20,.20,.10,.10,.10,.8 ;t234;t235;t236;t237;t238;t239 - DB .8,.8,.8,.14,.6,.20 ;t240;t241;t242;t243;t244;t245 + DB .10,.8,.8,.14,.6,.20 ;t240;t241;t242;t243;t244;t245 DB .16,.10,.16,.12,.6,.6 ;t246;t247;t248;t249;t250;t251 DB .6,.6,.6,.6 ;t252;t253;t254;t255 @@ -294,7 +294,7 @@ DB .13,.2 ;186 DB .20,.95 ;187 DB .0,.2 ;188 - DB .2,.48 ;189 + DB .90,.25 ;189 Surface (Interval) DB .0,.0 ;190 DB .0,.0 ;191 DB .0,.0 ;192 @@ -352,7 +352,7 @@ DB .2,.12 ;237 DB .100,.0 ;238 SetPoint DB .100,.0 ;239 No Deco (non-GF) - DB .100,.0 ;240 + DB .90,.50 ;240 (Surface) Interval: DB .100,.75 ;241 Display (Divemode Menu) DB .100,.0 ;242 No Deco (GF) DB .2,.12 ;243 @@ -605,7 +605,7 @@ DA "Custom Functions II}" ;186 l=20 DA "Show License}}" ;187 l=14 DA "Sim. Results:}" ;188 l=14 - DA "NOT USED!!!!!}" ;189 l=14 + DA "Surface}" ;189 l=8 DA "ppO2 +}}" ;190 l=8 DA "ppO2 -}}" ;191 l=8 DA "Dil.}}" ;192 l=6 @@ -663,7 +663,7 @@ DA "Not found}" ;237 l=10 DA "SetPoint}}" ;238 l=10 DA "No Deco}" ;239 l=8 - DA "unused }" ;240 l=8 + DA "Interval:}" ;240 l=10 DA "Display}" ;241 l=8 DA "No deco}" ;242 l=8 DA "Search module}" ;243 l=14