@@ -109,7 +109,7 @@ void PRINT_ARRAY_NAME(uint8_t x) {
109
109
* Print a pin's PWM status.
110
110
* Return true if it's currently a PWM pin.
111
111
*/
112
- static bool pwm_status (uint8_t pin ) {
112
+ bool pwm_status (uint8_t pin ) {
113
113
char buffer [20 ]; // for the sprintf statements
114
114
115
115
switch (digitalPinToTimer_DEBUG (pin )) {
@@ -232,12 +232,12 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
232
232
233
233
#define OCR_VAL (T , L ) pgm_read_word(&PWM_OCR[T][L])
234
234
235
- static void err_is_counter () { SERIAL_ECHOPGM (" non-standard PWM mode" ); }
236
- static void err_is_interrupt () { SERIAL_ECHOPGM (" compare interrupt enabled" ); }
237
- static void err_prob_interrupt () { SERIAL_ECHOPGM (" overflow interrupt enabled" ); }
238
- static void print_is_also_tied () { SERIAL_ECHOPGM (" is also tied to this pin" ); SERIAL_ECHO_SP (14 ); }
235
+ void err_is_counter () { SERIAL_ECHOPGM (" non-standard PWM mode" ); }
236
+ void err_is_interrupt () { SERIAL_ECHOPGM (" compare interrupt enabled" ); }
237
+ void err_prob_interrupt () { SERIAL_ECHOPGM (" overflow interrupt enabled" ); }
238
+ void print_is_also_tied () { SERIAL_ECHOPGM (" is also tied to this pin" ); SERIAL_ECHO_SP (14 ); }
239
239
240
- inline void com_print (const uint8_t N , const uint8_t Z ) {
240
+ void com_print (const uint8_t N , const uint8_t Z ) {
241
241
const uint8_t * TCCRA = (uint8_t * )TCCR_A (N );
242
242
SERIAL_ECHOPGM (" COM" , AS_DIGIT (N ));
243
243
SERIAL_CHAR (Z );
@@ -279,7 +279,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
279
279
if (TEST (* TMSK , TOIE )) err_prob_interrupt ();
280
280
}
281
281
282
- static void pwm_details (uint8_t pin ) {
282
+ void pwm_details (uint8_t pin ) {
283
283
switch (digitalPinToTimer_DEBUG (pin )) {
284
284
285
285
#if ABTEST (0 )
@@ -353,47 +353,41 @@ static void pwm_details(uint8_t pin) {
353
353
} // pwm_details
354
354
355
355
#ifndef digitalRead_mod // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs
356
- int digitalRead_mod (const int8_t pin ) { // same as digitalRead except the PWM stop section has been removed
356
+ int digitalRead_mod (const pin_t pin ) { // same as digitalRead except the PWM stop section has been removed
357
357
const uint8_t port = digitalPinToPort_DEBUG (pin );
358
358
return (port != NOT_A_PIN ) && (* portInputRegister (port ) & digitalPinToBitMask_DEBUG (pin )) ? HIGH : LOW ;
359
359
}
360
360
#endif
361
361
362
- #ifndef PRINT_PORT
363
-
364
- void print_port (int8_t pin ) { // print port number
365
- #ifdef digitalPinToPort_DEBUG
366
- uint8_t x ;
367
- SERIAL_ECHOPGM (" Port: " );
368
- #if AVR_AT90USB1286_FAMILY
369
- x = (pin == 46 || pin == 47 ) ? 'E' : digitalPinToPort_DEBUG (pin ) + 64 ;
370
- #else
371
- x = digitalPinToPort_DEBUG (pin ) + 64 ;
372
- #endif
373
- SERIAL_CHAR (x );
374
-
375
- #if AVR_AT90USB1286_FAMILY
376
- if (pin == 46 )
377
- x = '2' ;
378
- else if (pin == 47 )
379
- x = '3' ;
380
- else {
381
- uint8_t temp = digitalPinToBitMask_DEBUG (pin );
382
- for (x = '0' ; x < '9' && temp != 1 ; x ++ ) temp >>= 1 ;
383
- }
384
- #else
362
+ void print_port (const pin_t pin ) { // print port number
363
+ #ifdef digitalPinToPort_DEBUG
364
+ uint8_t x ;
365
+ SERIAL_ECHOPGM (" Port: " );
366
+ #if AVR_AT90USB1286_FAMILY
367
+ x = (pin == 46 || pin == 47 ) ? 'E' : digitalPinToPort_DEBUG (pin ) + 64 ;
368
+ #else
369
+ x = digitalPinToPort_DEBUG (pin ) + 64 ;
370
+ #endif
371
+ SERIAL_CHAR (x );
372
+
373
+ #if AVR_AT90USB1286_FAMILY
374
+ if (pin == 46 )
375
+ x = '2' ;
376
+ else if (pin == 47 )
377
+ x = '3' ;
378
+ else {
385
379
uint8_t temp = digitalPinToBitMask_DEBUG (pin );
386
380
for (x = '0' ; x < '9' && temp != 1 ; x ++ ) temp >>= 1 ;
387
- #endif
388
- SERIAL_CHAR (x );
381
+ }
389
382
#else
390
- SERIAL_ECHO_SP (10 );
383
+ uint8_t temp = digitalPinToBitMask_DEBUG (pin );
384
+ for (x = '0' ; x < '9' && temp != 1 ; x ++ ) temp >>= 1 ;
391
385
#endif
392
- }
393
-
394
- #define PRINT_PORT ( p ) print_port(p)
395
-
396
- #endif
386
+ SERIAL_CHAR ( x );
387
+ #else
388
+ SERIAL_ECHO_SP ( 10 );
389
+ #endif
390
+ }
397
391
398
392
#define PRINT_PIN (p ) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
399
393
#define PRINT_PIN_ANALOG (p ) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
0 commit comments