🎨 Standardize G-code reporting
This commit is contained in:
committed by
Scott Lahteine
parent
a596faf4e5
commit
6d96c221bd
@ -235,7 +235,7 @@ static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin");
|
||||
|
||||
inline void com_print(const uint8_t N, const uint8_t Z) {
|
||||
const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
|
||||
SERIAL_ECHOPAIR(" COM", AS_CHAR('0' + N));
|
||||
SERIAL_ECHOPAIR(" COM", AS_DIGIT(N));
|
||||
SERIAL_CHAR(Z);
|
||||
SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03));
|
||||
}
|
||||
@ -247,7 +247,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
|
||||
uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1))));
|
||||
if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
|
||||
|
||||
SERIAL_ECHOPAIR(" TIMER", AS_CHAR(T + '0'));
|
||||
SERIAL_ECHOPAIR(" TIMER", AS_DIGIT(T));
|
||||
SERIAL_CHAR(L);
|
||||
SERIAL_ECHO_SP(3);
|
||||
|
||||
@ -262,11 +262,11 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
|
||||
SERIAL_ECHOPAIR(" WGM: ", WGM);
|
||||
com_print(T,L);
|
||||
SERIAL_ECHOPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) ));
|
||||
SERIAL_ECHOPAIR(" TCCR", AS_CHAR(T + '0'), "A: ", *TCCRA);
|
||||
SERIAL_ECHOPAIR(" TCCR", AS_CHAR(T + '0'), "B: ", *TCCRB);
|
||||
SERIAL_ECHOPAIR(" TCCR", AS_DIGIT(T), "A: ", *TCCRA);
|
||||
SERIAL_ECHOPAIR(" TCCR", AS_DIGIT(T), "B: ", *TCCRB);
|
||||
|
||||
const uint8_t *TMSK = (uint8_t*)TIMSK(T);
|
||||
SERIAL_ECHOPAIR(" TIMSK", AS_CHAR(T + '0'), ": ", *TMSK);
|
||||
SERIAL_ECHOPAIR(" TIMSK", AS_DIGIT(T), ": ", *TMSK);
|
||||
|
||||
const uint8_t OCIE = L - 'A' + 1;
|
||||
if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); }
|
||||
|
Reference in New Issue
Block a user