summaryrefslogtreecommitdiff
path: root/blink.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-12-19 11:04:16 -0800
committerKeith Packard <keithp@keithp.com>2008-12-19 11:04:16 -0800
commit55995515b9d4fc1e193039eab697c5d03db417c2 (patch)
tree26fe03c8e599a60cdaf2b4d1ebc3b17549584320 /blink.c
parent0bc52385b8f86f9ca1c450ad106e6d8afe3bc153 (diff)
Add flash writing code.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'blink.c')
-rw-r--r--blink.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/blink.c b/blink.c
index 1f8a5192..a5906f6d 100644
--- a/blink.c
+++ b/blink.c
@@ -11,7 +11,7 @@ sfr at 0xA0 P2;
sfr at 0xFD P0DIR;
sfr at 0xFE P1DIR;
-sfr at 0xFE P2DIR;
+sfr at 0xFF P2DIR;
sfr at 0x8F P0INP;
sfr at 0xF6 P1INP;
sfr at 0xF7 P2INP;
@@ -24,6 +24,7 @@ sfr at 0xF7 P2INP;
nop \
_endasm;
+#if 0
void
delay (int n)
{
@@ -62,14 +63,29 @@ wordspace () {
delay(8);
}
+#define _ dit();
+#define ___ dah();
+#define C charspace();
+#define W wordspace();
+
+#endif
+
main ()
{
+#if 0
/* Set p1_1 to output */
P1DIR = 0x02;
P1INP = 0x00;
P2INP = 0x00;
for (;;) {
- dah(); dit(); dah(); dit(); charspace ();
- dah(); dah(); dit(); dah(); wordspace();
+ ___ _ ___ _ C ___ ___ _ ___ W /* cq */
+ ___ _ _ C _ W /* de */
+ ___ _ ___ C ___ _ _ C /* kd */
+ ___ ___ _ _ _ C _ _ _ C /* 7s */
+ ___ ___ _ ___ C ___ ___ _ W /* qg */
}
+#else
+ P1DIR = 0x02;
+ for (;;);
+#endif
}