Cleanups to pins debugging

2.0.x
Scott Lahteine 8 years ago
parent 42824b0e1f
commit 819df5e06d

@ -278,8 +278,7 @@ void com_print(uint8_t N, uint8_t Z) {
}
}
void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm n - WGM bit layout
void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout
char buffer[20]; // for the sprintf statements
uint8_t *TCCRB = (uint8_t*)TCCR_B(T);
uint8_t *TCCRA = (uint8_t*)TCCR_A(T);
@ -327,76 +326,43 @@ static void pwm_details(uint8_t pin) {
switch(digitalPinToTimer(pin)) {
#if defined(TCCR0A) && defined(COM0A1)
#ifdef TIMER0A
case TIMER0A:
timer_prefix(0,'A',3);
break;
case TIMER0A: timer_prefix(0, 'A', 3); break;
#endif
case TIMER0B:
timer_prefix(0,'B',3);
break;
case TIMER0B: timer_prefix(0, 'B', 3); break;
#endif
#if defined(TCCR1A) && defined(COM1A1)
case TIMER1A:
timer_prefix(1,'A',4);
break;
case TIMER1B:
timer_prefix(1,'B',4);
break;
case TIMER1A: timer_prefix(1, 'A', 4); break;
case TIMER1B: timer_prefix(1, 'B', 4); break;
#if defined(COM1C1) && defined(TIMER1C)
case TIMER1C:
timer_prefix(1,'C',4);
break;
case TIMER1C: timer_prefix(1, 'C', 4); break;
#endif
#endif
#if defined(TCCR2A) && defined(COM2A1)
case TIMER2A:
timer_prefix(2,'A',3);
break;
case TIMER2B:
timer_prefix(2,'B',3);
break;
case TIMER2A: timer_prefix(2, 'A', 3); break;
case TIMER2B: timer_prefix(2, 'B', 3); break;
#endif
#if defined(TCCR3A) && defined(COM3A1)
case TIMER3A:
timer_prefix(3,'A',4);
break;
case TIMER3B:
timer_prefix(3,'B',4);
break;
case TIMER3A: timer_prefix(3, 'A', 4); break;
case TIMER3B: timer_prefix(3, 'B', 4); break;
#ifdef COM3C1
case TIMER3C:
timer_prefix(3,'C',4);
break;
case TIMER3C: timer_prefix(3, 'C', 4); break;
#endif
#endif
#ifdef TCCR4A
case TIMER4A:
timer_prefix(4,'A',4);
break;
case TIMER4B:
timer_prefix(4,'B',4);
break;
case TIMER4C:
timer_prefix(4,'C',4);
break;
case TIMER4A: timer_prefix(4, 'A', 4); break;
case TIMER4B: timer_prefix(4, 'B', 4); break;
case TIMER4C: timer_prefix(4, 'C', 4); break;
#endif
#if defined(TCCR5A) && defined(COM5A1)
case TIMER5A:
timer_prefix(5,'A',4);
break;
case TIMER5B:
timer_prefix(5,'B',4);
break;
case TIMER5C:
timer_prefix(5,'C',4);
break;
case TIMER5A: timer_prefix(5, 'A', 4); break;
case TIMER5B: timer_prefix(5, 'B', 4); break;
case TIMER5C: timer_prefix(5, 'C', 4); break;
#endif
case NOT_ON_TIMER: break;
@ -472,7 +438,6 @@ inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = t
SERIAL_CHAR('.');
SERIAL_ECHO_SP(25); // add padding if not the first instance found
}
else SERIAL_ECHOPGM(". "); // add padding if not the first instance found
name_mem_pointer = (char*)pgm_read_word(&pin_array[x][0]);
for (uint8_t y = 0; y < 28; y++) { // always print pin name
temp_char = pgm_read_byte(name_mem_pointer + y);

Loading…
Cancel
Save