]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blame - fx2lib/examples/lights/lights.c
Import fx2lib into fx2lafw directly.
[sigrok-firmware-fx2lafw.git] / fx2lib / examples / lights / lights.c
CommitLineData
3608c106
UH
1/**
2 * Copyright (C) 2009 Ubixum, Inc.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 **/
18
19#include <fx2regs.h>
20
21#include <lights.h>
22#include <delay.h>
23
24volatile xdata BYTE* bytes[] = { &D2ON, &D3ON, &D4ON, &D5ON, &D2OFF, &D3OFF, &D4OFF, &D5OFF };
25
26void main(void)
27{
28 volatile BYTE tmp;
29 BYTE cur=0;
30
31 // loop endlessly
32 for(;;) {
33 tmp=*bytes[cur];
34 delay(50);
35 cur = cur == 7 ? 0 : cur+1;
36 }
37}