summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@artemis.panaceas.org>2016-11-23 17:53:05 +0000
committerroot <root@artemis.panaceas.org>2016-11-23 17:53:05 +0000
commit52cde1641e294bb0306a87416f6e83ddc2d77061 (patch)
tree32e6c6e7d43788d8255b58c76d5c2b327b292593
parentea33a46e3df260aec187a032171c6ffa9ab253aa (diff)
downloadpiotrs_thing-master.zip
piotrs_thing-master.tar.gz
piotrs_thing-master.tar.bz2
-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);
+ }
}