fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / libgloss / pa / op50nled.c
blobb6b35be4c35bb809832f492ee50c925fd4303498
1 /* op50nled.c -- fucntions that manipulate the LEDs.
2 *
3 * Copyright (c) 1995 Cygnus Support
5 * The authors hereby grant permission to use, copy, modify, distribute,
6 * and license this software and its documentation for any purpose, provided
7 * that existing copyright notices are retained in all copies and that this
8 * notice is included verbatim in any distributions. No written agreement,
9 * license, or royalty fee is required for any of the authorized uses.
10 * Modifications to this software may be copyrighted by their authors
11 * and need not follow the licensing terms described here, provided that
12 * the new terms are clearly indicated on the first page of each file where
13 * they apply.
15 #include "op50n.h"
17 void zylons();
18 void strobe();
19 void led_putnum();
20 void delay();
23 * led_putnum -- print a hex number on the LED. the value of num must be a byte.
24 * The max number 15, since the front panel only has 4 LEDs.
26 void
27 led_putnum ( num )
28 char num;
30 static unsigned char *leds = (unsigned char *)LED_ADDR;
32 /** *leds = (num << 4); **/
33 *leds = num;
37 * strobe -- do a zylons thing, toggling each led in sequence forever...
39 void
40 zylons()
42 while (1) {
43 strobe();
48 * strobe -- toggle each led in sequence up and back once.
50 void
51 strobe()
53 static unsigned char curled;
54 static unsigned char dir;
56 curled = 1;
57 dir = 0;
58 while (curled != 0) {
59 led_putnum (curled);
60 delay (70000);
61 if (dir)
62 curled >>= 1;
63 else
64 curled <<= 1;
66 if (curled == 0x100) {
67 dir = ~dir;
70 curled = 1;
71 dir = 0;
74 void
75 delay (x)
76 int x;
78 int y = 17;
79 while (x-- !=0)
80 y = y^2;