summaryrefslogtreecommitdiffstats
path: root/test/sdcc/standalone_blinker.c
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
commitf508189682b6fba62e08feeb1596f682bad5fff9 (patch)
tree28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /test/sdcc/standalone_blinker.c
downloadpiklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz
piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'test/sdcc/standalone_blinker.c')
-rw-r--r--test/sdcc/standalone_blinker.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/sdcc/standalone_blinker.c b/test/sdcc/standalone_blinker.c
new file mode 100644
index 0000000..b4049e6
--- /dev/null
+++ b/test/sdcc/standalone_blinker.c
@@ -0,0 +1,35 @@
+#define __16F873
+#include "pic16f873.h"
+
+typedef unsigned int word;
+word at 0x2007 __CONFIG = _CP_OFF & _WDT_OFF & _BODEN_ON & \
+ _PWRTE_ON & _HS_OSC & _WRT_ENABLE_ON & \
+ _LVP_OFF & _DEBUG_OFF & _CPD_OFF;
+
+unsigned char count, x;
+unsigned char ms_delay;
+
+void Intr() interrupt 0 {
+ ms_delay++;
+ PIR1 = 0;
+ PEIE = 1;
+}
+
+void main() {
+ NOT_RBPU=0;
+ T2CON=0x7f;
+ GIE = 1;
+ PEIE = 1;
+ //INTCON=0xc0;
+ PIR1 = 0;
+ PIE1 = 2;
+ PR2 = 200;
+
+ TRISB = 0;
+ ms_delay = 0;
+ while(1) {
+ count = ms_delay;
+ x = PIE1;
+ PORTB = (count & 0xf0) | (x & 0xf);
+ }
+}