Download here - Adam Morse

Transcript
HazardsEnable:
;
; set status to enabled
;
bsf
HZ_Status,HZSTAT_ENABLED,A
;
; set the lights on indicator
;
bsf
HZ_Status,HZSTAT_ON,A
;
; set the on cycle count-down timer
;
movlw HZ_CYCLE_ON_COUNT
movwf HZ_Counter,A
;
; turn on the output pin
;
bsf
HZ_PORT,HZ_PIN
return
;
; Function:
HazardsDisable
;
; Purpose:
To Enable the backup beeper
;
; Parameters: None
;
; Returns:
None
;
; Notes:
;
HazardsDisable:
;
; turn off the hazards
;
bcf
HZ_PORT,HZ_PIN
;
; set status to disabled
;
bcf
HZ_Status,HZSTAT_ENABLED,A
return
;
; Function:
;
; Purpose:
;
; Parameters:
;
; Returns:
;
; Notes:
;
HazardsUpdate:
HazardsUpdate
To update the Beeper status (turn on/off) each iteration
None
None
;
; decrement the countdown counter and return if not zero
;
decfsz
HZ_Counter,F,A
bra
HZU_Done
;
; if we get here, the counter has run out so time to change the
; state of the hazards