comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 235:ade0848c8b8b

New runtime asserts when compiled in DEBUG more. When __DEBUG is defined, the assert() calls are checked, and PLED_resetdebugger is called when the condition fails.
author JeanDo
date Sat, 19 Mar 2011 11:34:32 +0100
parents 85ea09d3b9d8
children 3ed240d60341
comparison
equal deleted inserted replaced
234:bb8940caebe1 235:ade0848c8b8b
281 movwf POSTINC2 281 movwf POSTINC2
282 282
283 STRCAT_PRINT " " 283 STRCAT_PRINT " "
284 return 284 return
285 285
286 286 ;=============================================================================
287 ; BlueScreen function.
288 ;
287 PLED_resetdebugger: 289 PLED_resetdebugger:
290 global PLED_resetdebugger
291 global temp10
292
293 movlb 1 ; For C-code calls
288 call PLED_boot ; PLED boot 294 call PLED_boot ; PLED boot
289 call PLED_ClearScreen ; clean up OLED 295 call PLED_ClearScreen ; clean up OLED
296
290 call PLED_standard_color 297 call PLED_standard_color
291 WIN_INVERT .0 ; Init new Wordprocessor 298 WIN_INVERT .0 ; Init new Wordprocessor
292 299
293 DISPLAYTEXT .133 300 DISPLAYTEXT .133
294 DISPLAYTEXT .134 301 DISPLAYTEXT .134
295 DISPLAYTEXT .135 302 DISPLAYTEXT .135
296 DISPLAYTEXT .136 ; Display Debug intro 303 DISPLAYTEXT .136 ; Display Debug intro
297 304
298 WIN_TOP .100 305 WIN_TOP .100
299 WIN_LEFT .10 306 WIN_LEFT .10
300 WIN_FONT FT_SMALL 307
301 WIN_INVERT .0 ; Init new Wordprocessor 308 lfsr FSR2,letter
302 call PLED_standard_color 309 movff temp10+0,lo ; Code-stack point at crash time.
303 lfsr FSR2,letter 310 movff temp10+1,hi ; Code-stack point at crash time.
304 movff temp10,lo 311 output_16
305 output_8
306 movlw ' ' 312 movlw ' '
307 movwf POSTINC2 313 movwf POSTINC2
308 movf debug_char+0,W 314 movf debug_char+0,W
309 movwf POSTINC2 315 movwf POSTINC2
310 movf debug_char+1,W 316 movf debug_char+1,W
324 movff flag2,lo 330 movff flag2,lo
325 output_8 331 output_8
326 call word_processor 332 call word_processor
327 333
328 WIN_TOP .125 334 WIN_TOP .125
329 WIN_LEFT .10
330 WIN_FONT FT_SMALL
331 WIN_INVERT .0 ; Init new Wordprocessor
332 call PLED_standard_color
333 335
334 lfsr FSR2,letter 336 lfsr FSR2,letter
335 movff flag3,lo 337 movff flag3,lo
336 output_8 338 output_8
337 PUTC ' ' 339 PUTC ' '
347 movff flag7,lo 349 movff flag7,lo
348 output_8 350 output_8
349 call word_processor 351 call word_processor
350 352
351 WIN_TOP .150 353 WIN_TOP .150
352 WIN_LEFT .10
353 WIN_FONT FT_SMALL
354 WIN_INVERT .0 ; Init new Wordprocessor
355 call PLED_standard_color
356 354
357 lfsr FSR2,letter 355 lfsr FSR2,letter
358 movff flag8,lo 356 movff flag8,lo
359 output_8 357 output_8
360 PUTC ' ' 358 PUTC ' '
371 output_8 369 output_8
372 call word_processor 370 call word_processor
373 371
374 bcf switch_left 372 bcf switch_left
375 PLED_resetdebugger_loop: 373 PLED_resetdebugger_loop:
374 bcf LED_blue ; Blink blue led every seconds..
375 btfss secs,0
376 bsf LED_blue
377
376 btfss switch_left 378 btfss switch_left
377 bra PLED_resetdebugger_loop ; Loop 379 bra PLED_resetdebugger_loop ; Loop
380
381 bcf LED_blue
382 bcf LED_red
378 return 383 return
379 384
380 PLED_divemode_mask: ; Displays mask in Dive-Mode 385 PLED_divemode_mask: ; Displays mask in Dive-Mode
381 call PLED_divemask_color ; Set Color for Divemode mask 386 call PLED_divemask_color ; Set Color for Divemode mask
382 DISPLAYTEXTH .267 ; Max. 387 DISPLAYTEXTH .267 ; Max.
2213 bcf leftbind 2218 bcf leftbind
2214 output_16dp d'3' 2219 output_16dp d'3'
2215 STRCAT_PRINT "m" 2220 STRCAT_PRINT "m"
2216 return 2221 return
2217 2222
2218 2223 ;=============================================================================
2219 PLED_serial: ; Writes OSTC #Serial and Firmware version in surfacemode 2224 ; Writes OSTC #Serial and Firmware version in surfacemode
2225 ;
2226 PLED_serial:
2220 ostc_debug 'a' ; Sends debug-information to screen if debugmode active 2227 ostc_debug 'a' ; Sends debug-information to screen if debugmode active
2221 WIN_TOP .0 2228 WIN_TOP .0
2222 WIN_LEFT .1 2229 WIN_LEFT .1
2223 WIN_FONT FT_SMALL 2230 WIN_FONT FT_SMALL
2224 WIN_INVERT .0 ; Init new Wordprocessor 2231 WIN_INVERT .0 ; Init new Wordprocessor
2225 call PLED_standard_color 2232
2226 2233 ifdef __DEBUG
2227 lfsr FSR2,letter 2234 movlw color_grey ; Write header in blue when
2228 OUTPUTTEXTH d'262' ; "OSTC " 2235 call PLED_set_color ; compiled in DEBUG mode...
2236 else
2237 call PLED_standard_color
2238 endif
2239
2240 lfsr FSR2,letter
2241 OUTPUTTEXTH d'262' ; "OSTC "
2229 clrf EEADRH 2242 clrf EEADRH
2230 clrf EEADR ; Get Serial number LOW 2243 clrf EEADR ; Get Serial number LOW
2231 call read_eeprom ; read byte 2244 call read_eeprom ; read byte
2232 movff EEDATA,lo 2245 movff EEDATA,lo
2233 incf EEADR,F ; Get Serial number HIGH 2246 incf EEADR,F ; Get Serial number HIGH
2234 call read_eeprom ; read byte 2247 call read_eeprom ; read byte
2235 movff EEDATA,hi 2248 movff EEDATA,hi
2236 2249
2237 bsf leftbind 2250 bsf leftbind
2238 output_16 2251 output_16
2239 STRCAT " \x90\x91 V" ; Scribble logo... 2252 STRCAT " \x90\x91 V" ; Scribble logo...
2240 movlw softwareversion_x 2253 movlw softwareversion_x
2241 movwf lo 2254 movwf lo
2242 bsf leftbind 2255 bsf leftbind
2243 output_8 2256 output_8
2244 PUTC '.' 2257 PUTC '.'
2245 movlw softwareversion_y 2258 movlw softwareversion_y
2246 movwf lo 2259 movwf lo
2247 bsf leftbind 2260 bsf leftbind
2248 output_99x 2261 output_99x
2249 bcf leftbind 2262 bcf leftbind
2250 call word_processor 2263
2251 2264 ifdef __DEBUG
2252 movlw softwareversion_beta ; =1: Beta, =0: Release 2265 STRCAT_PRINT "-Dbg"
2266 else
2267 call word_processor
2268
2269 movlw softwareversion_beta ; =1: Beta, =0: Release
2253 decfsz WREG,F 2270 decfsz WREG,F
2254 return ; Release version -> Return 2271 return ; Release version -> Return
2255 2272
2256 call PLED_warnings_color 2273 call PLED_warnings_color
2257 DISPLAYTEXT d'243' ; beta 2274 DISPLAYTEXT d'243' ; beta
2258 call PLED_standard_color 2275 call PLED_standard_color
2259 return 2276 endif
2277
2278 return
2279
2280 ;=============================================================================
2260 2281
2261 PLED_divemode_menu_mask_first: ; Write Divemode menu1 mask 2282 PLED_divemode_menu_mask_first: ; Write Divemode menu1 mask
2262 ostc_debug 'o' ; Sends debug-information to screen if debugmode active 2283 ostc_debug 'o' ; Sends debug-information to screen if debugmode active
2263 call PLED_menu_clear ; clear "Menu?" 2284 call PLED_menu_clear ; clear "Menu?"
2264 call PLED_standard_color 2285 call PLED_standard_color