59,7 → 59,7 |
void output_init(void) { |
// set PC2 & PC3 as output (control of J16 & J17) |
DDRC |= (1<<DDC2)|(1<<DDC3); |
OUTPUT_OFF(0); OUTPUT_OFF(1); |
OUTPUT_SET(0,0); OUTPUT_SET(1,0); |
flashCnt[0] = flashCnt[1] = 0; |
flashMask[0] = flashMask[1] = 128; |
} |
94,25 → 94,12 |
*/ |
#define DIGITAL_DEBUG_MASK DEBUG_MK3MAG |
|
// invert means: An "1" bit in digital debug data will feed NO base current to output transistor. |
#define DIGITAL_DEBUG_INVERT 0 |
|
void output_update(void) { |
uint8_t output0, output1; |
if (!DIGITAL_DEBUG_MASK) |
flashingLights(); |
else { |
if (DIGITAL_DEBUG_MASK == DEBUG_LEDTEST) { |
// Show the state for a SET bit. If inverse, then invert. |
output0 = output1 = ~DIGITAL_DEBUG_INVERT; |
} else if (DIGITAL_DEBUG_INVERT) { |
output0 = (~DebugOut.Digital[0]) & DIGITAL_DEBUG_MASK; |
output1 = (~DebugOut.Digital[1]) & DIGITAL_DEBUG_MASK; |
} else { |
output0 = DebugOut.Digital[0] & DIGITAL_DEBUG_MASK; |
output1 = DebugOut.Digital[1] & DIGITAL_DEBUG_MASK; |
OUTPUT_SET(0, DebugOut.Digital[0] & DIGITAL_DEBUG_MASK); |
OUTPUT_SET(1, DebugOut.Digital[1] & DIGITAL_DEBUG_MASK); |
} |
OUTPUT_SET(0, output0); |
OUTPUT_SET(1, output1); |
} |
} |