diff options
author | root <root@artemis.panaceas.org> | 2016-11-23 17:53:05 +0000 |
---|---|---|
committer | root <root@artemis.panaceas.org> | 2016-11-23 17:53:05 +0000 |
commit | 52cde1641e294bb0306a87416f6e83ddc2d77061 (patch) | |
tree | 32e6c6e7d43788d8255b58c76d5c2b327b292593 | |
parent | ea33a46e3df260aec187a032171c6ffa9ab253aa (diff) | |
download | piotrs_thing-52cde1641e294bb0306a87416f6e83ddc2d77061.tar.gz piotrs_thing-52cde1641e294bb0306a87416f6e83ddc2d77061.tar.bz2 piotrs_thing-52cde1641e294bb0306a87416f6e83ddc2d77061.zip |
-rw-r--r-- | main.c | 51 |
1 files changed, 28 insertions, 23 deletions
@@ -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); + } } |