Browse Source

Cleanup spacing in pinsDebug.h

pull/1/head
Scott Lahteine 8 years ago
parent
commit
46b714a52f
  1. 34
      Marlin/pinsDebug.h

34
Marlin/pinsDebug.h

@ -51,11 +51,8 @@ bool endstop_monitor_flag = false;
#define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER)
#define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER)
#line 0 // set __LINE__ to a known value for the first pass
#include "pinsDebug_list.h"
#line 59 // set __LINE__ to the correct line number or else compiler error messages don't make sense
#line 56
// manually add pins that have names that are macros which don't play well with these macros
#if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY)
@ -77,7 +74,6 @@ bool endstop_monitor_flag = false;
#define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN(NAME, COUNTER, (uint8_t)1)
#define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(analogInputToDigitalPin(NAME), COUNTER, 0)
const char* const pin_array[][3] PROGMEM = {
/**
@ -100,21 +96,18 @@ const char* const pin_array[][3] PROGMEM = {
#endif
#endif
#line 0 // set __LINE__ to the SAME known value for the second pass
#include "pinsDebug_list.h"
#line 101
}; // done populating the array
#line 109 // set __LINE__ to the correct line number or else compiler error messages don't make sense
};
#define n_array (sizeof (pin_array) / sizeof (const char *))/3
#define n_array (sizeof(pin_array) / sizeof(char*)) / 3
#ifndef TIMER1B
// working with Teensyduino extension so need to re-define some things
#include "pinsDebug_Teensyduino.h"
#endif
#define PWM_PRINT(V) do{ sprintf(buffer, "PWM: %4d", V); SERIAL_ECHO(buffer); }while(0)
#define PWM_CASE(N,Z) \
case TIMER##N##Z: \
@ -176,11 +169,10 @@ static bool pwm_status(uint8_t pin) {
default:
return false;
}
SERIAL_PROTOCOLPGM(" ");
SERIAL_PROTOCOL_SP(2);
} // pwm_status
const volatile uint8_t* const PWM_other[][3] PROGMEM = {
{ &TCCR0A, &TCCR0B, &TIMSK0 },
{ &TCCR1A, &TCCR1B, &TIMSK1 },
@ -247,19 +239,11 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
#define WGM_3 4
#define TOIE 0
#define OCR_VAL(T, L) pgm_read_word(&PWM_OCR[T][L])
static void err_is_counter() {
SERIAL_PROTOCOLPGM(" non-standard PWM mode");
}
static void err_is_interrupt() {
SERIAL_PROTOCOLPGM(" compare interrupt enabled");
}
static void err_prob_interrupt() {
SERIAL_PROTOCOLPGM(" overflow interrupt enabled");
}
static void err_is_counter() { SERIAL_PROTOCOLPGM(" non-standard PWM mode"); }
static void err_is_interrupt() { SERIAL_PROTOCOLPGM(" compare interrupt enabled"); }
static void err_prob_interrupt() { SERIAL_PROTOCOLPGM(" overflow interrupt enabled"); }
void com_print(uint8_t N, uint8_t Z) {
uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
@ -288,7 +272,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
SERIAL_PROTOCOLPGM(" TIMER");
SERIAL_PROTOCOLCHAR(T + '0');
SERIAL_PROTOCOLCHAR(L);
SERIAL_PROTOCOLPGM(" ");
SERIAL_PROTOCOL_SP(3);
if (N == 3) {
uint8_t *OCRVAL8 = (uint8_t*)OCR_VAL(T, L - 'A');

Loading…
Cancel
Save