pinsDebug for 644/1284 & USB646/1286 families

added conditional compilation for PWMs 1C & 3C

add Teensyduino compatibility

==========================================

changes per review - minor formatting changes

1) remove non-printable character at the end of line 687

2) split a really long comment into two lines

3) got rid of some trailing spaces

============================================

Made pinsDebug_Teensyduino.h the same between this PR and PR 5668 which
is for a re-written pinsDebug.h file.

The changes were:
1) added copyright @ GNU license header
2) a blank line crept in.
This commit is contained in:
Bob-the-Kuhn
2017-01-05 23:38:30 -06:00
committed by Scott Lahteine
parent 9b5515926a
commit ae706233a8
2 changed files with 137 additions and 16 deletions

View File

@@ -22,6 +22,10 @@
bool endstop_monitor_flag = false;
#if !defined(TIMER1B) // working with Teensyduino extension so need to re-define some things
#include "pinsDebug_Teensyduino.h"
#endif
#define NAME_FORMAT "%-28s" // one place to specify the format of all the sources of names
// "-" left justify, "28" minimum width of name, pad with blanks
@@ -683,7 +687,9 @@ static bool pwm_status(uint8_t pin) {
#if defined(TCCR1A) && defined(COM1A1)
PWM_CASE(1,A);
PWM_CASE(1,B);
PWM_CASE(1,C);
#if defined(COM1C1) && defined(TIMER1C)
PWM_CASE(1,C);
#endif
#endif
#if defined(TCCR2A) && defined(COM2A1)
@@ -694,7 +700,9 @@ static bool pwm_status(uint8_t pin) {
#if defined(TCCR3A) && defined(COM3A1)
PWM_CASE(3,A);
PWM_CASE(3,B);
PWM_CASE(3,C);
#if defined(COM3C1)
PWM_CASE(3,C);
#endif
#endif
#ifdef TCCR4A
@@ -778,13 +786,15 @@ static void pwm_details(uint8_t pin) {
else if (TIMSK1 & (_BV(TOIE1) | _BV(ICIE1))) err_prob_interrupt();
else can_be_used();
break;
case TIMER1C:
TIMER_PREFIX(1,C,4);
if (WGM_TEST2) err_is_counter();
else if (TEST(TIMSK1, OCIE1C)) err_is_interrupt();
else if (TIMSK1 & (_BV(TOIE1) | _BV(ICIE1))) err_prob_interrupt();
else can_be_used();
break;
#if defined(COM1C1) && defined(TIMER1C)
case TIMER1C:
TIMER_PREFIX(1,C,4);
if (WGM_TEST2) err_is_counter();
else if (TEST(TIMSK1, OCIE1C)) err_is_interrupt();
else if (TIMSK1 & (_BV(TOIE1) | _BV(ICIE1))) err_prob_interrupt();
else can_be_used();
break;
#endif
#endif
#if defined(TCCR2A) && defined(COM2A1)
@@ -819,13 +829,15 @@ static void pwm_details(uint8_t pin) {
else if (TIMSK3 & (_BV(TOIE3) | _BV(ICIE3))) err_prob_interrupt();
else can_be_used();
break;
#if defined(COM3C1)
case TIMER3C:
TIMER_PREFIX(3,C,3);
if (WGM_TEST2) err_is_counter();
else if (TEST(TIMSK3, OCIE3C)) err_is_interrupt();
else if (TIMSK3 & (_BV(TOIE3) | _BV(ICIE3))) err_prob_interrupt();
else can_be_used();
break;
TIMER_PREFIX(3,C,3);
if (WGM_TEST2) err_is_counter();
else if (TEST(TIMSK3, OCIE3C)) err_is_interrupt();
else if (TIMSK3 & (_BV(TOIE3) | _BV(ICIE3))) err_prob_interrupt();
else can_be_used();
break;
#endif
#endif
#ifdef TCCR4A
@@ -942,4 +954,3 @@ inline void report_pin_state_extended(int8_t pin, bool ignore) {
pwm_details(pin);
SERIAL_EOL;
}