chiark / gitweb /
undo broken deletion
[trains.git] / cebpic / routines-led.asm
1 ;**********************************************************************
2 ; routines-led
3 ; subroutines for controlling the per-pic LED (pin 21, DS100)
4
5 clock equ -1
6         include         common.inc
7
8         global  led_green
9         global  led_red
10         global  led_black
11
12         code
13
14 ;----------------------------------------
15 led_red
16 ; makes the LED be red (or orange), no matter its previous state
17 ; no RAM locations used or modified
18 ; W is unchanged
19         bcf             LATD, 2, 0              ; output low
20         bcf             TRISD, 2, 0             ; output enabled
21         return
22
23 ;----------------------------------------
24 led_green
25 ; makes the LED be green (or blue), no matter its previous state
26 ; no RAM locations used or modified
27 ; W is unchanged
28         bsf             LATD, 2, 0              ; output high
29         bcf             TRISD, 2, 0             ; output enabled
30         return
31
32 ;----------------------------------------
33 led_black
34 ; makes the LED be black (off), no matter its previous state
35 ; no RAM locations used or modified
36 ; W is unchanged
37         bsf             TRISD, 2, 0             ; disable flasher output
38         return
39
40         end