Changeset 13
- Timestamp:
- Aug 1, 2019, 11:47:58 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/software/firmware/main.c
r11 r13 13 13 void _startup (void) __naked; 14 14 15 static char counter_ 1hz;15 static char counter_2hz; 16 16 static volatile short counter_10hz; 17 17 static volatile unsigned char softintrs; … … 77 77 { 78 78 softintrs = 0; 79 counter_1hz = 10;80 79 81 80 ANCON0 = 0xf0; /* an0-an3 analog, an4-an7 digital */ … … 204 203 /* enable watch dog timer */ 205 204 WDTCON = 0x01; 205 LEDR = 1; 206 LEDG = 1; 207 counter_2hz = 5; 208 while (counter_2hz > 0) { 209 if (softintrs & INT_10HZ) { 210 softintrs &= ~INT_10HZ; 211 counter_2hz--; 212 } 213 } 214 counter_2hz = 5; 206 215 LEDR = 0; 216 LEDG = 0; 207 217 208 218 printf("\nready\n"); 209 219 ad_channel = 0; 210 220 ADCON0bits.CHS = 0; 211 LEDG = 1;212 221 PWRON = 0; 213 222 … … 216 225 if (softintrs & INT_10HZ) { 217 226 softintrs &= ~INT_10HZ; 218 LEDG ^= 1; 227 counter_2hz--; 228 if (counter_2hz == 0) { 229 counter_2hz = 5; 230 LEDG ^= 1; 231 } 219 232 } 220 233 if (softintrs & INT_RX1) {
Note: See TracChangeset
for help on using the changeset viewer.