My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pinsDebug.h 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. bool endstop_monitor_flag = false;
  23. #define NAME_FORMAT "%-28s" // one place to specify the format of all the sources of names
  24. // "-" left justify, "28" minimum width of name, pad with blanks
  25. #define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7)))
  26. #define AVR_ATmega2560_FAMILY (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__))
  27. #define AVR_AT90USB1286_FAMILY (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1286P__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB646P__) || defined(__AVR_AT90USB647__))
  28. #define AVR_ATmega1284_FAMILY (defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__))
  29. /**
  30. * This routine minimizes RAM usage by creating a FLASH resident array to
  31. * store the pin names, pin numbers and analog/digital flag.
  32. *
  33. * Creating the array in FLASH is a two pass process. The first pass puts the
  34. * name strings into FLASH. The second pass actually creates the array.
  35. *
  36. * Both passes use the same pin list. The list contains two macro names. The
  37. * actual macro definitions are changed depending on which pass is being done.
  38. *
  39. */
  40. // first pass - put the name strings into FLASH
  41. #define _ADD_PIN_2(PIN_NAME, ENTRY_NAME) static const unsigned char ENTRY_NAME[] PROGMEM = {PIN_NAME};
  42. #define _ADD_PIN(PIN_NAME, COUNTER) _ADD_PIN_2(PIN_NAME, entry_NAME_##COUNTER)
  43. #define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER)
  44. #define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER)
  45. #line 0 // set __LINE__ to a known value for the first pass
  46. #include "pinsDebug_list.h"
  47. #line 59 // set __LINE__ to the correct line number or else compiler error messages don't make sense
  48. // manually add pins that have names that are macros which don't play well with these macros
  49. #if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY)
  50. static const unsigned char RXD_NAME[] PROGMEM = {"RXD"};
  51. static const unsigned char TXD_NAME[] PROGMEM = {"TXD"};
  52. #endif
  53. /////////////////////////////////////////////////////////////////////////////
  54. // second pass - create the array
  55. #undef _ADD_PIN_2
  56. #undef _ADD_PIN
  57. #undef REPORT_NAME_DIGITAL
  58. #undef REPORT_NAME_ANALOG
  59. #define _ADD_PIN_2( ENTRY_NAME, NAME, IS_DIGITAL) {(const char*) ENTRY_NAME, (const char*)NAME, (const char*)IS_DIGITAL},
  60. #define _ADD_PIN( NAME, COUNTER, IS_DIGITAL) _ADD_PIN_2( entry_NAME_##COUNTER, NAME, IS_DIGITAL)
  61. #define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN( NAME, COUNTER, (uint8_t)1)
  62. #define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN( analogInputToDigitalPin(NAME), COUNTER, 0)
  63. const char* const pin_array[][3] PROGMEM = {
  64. /**
  65. * [pin name] [pin number] [is digital or analog] 1 = digital, 0 = analog
  66. * Each entry takes up 6 bytes in FLASH:
  67. * 2 byte pointer to location of the name string
  68. * 2 bytes containing the pin number
  69. * analog pin numbers were convereted to digital when the array was created
  70. * 2 bytes containing the digital/analog bool flag
  71. */
  72. // manually add pins ...
  73. #if SERIAL_PORT == 0
  74. #if AVR_ATmega2560_FAMILY
  75. {RXD_NAME, 0, 1},
  76. {TXD_NAME, 1, 1},
  77. #elif AVR_ATmega1284_FAMILY
  78. {RXD_NAME, 8, 1},
  79. {TXD_NAME, 9, 1},
  80. #endif
  81. #endif
  82. #line 0 // set __LINE__ to the SAME known value for the second pass
  83. #include "pinsDebug_list.h"
  84. }; // done populating the array
  85. #line 109 // set __LINE__ to the correct line number or else compiler error messages don't make sense
  86. #define n_array (sizeof (pin_array) / sizeof (const char *))/3
  87. #if !defined(TIMER1B) // working with Teensyduino extension so need to re-define some things
  88. #include "pinsDebug_Teensyduino.h"
  89. #endif
  90. #define PWM_PRINT(V) do{ sprintf(buffer, "PWM: %4d", V); SERIAL_ECHO(buffer); }while(0)
  91. #define PWM_CASE(N,Z) \
  92. case TIMER##N##Z: \
  93. if (TCCR##N##A & (_BV(COM##N##Z##1) | _BV(COM##N##Z##0))) { \
  94. PWM_PRINT(OCR##N##Z); \
  95. return true; \
  96. } else return false
  97. /**
  98. * Print a pin's PWM status.
  99. * Return true if it's currently a PWM pin.
  100. */
  101. static bool pwm_status(uint8_t pin) {
  102. char buffer[20]; // for the sprintf statements
  103. switch(digitalPinToTimer(pin)) {
  104. #if defined(TCCR0A) && defined(COM0A1)
  105. #if defined (TIMER0A)
  106. PWM_CASE(0,A);
  107. #endif
  108. PWM_CASE(0,B);
  109. #endif
  110. #if defined(TCCR1A) && defined(COM1A1)
  111. PWM_CASE(1,A);
  112. PWM_CASE(1,B);
  113. #if defined(COM1C1) && defined (TIMER1C)
  114. PWM_CASE(1,C);
  115. #endif
  116. #endif
  117. #if defined(TCCR2A) && defined(COM2A1)
  118. PWM_CASE(2,A);
  119. PWM_CASE(2,B);
  120. #endif
  121. #if defined(TCCR3A) && defined(COM3A1)
  122. PWM_CASE(3,A);
  123. PWM_CASE(3,B);
  124. #ifdef COM3C1
  125. PWM_CASE(3,C);
  126. #endif
  127. #endif
  128. #ifdef TCCR4A
  129. PWM_CASE(4,A);
  130. PWM_CASE(4,B);
  131. PWM_CASE(4,C);
  132. #endif
  133. #if defined(TCCR5A) && defined(COM5A1)
  134. PWM_CASE(5,A);
  135. PWM_CASE(5,B);
  136. PWM_CASE(5,C);
  137. #endif
  138. case NOT_ON_TIMER:
  139. default:
  140. return false;
  141. }
  142. SERIAL_PROTOCOLPGM(" ");
  143. } // pwm_status
  144. const uint8_t* const PWM_other[][3] PROGMEM = {
  145. {&TCCR0A, &TCCR0B, &TIMSK0},
  146. {&TCCR1A, &TCCR1B, &TIMSK1},
  147. #if defined(TCCR2A) && defined(COM2A1)
  148. {&TCCR2A, &TCCR2B, &TIMSK2},
  149. #endif
  150. #if defined(TCCR3A) && defined(COM3A1)
  151. {&TCCR3A, &TCCR3B, &TIMSK3},
  152. #endif
  153. #ifdef TCCR4A
  154. {&TCCR4A, &TCCR4B, &TIMSK4},
  155. #endif
  156. #if defined(TCCR5A) && defined(COM5A1)
  157. {&TCCR5A, &TCCR5B, &TIMSK5},
  158. #endif
  159. };
  160. const uint8_t* const PWM_OCR[][3] PROGMEM = {
  161. #if defined (TIMER0A)
  162. {&OCR0A,&OCR0B,0},
  163. #else
  164. {0,&OCR0B,0},
  165. #endif
  166. #if defined(COM1C1) && defined (TIMER1C)
  167. { (const uint8_t*) &OCR1A, (const uint8_t*) &OCR1B, (const uint8_t*) &OCR1C},
  168. #else
  169. { (const uint8_t*) &OCR1A, (const uint8_t*) &OCR1B,0},
  170. #endif
  171. #if defined(TCCR2A) && defined(COM2A1)
  172. {&OCR2A,&OCR2B,0},
  173. #endif
  174. #if defined(TCCR3A) && defined(COM3A1)
  175. #if defined(COM3C1)
  176. { (const uint8_t*) &OCR3A, (const uint8_t*) &OCR3B, (const uint8_t*) &OCR3C},
  177. #else
  178. { (const uint8_t*) &OCR3A, (const uint8_t*) &OCR3B,0},
  179. #endif
  180. #endif
  181. #ifdef TCCR4A
  182. { (const uint8_t*) &OCR4A, (const uint8_t*) &OCR4B, (const uint8_t*) &OCR4C},
  183. #endif
  184. #if defined(TCCR5A) && defined(COM5A1)
  185. { (const uint8_t*) &OCR5A, (const uint8_t*) &OCR5B, (const uint8_t*) &OCR5C},
  186. #endif
  187. };
  188. #define TCCR_A(T) pgm_read_word(&PWM_other[T][0])
  189. #define TCCR_B(T) pgm_read_word(&PWM_other[T][1])
  190. #define TIMSK(T) pgm_read_word(&PWM_other[T][2])
  191. #define CS_0 0
  192. #define CS_1 1
  193. #define CS_2 2
  194. #define WGM_0 0
  195. #define WGM_1 1
  196. #define WGM_2 3
  197. #define WGM_3 4
  198. #define TOIE 0
  199. #define OCR_VAL(T, L) pgm_read_word(&PWM_OCR[T][L])
  200. static void err_is_counter() {
  201. SERIAL_PROTOCOLPGM(" non-standard PWM mode");
  202. }
  203. static void err_is_interrupt() {
  204. SERIAL_PROTOCOLPGM(" compare interrupt enabled ");
  205. }
  206. static void err_prob_interrupt() {
  207. SERIAL_PROTOCOLPGM(" overflow interrupt enabled");
  208. }
  209. static void can_be_used() { SERIAL_PROTOCOLPGM(" can be used as PWM "); }
  210. void com_print(uint8_t N, uint8_t Z) {
  211. uint8_t *TCCRA = (uint8_t*) TCCR_A(N);
  212. SERIAL_PROTOCOLPGM(" COM");
  213. SERIAL_PROTOCOLCHAR(N + '0');
  214. switch(Z) {
  215. case 'A' :
  216. SERIAL_PROTOCOLPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6));
  217. break;
  218. case 'B' :
  219. SERIAL_PROTOCOLPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4));
  220. break;
  221. case 'C' :
  222. SERIAL_PROTOCOLPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2));
  223. break;
  224. }
  225. }
  226. void timer_prefix(uint8_t T, char L, uint8_t N){ // T - timer L - pwm n - WGM bit layout
  227. char buffer[20]; // for the sprintf statements
  228. uint8_t *TCCRB = (uint8_t*) TCCR_B(T);
  229. uint8_t *TCCRA = (uint8_t*) TCCR_A(T);
  230. uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1))));
  231. if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
  232. SERIAL_PROTOCOLPGM(" TIMER");
  233. SERIAL_PROTOCOLCHAR(T + '0');
  234. SERIAL_PROTOCOLCHAR(L);
  235. SERIAL_PROTOCOLPGM(" ");
  236. if (N == 3) {
  237. uint8_t *OCRVAL8 = (uint8_t*) OCR_VAL(T, L - 'A');
  238. PWM_PRINT(*OCRVAL8);
  239. }
  240. else {
  241. uint16_t *OCRVAL16 = (uint16_t*) OCR_VAL(T, L - 'A');
  242. PWM_PRINT(*OCRVAL16);
  243. }
  244. SERIAL_PROTOCOLPAIR(" WGM: ", WGM);
  245. com_print(T,L);
  246. SERIAL_PROTOCOLPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) ));
  247. SERIAL_PROTOCOLPGM(" TCCR");
  248. SERIAL_PROTOCOLCHAR(T + '0');
  249. SERIAL_PROTOCOLPAIR("A: ", *TCCRA);
  250. SERIAL_PROTOCOLPGM(" TCCR");
  251. SERIAL_PROTOCOLCHAR(T + '0');
  252. SERIAL_PROTOCOLPAIR("B: ", *TCCRB);
  253. uint8_t *TMSK = (uint8_t*) TIMSK(T);
  254. SERIAL_PROTOCOLPGM(" TIMSK");
  255. SERIAL_PROTOCOLCHAR(T + '0');
  256. SERIAL_PROTOCOLPAIR(": ", *TMSK);
  257. uint8_t OCIE = L - 'A' + 1;
  258. if (N == 3) {if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter();}
  259. else {if (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13) err_is_counter();}
  260. if (TEST(*TMSK, OCIE)) err_is_interrupt();
  261. if (TEST(*TMSK, TOIE)) err_prob_interrupt();
  262. }
  263. static void pwm_details(uint8_t pin) {
  264. char buffer[20]; // for the sprintf statements
  265. uint8_t WGM;
  266. switch(digitalPinToTimer(pin)) {
  267. #if defined(TCCR0A) && defined(COM0A1)
  268. #if defined (TIMER0A)
  269. case TIMER0A:
  270. timer_prefix(0,'A',3);
  271. break;
  272. #endif
  273. case TIMER0B:
  274. timer_prefix(0,'B',3);
  275. break;
  276. #endif
  277. #if defined(TCCR1A) && defined(COM1A1)
  278. case TIMER1A:
  279. timer_prefix(1,'A',4);
  280. break;
  281. case TIMER1B:
  282. timer_prefix(1,'B',4);
  283. break;
  284. #if defined(COM1C1) && defined (TIMER1C)
  285. case TIMER1C:
  286. timer_prefix(1,'C',4);
  287. break;
  288. #endif
  289. #endif
  290. #if defined(TCCR2A) && defined(COM2A1)
  291. case TIMER2A:
  292. timer_prefix(2,'A',3);
  293. break;
  294. case TIMER2B:
  295. timer_prefix(2,'B',3);
  296. break;
  297. #endif
  298. #if defined(TCCR3A) && defined(COM3A1)
  299. case TIMER3A:
  300. timer_prefix(3,'A',4);
  301. break;
  302. case TIMER3B:
  303. timer_prefix(3,'B',4);
  304. break;
  305. #if defined(COM3C1)
  306. case TIMER3C:
  307. timer_prefix(3,'C',4);
  308. break;
  309. #endif
  310. #endif
  311. #ifdef TCCR4A
  312. case TIMER4A:
  313. timer_prefix(4,'A',4);
  314. break;
  315. case TIMER4B:
  316. timer_prefix(4,'B',4);
  317. break;
  318. case TIMER4C:
  319. timer_prefix(4,'C',4);
  320. break;
  321. #endif
  322. #if defined(TCCR5A) && defined(COM5A1)
  323. case TIMER5A:
  324. timer_prefix(5,'A',4);
  325. break;
  326. case TIMER5B:
  327. timer_prefix(5,'B',4);
  328. break;
  329. case TIMER5C:
  330. timer_prefix(5,'C',4);
  331. break;
  332. #endif
  333. case NOT_ON_TIMER: break;
  334. }
  335. SERIAL_PROTOCOLPGM(" ");
  336. // on pins that have two PWMs, print info on second PWM
  337. #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY
  338. // looking for port B7 - PWMs 0A and 1C
  339. if ( ('B' == digitalPinToPort(pin) + 64) && (0x80 == digitalPinToBitMask(pin))) {
  340. #if !defined(TEENSYDUINO_IDE)
  341. SERIAL_EOL;
  342. SERIAL_PROTOCOLPGM (" . TIMER1C is also tied to this pin ");
  343. timer_prefix(1,'C',4);
  344. #else
  345. SERIAL_EOL;
  346. SERIAL_PROTOCOLPGM (" . TIMER0A is also tied to this pin ");
  347. timer_prefix(0,'A',3);
  348. #endif
  349. }
  350. #endif
  351. } // pwm_details
  352. bool get_pinMode(int8_t pin) { return *portModeRegister(digitalPinToPort(pin)) & digitalPinToBitMask(pin); }
  353. #if !defined(digitalRead_mod) // use Teensyduino's version of digitalRead - it doesn't disable the PWMs
  354. int digitalRead_mod(int8_t pin) { // same as digitalRead except the PWM stop section has been removed
  355. uint8_t port = digitalPinToPort(pin);
  356. return (port != NOT_A_PIN) && (*portInputRegister(port) & digitalPinToBitMask(pin)) ? HIGH : LOW;
  357. }
  358. #endif
  359. void print_port(int8_t pin) { // print port number
  360. #if defined(digitalPinToPort)
  361. SERIAL_PROTOCOLPGM(" Port: ");
  362. uint8_t x = digitalPinToPort(pin) + 64;
  363. SERIAL_CHAR(x);
  364. uint8_t temp = digitalPinToBitMask(pin);
  365. for (x = '0'; (x < '9' && !(temp == 1)); x++){
  366. temp = temp >> 1;
  367. }
  368. SERIAL_CHAR(x);
  369. #else
  370. SERIAL_PROTOCOLPGM(" ")
  371. #endif
  372. }
  373. // pretty report with PWM info
  374. inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = true) {
  375. uint8_t temp_char;
  376. char *name_mem_pointer;
  377. char buffer[30]; // for the sprintf statements
  378. bool found = false;
  379. bool multi_name_pin = false;
  380. for (uint8_t x = 0; x < n_array; x++) { // scan entire array and report all instances of this pin
  381. if (pgm_read_byte(&pin_array[x][1]) == pin) {
  382. if (found == true) multi_name_pin = true;
  383. found = true;
  384. if (multi_name_pin == false) { // report digitial and analog pin number only on the first time through
  385. sprintf(buffer, "PIN:% 3d ", pin); // digital pin number
  386. SERIAL_ECHO(buffer);
  387. print_port(pin);
  388. if (IS_ANALOG(pin)) {
  389. sprintf(buffer, " (A%2d) ", int(pin - analogInputToDigitalPin(0))); // analog pin number
  390. SERIAL_ECHO(buffer);
  391. }
  392. else SERIAL_ECHOPGM(" "); // add padding if not an analog pin
  393. }
  394. else SERIAL_ECHOPGM(". "); // add padding if not the first instance found
  395. name_mem_pointer = (char*) pgm_read_word(&pin_array[x][0]);
  396. for (uint8_t y = 0; y < 28; y++) { // always print pin name
  397. temp_char = pgm_read_byte(name_mem_pointer + y);
  398. if (temp_char != 0) MYSERIAL.write(temp_char);
  399. else {
  400. for (uint8_t i = 0; i < 28 - y; i++) MYSERIAL.write(" ");
  401. break;
  402. }
  403. }
  404. if (pin_is_protected(pin) && !ignore)
  405. SERIAL_ECHOPGM("protected ");
  406. else {
  407. if (!(pgm_read_byte(&pin_array[x][2]))) {
  408. sprintf(buffer, "Analog in =% 5d", analogRead(pin - analogInputToDigitalPin(0)));
  409. SERIAL_ECHO(buffer);
  410. }
  411. else {
  412. if (!get_pinMode(pin)) {
  413. // pinMode(pin, INPUT_PULLUP); // make sure input isn't floating - stopped doing this
  414. // because this could interfere with inductive/capacitive
  415. // sensors (high impedance voltage divider) and with PT100 amplifier
  416. SERIAL_PROTOCOLPAIR("Input = ", digitalRead_mod(pin));
  417. }
  418. else if (pwm_status(pin)) {
  419. // do nothing
  420. }
  421. else SERIAL_PROTOCOLPAIR("Output = ", digitalRead_mod(pin));
  422. }
  423. if (multi_name_pin == false && extended) pwm_details(pin); // report PWM capabilities only on the first pass & only if doing an extended report
  424. }
  425. SERIAL_EOL;
  426. } // end of IF
  427. } // end of for loop
  428. if (found == false) {
  429. sprintf(buffer, "PIN:% 3d ", pin);
  430. SERIAL_ECHO(buffer);
  431. print_port(pin);
  432. if (IS_ANALOG(pin)) {
  433. sprintf(buffer, " (A%2d) ", int(pin - analogInputToDigitalPin(0))); // analog pin number
  434. SERIAL_ECHO(buffer);
  435. }
  436. else SERIAL_ECHOPGM(" "); // add padding if not an analog pin
  437. SERIAL_ECHOPGM("<unused/unknown>");
  438. if (get_pinMode(pin)) {
  439. SERIAL_PROTOCOLPAIR(" Output = ", digitalRead_mod(pin));
  440. }
  441. else {
  442. if (IS_ANALOG(pin)) {
  443. sprintf(buffer, " Analog in =% 5d", analogRead(pin - analogInputToDigitalPin(0)));
  444. SERIAL_ECHO(buffer);
  445. }
  446. else {
  447. SERIAL_ECHOPGM(" "); // add padding if not an analog pin
  448. }
  449. SERIAL_PROTOCOLPAIR(" Input = ", digitalRead_mod(pin));
  450. }
  451. // if (!pwm_status(pin)) SERIAL_ECHOPGM(" "); // add padding if it's not a PWM pin
  452. if (extended) pwm_details(pin); // report PWM capabilities only if doing an extended report
  453. SERIAL_EOL;
  454. }
  455. }
  456. inline void report_pin_state(int8_t pin) {
  457. report_pin_state_extended(pin, false, false);
  458. }