# HG changeset patch # User heinrichsweikamp # Date 1302422084 -7200 # Node ID d8dfbc7041b0d9e310ecf52585a5315c0e0198fc # Parent 1efd59d689f81b7d3e0e47f31f72fea75c8428eb added CPU time debugger diff -r 1efd59d689f8 -r d8dfbc7041b0 code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Sun Apr 10 09:17:20 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Sun Apr 10 09:54:44 2011 +0200 @@ -26,6 +26,10 @@ diveloop: call diveloop_boot ; Boot tasks for all modes +; start timer3 for deco routine CPU usesage monitor + movlw b'00000011' + movwf T3CON ; Timer3 with 32768Hz clock running + ; Startup Tasks for all modes ostc_debug 'R' ; Sends debug-information to screen if debugmode active call PLED_ClearScreen ; clean up OLED @@ -440,14 +444,47 @@ ostc_debug 'B' ; Sends debug-information to screen if debugmode active call divemode_prepare_flags_for_deco - movlw d'0' movff WREG,char_I_step_is_1min ; 2 second deco mode + clrf TMR3L + clrf TMR3H ; Reset Timer3 + call deco_calc_hauptroutine ; calc_tissue movlb b'00000001' ; rambank 1 selected ostc_debug 'C' ; Sends debug-information to screen if debugmode active + btfss debug_mode ; Are we in debugmode? + bra calc_deko_divemode4 ; No... + +; Show timer3 reading converted into ms (Error: +2,3%) in custom area + movff TMR3L,lo + movff TMR3H,hi + bcf STATUS,C + rrcf hi + rrcf lo ;/2 + bcf STATUS,C + rrcf hi + rrcf lo ;/4 + bcf STATUS,C + rrcf hi + rrcf lo ;/8 + bcf STATUS,C + rrcf hi + rrcf lo ;/16 + bcf STATUS,C + rrcf hi + rrcf lo ;/32 + + WIN_TOP .216 + WIN_LEFT .100 + WIN_FONT FT_SMALL + STRCPY "ms:" + output_16 + call word_processor + +calc_deko_divemode4: + movff char_O_first_deco_depth,wait_temp ; copy ceiling to temp register tstfsz wait_temp ; Ceiling<0m? bra calc_deko_divemode3 ; Yes! diff -r 1efd59d689f8 -r d8dfbc7041b0 code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Sun Apr 10 09:17:20 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Sun Apr 10 09:54:44 2011 +0200 @@ -261,7 +261,7 @@ btfss debug_mode ; Are we in debugmode? return ; No, return! - WIN_TOP .200 + WIN_TOP .192 WIN_LEFT .100 WIN_FONT FT_SMALL WIN_INVERT .0 ; Init new Wordprocessor