# HG changeset patch # User heinrichsweikamp # Date 1292866216 -3600 # Node ID a2b9eca1f396729f1355568f49a7e593b1cf7872 # Parent 966ebf9055145f6347ccd3ad7b1ff2ea3601c2f5 customview for the surfacemode diff -r 966ebf905514 -r a2b9eca1f396 code_part1/OSTC_code_asm_part1/customview.asm --- a/code_part1/OSTC_code_asm_part1/customview.asm Sun Dec 19 20:54:08 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/customview.asm Mon Dec 20 18:30:16 2010 +0100 @@ -68,13 +68,8 @@ return customview_1sec_marker: ; Do nothing extra - return - customview_1sec_lead_tiss: ; Do nothing extra - return - -customview_1sec_clock: -; call PLED_diveclock2 +customview_1sec_clock: ; Do nothing extra return @@ -103,7 +98,6 @@ customview_minute_stopwatch: ; Do nothing extra return - customview_toggle: ; Yes, show next customview (and delete this flag) incf menupos3,F ; Number of customview to show movlw d'5' ; Max number+1 @@ -130,21 +124,81 @@ call PLED_stopwatch_show bra customview_toggle_exit -customview_init_marker: -; Init Marker - DISPLAYTEXT d'151' ; Set Marker? +customview_init_marker: ; Init Marker + DISPLAYTEXT d'151' ; Set Marker? bra customview_toggle_exit -customview_init_clock: -; Init Clock +customview_init_clock: ; Init Clock call PLED_diveclock bra customview_toggle_exit -customview_init_lead_tissue: -; Show leading tissue +customview_init_lead_tissue: ; Show leading tissue call PLED_show_leading_tissue bra customview_toggle_exit customview_toggle_exit: - bcf toggle_customview ; Clear flag - return \ No newline at end of file + bcf toggle_customview ; Clear flag + return + + + +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? + bra surfcustomview_mask ; No, show + clrf menupos3 ; Reset to zero (Zero=no custom view) +surfcustomview_mask: + call PLED_clear_customview_surfacemode + movff menupos3,temp1 ; Menupos3 holds number of customview function + dcfsnz temp1,F + bra surfcustomview_init_graphs ; Show the tissue graphs + dcfsnz temp1,F + bra surfcustomview_init_gaslist ; Show pre-dive gaslist/setpoint list +; bra surfcustomview_init_nocustomview ; menupos3=0 -> No Customview +surfcustomview_init_nocustomview: + bra surfcustomview_toggle_exit + +surfcustomview_init_graphs: + call PLED_tissue_saturation_graph ; Draw the graphs + bra surfcustomview_toggle_exit + +surfcustomview_init_gaslist: + call PLED_pre_dive_screen ; Show the Gaslist/Setpoint list + bra surfcustomview_toggle_exit + +surfcustomview_toggle_exit: + bcf toggle_customview ; Clear flag + + + + +surfcustomview_second: ; Do every-second tasks for the custom view area + movff menupos3,temp1 ; copy + dcfsnz temp1,F + bra surfcustomview_1sec_graphs ; Update the Graphs + dcfsnz temp1,F + bra surfcustomview_1sec_gaslist ; Update the Gaslist/SetPoint List + ; Menupos3=0, do nothing + return + +surfcustomview_1sec_graphs: ; Do nothing extra +surfcustomview_1sec_gaslist: ; Do nothing extra + return + + +surfcustomview_minute: ; Do every-minute tasks for the custom view area + movff menupos3,temp1 ; copy + dcfsnz temp1,F + bra surfcustomview_minute_graphs ; Update the Graphs + dcfsnz temp1,F + bra surfcustomview_minute_gaslist ; Update the Gaslist/SetPoint List + ; Menupos3=0, do nothing + return + +surfcustomview_minute_graphs: + call PLED_tissue_saturation_graph ; Draw/Update the graphs + return + +surfcustomview_minute_gaslist: ; Do nothing extra + return diff -r 966ebf905514 -r a2b9eca1f396 code_part1/OSTC_code_asm_part1/definitions.asm --- a/code_part1/OSTC_code_asm_part1/definitions.asm Sun Dec 19 20:54:08 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Mon Dec 20 18:30:16 2010 +0100 @@ -655,7 +655,7 @@ #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! -#DEFINE pre_dive_screen flag15,2 ;=1: Show predive screen instead of graphs +;unused flag15,2 ;=1: #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 diff -r 966ebf905514 -r a2b9eca1f396 code_part1/OSTC_code_asm_part1/divemode_menu.asm --- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm Sun Dec 19 20:54:08 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm Mon Dec 20 18:30:16 2010 +0100 @@ -59,7 +59,7 @@ btfsc premenu bra test_switches_divemode2_2 - bsf toggle_customview ; Toggle customview (Cleared in divemode.asm) + bsf toggle_customview ; Toggle customview (Cleared in customview.asm) btfsc standalone_simulator ; Standalone Simualtor active? bra divemode_menu_simulator ; Yes, Show simulator menu! diff -r 966ebf905514 -r a2b9eca1f396 code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Sun Dec 19 20:54:08 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Mon Dec 20 18:30:16 2010 +0100 @@ -405,6 +405,20 @@ call PLED_box return +PLED_clear_customview_surfacemode: + movlw .0 + movff WREG,box_temp+0 ; Data + movlw .25 + movff WREG,box_temp+1 ; row top (0-239) + movlw .121 + 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 + return + PLED_clear_decoarea: movlw .0 movff WREG,box_temp+0 ; Data @@ -2354,27 +2368,24 @@ WIN_INVERT .0 ; Init new Wordprocessor call PLED_standard_color - lfsr FSR2,letter + OUTPUTTEXTH d'262' ; "OSTC " + clrf EEADRH + clrf EEADR ; Get Serial number LOW + call read_eeprom ; read byte + movff EEDATA,lo + incf EEADR,F ; Get Serial number HIGH + call read_eeprom ; read byte + movff EEDATA,hi + + bsf leftbind + output_16 + movlw ' ' + movwf POSTINC2 movlw 0x85 ; New aa_font_28 5 grays HW logo. movwf POSTINC2 movlw 0x86 movwf POSTINC2 - movlw ' ' - movwf POSTINC2 - movwf POSTINC2 - - OUTPUTTEXTH d'262' ; "OSTC " - clrf EEADRH - clrf EEADR ; Get Serial number LOW - call read_eeprom ; read byte - movff EEDATA,lo - incf EEADR,F ; Get Serial number HIGH - call read_eeprom ; read byte - movff EEDATA,hi - - bsf leftbind - output_16 movlw ' ' movwf POSTINC2 movlw 'V' @@ -2390,7 +2401,6 @@ bsf leftbind output_99x bcf leftbind - call word_processor return diff -r 966ebf905514 -r a2b9eca1f396 code_part1/OSTC_code_asm_part1/surfmode.asm --- a/code_part1/OSTC_code_asm_part1/surfmode.asm Sun Dec 19 20:54:08 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/surfmode.asm Mon Dec 20 18:30:16 2010 +0100 @@ -52,11 +52,6 @@ call PLED_desaturation_time ; display desaturation time call PLED_nofly_time ; display nofly time - btfss pre_dive_screen ; Show predive screen - call PLED_tissue_saturation_graph ; no, display saturation graph - btfsc pre_dive_screen ; Show predive screen - call PLED_pre_dive_screen ; yes, display Pre-Dive Screen - call PLED_active_gas_surfmode ; Show start gas call PLED_display_decotype_surface ; Show deco mode (ZH-L16, const. ppO2 or Multi-GF) @@ -134,6 +129,7 @@ call set_leds_surfmode ; Sets Warning and No-Fly LEDs call check_customfunctions ; Checks CF functions and displays warning symbol if something critical is wrong call PLED_display_decotype_surface ; Show deco mode + call surfcustomview_second ; Do every-second tasks for the custom view area btfsc enter_error_sleep ; Enter Fatal Error Routine? call fatal_error_sleep ; Yes (In Sleepmode.asm!) bcf onesecupdate ; every second tasks done @@ -162,6 +158,10 @@ goto diveloop ; Yes, switch into Divemode! btfsc sleepmode ; Sleepmode active? goto sleeploop ; Yes, switch into sleepmode! + + btfsc toggle_customview ; Next view? + call surfcustomview_toggle ; Yes, show next customview (and delete this flag) + ; Check for the different UART flags btfsc dump_external_eeprom ; Start interface (dumps EEPROM BANK 0 + additional data)? goto menu_interface ; Yes! @@ -193,6 +193,7 @@ call check_temp_extrema ; check for new temperature extremas call PLED_custom_text ; Displays custom text call calc_surface_interval ; Increases Surface-Interval time + call surfcustomview_minute ; Do every-minute tasks for the custom view area btfsc gauge_mode ; Ignore in gauge mode bra update_surfloop60_2 @@ -206,11 +207,6 @@ btfsc premenu ; Not when "Menu?" is displayed! bra update_surfloop60_2 - btfss pre_dive_screen ; Show predive screen - call PLED_tissue_saturation_graph ; no, display saturation graph - btfsc pre_dive_screen ; Show predive screen - call PLED_pre_dive_screen ; yes, display Pre-Dive Screen - update_surfloop60_2: call nofly_timeout60 ; checks if nofly time is > 0 bcf oneminupdate @@ -408,11 +404,6 @@ btfsc FLAG_apnoe_mode bra timeout_premenu2 ; Skip in Apnoe mode - btfss pre_dive_screen ; Show predive screen - call PLED_tissue_saturation_graph ; no, display saturation graph - btfsc pre_dive_screen ; Show predive screen - call PLED_pre_dive_screen ; yes, display Pre-Dive Screen - timeout_premenu2: call update_surf_press ; rewrite serial number call PLED_serial ; rewrite serial number @@ -454,13 +445,7 @@ return test_switches_surfmode4: - btg pre_dive_screen - - btfss pre_dive_screen ; Show predive screen - call PLED_tissue_saturation_graph ; no, display saturation graph - btfsc pre_dive_screen ; Show predive screen - call PLED_pre_dive_screen ; yes, display Pre-Dive Screen - + bsf toggle_customview ; Toggle customview (Cleared in customview.asm) return timeout_surfmode: