comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 603:530a5c994ca2

remove safety stop when <3m
author heinrichsweikamp
date Mon, 02 Jul 2012 10:40:06 +0200
parents 76b85952b9cd
children ec2cfd4b748b
comparison
equal deleted inserted replaced
602:d176f47b24f1 603:530a5c994ca2
393 movff hi,sub_a+1 393 movff hi,sub_a+1
394 movlw LOW safety_stop_reset 394 movlw LOW safety_stop_reset
395 movwf sub_b+0 395 movwf sub_b+0
396 movlw HIGH safety_stop_reset 396 movlw HIGH safety_stop_reset
397 movwf sub_b+1 397 movwf sub_b+1
398 call sub16 ; sub_c = sub_a - sub_b 398 call subU16 ; sub_c = sub_a - sub_b
399 btfss neg_flag 399 btfss neg_flag
400 bra reset_safety_stop ; Below 10m, reset safety stop 400 bra reset_safety_stop ; Below 10m, reset safety stop
401 401
402 ; Above "safety_stop_end"? Clear flag. 402 ; Above "safety_stop_end"? Clear flag.
403 SAFE_2BYTE_COPY rel_pressure, lo 403 SAFE_2BYTE_COPY rel_pressure, lo
406 movff hi,sub_a+1 406 movff hi,sub_a+1
407 movlw LOW safety_stop_end 407 movlw LOW safety_stop_end
408 movwf sub_b+0 408 movwf sub_b+0
409 movlw HIGH safety_stop_end 409 movlw HIGH safety_stop_end
410 movwf sub_b+1 410 movwf sub_b+1
411 call sub16 ; sub_c = sub_a - sub_b 411 call subU16 ; sub_c = sub_a - sub_b
412 btfsc neg_flag 412 btfsc neg_flag
413 bra delete_safety_stop ; Above 3m, remove safety stop 413 bra delete_safety_stop ; Above 3m, remove safety stop
414 414
415 ; Above "safety_stop_start"? Activate safety stop 415 ; Above "safety_stop_start"? Activate safety stop
416 SAFE_2BYTE_COPY rel_pressure, lo 416 SAFE_2BYTE_COPY rel_pressure, lo
419 movff hi,sub_a+1 419 movff hi,sub_a+1
420 movlw LOW safety_stop_start 420 movlw LOW safety_stop_start
421 movwf sub_b+0 421 movwf sub_b+0
422 movlw HIGH safety_stop_start 422 movlw HIGH safety_stop_start
423 movwf sub_b+1 423 movwf sub_b+1
424 call sub16 ; sub_c = sub_a - sub_b 424 call subU16 ; sub_c = sub_a - sub_b
425 btfsc neg_flag 425 btfsc neg_flag
426 bra acivate_safety_stop ; Above 5m, activate safety stop 426 bra acivate_safety_stop ; Above 5m, activate safety stop
427 427
428 bra reset_safety_stop2 ; Pause safety stop 428 bra reset_safety_stop2 ; Pause safety stop
429 429
431 tstfsz safety_stop_countdown ; Countdown at zero? 431 tstfsz safety_stop_countdown ; Countdown at zero?
432 bsf show_safety_stop ; No, Set flag! 432 bsf show_safety_stop ; No, Set flag!
433 return 433 return
434 434
435 delete_safety_stop: 435 delete_safety_stop:
436 bcf show_safety_stop ; Clear flag
437 clrf safety_stop_countdown ; reset timer 436 clrf safety_stop_countdown ; reset timer
438 return ; Done. 437 bra reset_safety_stop2 ; Remove saftestop from display
439 438
440 reset_safety_stop: 439 reset_safety_stop:
441 movlw safety_stop_length ;[s] 440 movlw safety_stop_length ;[s]
442 movwf safety_stop_countdown ; reset timer 441 movwf safety_stop_countdown ; reset timer
443 reset_safety_stop2: 442 reset_safety_stop2: