summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/main.c b/main.c
index d77d118..ba34803 100644
--- a/main.c
+++ b/main.c
@@ -6,7 +6,8 @@
typedef unsigned int config;
-config __at 0x2007 __CONFIG = _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _HS_OSC ;
+config __at 0x2007 __CONFIG =
+ _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _HS_OSC;
void
msleep (int n)
@@ -19,6 +20,7 @@ msleep (int n)
}
}
}
+
void
sleep (int n)
{
@@ -28,28 +30,30 @@ sleep (int n)
}
}
-void thing(__sfr *t,__sfr *d)
+void
+thing (__sfr * t, __sfr * d)
{
-int i;
+ int i;
-for (i=0;i<8;++i) {
-int c=1<<i;
-*t=255^c;
-*d=0;
+ for (i = 0; i < 8; ++i)
+ {
+ int c = 1 << i;
+ *t = 255 ^ c;
+ *d = 0;
-sleep(1);
-sleep(1);
-sleep(1);
+ sleep (1);
+ sleep (1);
+ sleep (1);
-*d=255;
+ *d = 255;
-sleep(1);
-sleep(1);
-sleep(1);
+ sleep (1);
+ sleep (1);
+ sleep (1);
-}
+ }
-*t=255;
+ *t = 255;
}
void
@@ -59,14 +63,15 @@ main (void)
//ANSEL = 0x00;
WPU = 0xff;
-for (;;) {
+ for (;;)
+ {
-thing(&TRISA,&PORTA);
-thing(&TRISB,&PORTB);
-thing(&TRISC,&PORTC);
-thing(&TRISD,&PORTD);
-thing(&TRISE,&PORTE);
-}
+ thing (&TRISA, &PORTA);
+ thing (&TRISB, &PORTB);
+ thing (&TRISC, &PORTC);
+ thing (&TRISD, &PORTD);
+ thing (&TRISE, &PORTE);
+ }
}