🎨 Apply F() to various reports
This commit is contained in:
@ -1609,7 +1609,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
||||
}
|
||||
|
||||
if (DEBUGGING(LEVELING)) {
|
||||
rotation.debug(PSTR("rotation matrix:\n"));
|
||||
rotation.debug(F("rotation matrix:\n"));
|
||||
DEBUG_ECHOPAIR_F("LSF Results A=", lsf_results.A, 7);
|
||||
DEBUG_ECHOPAIR_F(" B=", lsf_results.B, 7);
|
||||
DEBUG_ECHOLNPAIR_F(" D=", lsf_results.D, 7);
|
||||
@ -1636,14 +1636,14 @@ void unified_bed_leveling::smart_fill_mesh() {
|
||||
auto normed = [&](const xy_pos_t &pos, const_float_t zadd) {
|
||||
return normal.x * pos.x + normal.y * pos.y + zadd;
|
||||
};
|
||||
auto debug_pt = [](PGM_P const pre, const xy_pos_t &pos, const_float_t zadd) {
|
||||
d_from(); SERIAL_ECHOPGM_P(pre);
|
||||
auto debug_pt = [](FSTR_P const pre, const xy_pos_t &pos, const_float_t zadd) {
|
||||
d_from(); SERIAL_ECHOF(pre);
|
||||
DEBUG_ECHO_F(normed(pos, zadd), 6);
|
||||
DEBUG_ECHOLNPAIR_F(" Z error = ", zadd - get_z_correction(pos), 6);
|
||||
};
|
||||
debug_pt(PSTR("1st point: "), probe_pt[0], normal.z * z1);
|
||||
debug_pt(PSTR("2nd point: "), probe_pt[1], normal.z * z2);
|
||||
debug_pt(PSTR("3rd point: "), probe_pt[2], normal.z * z3);
|
||||
debug_pt(F("1st point: "), probe_pt[0], normal.z * z1);
|
||||
debug_pt(F("2nd point: "), probe_pt[1], normal.z * z2);
|
||||
debug_pt(F("3rd point: "), probe_pt[2], normal.z * z3);
|
||||
d_from(); DEBUG_ECHOPGM("safe home with Z=");
|
||||
DEBUG_ECHOLNPAIR_F("0 : ", normed(safe_homing_xy, 0), 6);
|
||||
d_from(); DEBUG_ECHOPGM("safe home with Z=");
|
||||
|
@ -124,11 +124,10 @@ uint8_t Max7219::suspended; // = 0;
|
||||
#define SIG_DELAY() DELAY_NS(250)
|
||||
#endif
|
||||
|
||||
void Max7219::error(const char * const func, const int32_t v1, const int32_t v2/*=-1*/) {
|
||||
void Max7219::error(FSTR_P const func, const int32_t v1, const int32_t v2/*=-1*/) {
|
||||
#if ENABLED(MAX7219_ERRORS)
|
||||
SERIAL_ECHOPGM("??? Max7219::");
|
||||
SERIAL_ECHOPGM_P(func);
|
||||
SERIAL_CHAR('(');
|
||||
SERIAL_ECHOF(func, AS_CHAR('('));
|
||||
SERIAL_ECHO(v1);
|
||||
if (v2 > 0) SERIAL_ECHOPGM(", ", v2);
|
||||
SERIAL_CHAR(')');
|
||||
@ -268,24 +267,24 @@ void Max7219::set(const uint8_t line, const uint8_t bits) {
|
||||
|
||||
// Modify a single LED bit and send the changed line
|
||||
void Max7219::led_set(const uint8_t x, const uint8_t y, const bool on) {
|
||||
if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(PSTR("led_set"), x, y);
|
||||
if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(F("led_set"), x, y);
|
||||
if (BIT_7219(x, y) == on) return;
|
||||
XOR_7219(x, y);
|
||||
refresh_unit_line(LED_IND(x, y));
|
||||
}
|
||||
|
||||
void Max7219::led_on(const uint8_t x, const uint8_t y) {
|
||||
if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(PSTR("led_on"), x, y);
|
||||
if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(F("led_on"), x, y);
|
||||
led_set(x, y, true);
|
||||
}
|
||||
|
||||
void Max7219::led_off(const uint8_t x, const uint8_t y) {
|
||||
if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(PSTR("led_off"), x, y);
|
||||
if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(F("led_off"), x, y);
|
||||
led_set(x, y, false);
|
||||
}
|
||||
|
||||
void Max7219::led_toggle(const uint8_t x, const uint8_t y) {
|
||||
if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(PSTR("led_toggle"), x, y);
|
||||
if (x >= MAX7219_X_LEDS || y >= MAX7219_Y_LEDS) return error(F("led_toggle"), x, y);
|
||||
led_set(x, y, !BIT_7219(x, y));
|
||||
}
|
||||
|
||||
@ -328,13 +327,13 @@ void Max7219::fill() {
|
||||
}
|
||||
|
||||
void Max7219::clear_row(const uint8_t row) {
|
||||
if (row >= MAX7219_Y_LEDS) return error(PSTR("clear_row"), row);
|
||||
if (row >= MAX7219_Y_LEDS) return error(F("clear_row"), row);
|
||||
LOOP_L_N(x, MAX7219_X_LEDS) CLR_7219(x, row);
|
||||
send_row(row);
|
||||
}
|
||||
|
||||
void Max7219::clear_column(const uint8_t col) {
|
||||
if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col);
|
||||
if (col >= MAX7219_X_LEDS) return error(F("set_column"), col);
|
||||
LOOP_L_N(y, MAX7219_Y_LEDS) CLR_7219(col, y);
|
||||
send_column(col);
|
||||
}
|
||||
@ -345,7 +344,7 @@ void Max7219::clear_column(const uint8_t col) {
|
||||
* once with a single call to the function (if rotated 90° or 270°).
|
||||
*/
|
||||
void Max7219::set_row(const uint8_t row, const uint32_t val) {
|
||||
if (row >= MAX7219_Y_LEDS) return error(PSTR("set_row"), row);
|
||||
if (row >= MAX7219_Y_LEDS) return error(F("set_row"), row);
|
||||
uint32_t mask = _BV32(MAX7219_X_LEDS - 1);
|
||||
LOOP_L_N(x, MAX7219_X_LEDS) {
|
||||
if (val & mask) SET_7219(x, row); else CLR_7219(x, row);
|
||||
@ -360,7 +359,7 @@ void Max7219::set_row(const uint8_t row, const uint32_t val) {
|
||||
* once with a single call to the function (if rotated 0° or 180°).
|
||||
*/
|
||||
void Max7219::set_column(const uint8_t col, const uint32_t val) {
|
||||
if (col >= MAX7219_X_LEDS) return error(PSTR("set_column"), col);
|
||||
if (col >= MAX7219_X_LEDS) return error(F("set_column"), col);
|
||||
uint32_t mask = _BV32(MAX7219_Y_LEDS - 1);
|
||||
LOOP_L_N(y, MAX7219_Y_LEDS) {
|
||||
if (val & mask) SET_7219(col, y); else CLR_7219(col, y);
|
||||
@ -371,56 +370,56 @@ void Max7219::set_column(const uint8_t col, const uint32_t val) {
|
||||
|
||||
void Max7219::set_rows_16bits(const uint8_t y, uint32_t val) {
|
||||
#if MAX7219_X_LEDS == 8
|
||||
if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_16bits"), y, val);
|
||||
if (y > MAX7219_Y_LEDS - 2) return error(F("set_rows_16bits"), y, val);
|
||||
set_row(y + 1, val); val >>= 8;
|
||||
set_row(y + 0, val);
|
||||
#else // at least 16 bits on each row
|
||||
if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_16bits"), y, val);
|
||||
if (y > MAX7219_Y_LEDS - 1) return error(F("set_rows_16bits"), y, val);
|
||||
set_row(y, val);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Max7219::set_rows_32bits(const uint8_t y, uint32_t val) {
|
||||
#if MAX7219_X_LEDS == 8
|
||||
if (y > MAX7219_Y_LEDS - 4) return error(PSTR("set_rows_32bits"), y, val);
|
||||
if (y > MAX7219_Y_LEDS - 4) return error(F("set_rows_32bits"), y, val);
|
||||
set_row(y + 3, val); val >>= 8;
|
||||
set_row(y + 2, val); val >>= 8;
|
||||
set_row(y + 1, val); val >>= 8;
|
||||
set_row(y + 0, val);
|
||||
#elif MAX7219_X_LEDS == 16
|
||||
if (y > MAX7219_Y_LEDS - 2) return error(PSTR("set_rows_32bits"), y, val);
|
||||
if (y > MAX7219_Y_LEDS - 2) return error(F("set_rows_32bits"), y, val);
|
||||
set_row(y + 1, val); val >>= 16;
|
||||
set_row(y + 0, val);
|
||||
#else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits
|
||||
if (y > MAX7219_Y_LEDS - 1) return error(PSTR("set_rows_32bits"), y, val);
|
||||
if (y > MAX7219_Y_LEDS - 1) return error(F("set_rows_32bits"), y, val);
|
||||
set_row(y, val);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Max7219::set_columns_16bits(const uint8_t x, uint32_t val) {
|
||||
#if MAX7219_Y_LEDS == 8
|
||||
if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_columns_16bits"), x, val);
|
||||
if (x > MAX7219_X_LEDS - 2) return error(F("set_columns_16bits"), x, val);
|
||||
set_column(x + 0, val); val >>= 8;
|
||||
set_column(x + 1, val);
|
||||
#else // at least 16 bits in each column
|
||||
if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_columns_16bits"), x, val);
|
||||
if (x > MAX7219_X_LEDS - 1) return error(F("set_columns_16bits"), x, val);
|
||||
set_column(x, val);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Max7219::set_columns_32bits(const uint8_t x, uint32_t val) {
|
||||
#if MAX7219_Y_LEDS == 8
|
||||
if (x > MAX7219_X_LEDS - 4) return error(PSTR("set_rows_32bits"), x, val);
|
||||
if (x > MAX7219_X_LEDS - 4) return error(F("set_rows_32bits"), x, val);
|
||||
set_column(x + 3, val); val >>= 8;
|
||||
set_column(x + 2, val); val >>= 8;
|
||||
set_column(x + 1, val); val >>= 8;
|
||||
set_column(x + 0, val);
|
||||
#elif MAX7219_Y_LEDS == 16
|
||||
if (x > MAX7219_X_LEDS - 2) return error(PSTR("set_rows_32bits"), x, val);
|
||||
if (x > MAX7219_X_LEDS - 2) return error(F("set_rows_32bits"), x, val);
|
||||
set_column(x + 1, val); val >>= 16;
|
||||
set_column(x + 0, val);
|
||||
#else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits
|
||||
if (x > MAX7219_X_LEDS - 1) return error(PSTR("set_rows_32bits"), x, val);
|
||||
if (x > MAX7219_X_LEDS - 1) return error(F("set_rows_32bits"), x, val);
|
||||
set_column(x, val);
|
||||
#endif
|
||||
}
|
||||
|
@ -42,6 +42,8 @@
|
||||
* a Max7219_Set_Row(). The opposite is true for rotations of 0 or 180 degrees.
|
||||
*/
|
||||
|
||||
#include "../inc/MarlinConfig.h"
|
||||
|
||||
#ifndef MAX7219_ROTATE
|
||||
#define MAX7219_ROTATE 0
|
||||
#endif
|
||||
@ -140,7 +142,7 @@ public:
|
||||
|
||||
private:
|
||||
static uint8_t suspended;
|
||||
static void error(const char * const func, const int32_t v1, const int32_t v2=-1);
|
||||
static void error(FSTR_P const func, const int32_t v1, const int32_t v2=-1);
|
||||
static void noop();
|
||||
static void set(const uint8_t line, const uint8_t bits);
|
||||
static void send_row(const uint8_t row);
|
||||
|
@ -130,7 +130,7 @@ void PrintJobRecovery::load() {
|
||||
(void)file.read(&info, sizeof(info));
|
||||
close();
|
||||
}
|
||||
debug(PSTR("Load"));
|
||||
debug(F("Load"));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -311,7 +311,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW
|
||||
*/
|
||||
void PrintJobRecovery::write() {
|
||||
|
||||
debug(PSTR("Write"));
|
||||
debug(F("Write"));
|
||||
|
||||
open(false);
|
||||
file.seekSet(0);
|
||||
@ -575,8 +575,8 @@ void PrintJobRecovery::resume() {
|
||||
|
||||
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
||||
|
||||
void PrintJobRecovery::debug(PGM_P const prefix) {
|
||||
DEBUG_ECHOPGM_P(prefix);
|
||||
void PrintJobRecovery::debug(FSTR_P const prefix) {
|
||||
DEBUG_ECHOF(prefix);
|
||||
DEBUG_ECHOLNPGM(" Job Recovery Info...\nvalid_head:", info.valid_head, " valid_foot:", info.valid_foot);
|
||||
if (info.valid_head) {
|
||||
if (info.valid_head == info.valid_foot) {
|
||||
|
@ -204,9 +204,9 @@ class PrintJobRecovery {
|
||||
static inline bool valid() { return info.valid() && interrupted_file_exists(); }
|
||||
|
||||
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
||||
static void debug(PGM_P const prefix);
|
||||
static void debug(FSTR_P const prefix);
|
||||
#else
|
||||
static inline void debug(PGM_P const) {}
|
||||
static inline void debug(FSTR_P const) {}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
@ -28,11 +28,11 @@
|
||||
|
||||
static uint32_t axis_plug_backward = 0;
|
||||
|
||||
void stepper_driver_backward_error(PGM_P str) {
|
||||
void stepper_driver_backward_error(FSTR_P const fstr) {
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ECHOPGM_P(str);
|
||||
SERIAL_ECHOF(fstr);
|
||||
SERIAL_ECHOLNPGM(" driver is backward!");
|
||||
ui.status_printf(2, F(S_FMT S_FMT), str, GET_TEXT(MSG_DRIVER_BACKWARD));
|
||||
ui.status_printf(2, F(S_FMT S_FMT), FTOP(fstr), GET_TEXT(MSG_DRIVER_BACKWARD));
|
||||
}
|
||||
|
||||
void stepper_driver_backward_check() {
|
||||
@ -45,7 +45,7 @@ void stepper_driver_backward_check() {
|
||||
delay(20); \
|
||||
if (READ(AXIS##_ENABLE_PIN) == false) { \
|
||||
SBI(axis_plug_backward, BIT); \
|
||||
stepper_driver_backward_error(PSTR(STRINGIFY(AXIS))); \
|
||||
stepper_driver_backward_error(F(STRINGIFY(AXIS))); \
|
||||
} \
|
||||
}while(0)
|
||||
|
||||
@ -82,12 +82,12 @@ void stepper_driver_backward_check() {
|
||||
void stepper_driver_backward_report() {
|
||||
if (!axis_plug_backward) return;
|
||||
|
||||
auto _report_if_backward = [](PGM_P axis, uint8_t bit) {
|
||||
auto _report_if_backward = [](FSTR_P const axis, uint8_t bit) {
|
||||
if (TEST(axis_plug_backward, bit))
|
||||
stepper_driver_backward_error(axis);
|
||||
};
|
||||
|
||||
#define REPORT_BACKWARD(axis, bit) TERN_(HAS_##axis##_ENABLE, _report_if_backward(PSTR(STRINGIFY(axis)), bit))
|
||||
#define REPORT_BACKWARD(axis, bit) TERN_(HAS_##axis##_ENABLE, _report_if_backward(F(STRINGIFY(axis)), bit))
|
||||
|
||||
REPORT_BACKWARD(X, 0);
|
||||
REPORT_BACKWARD(X2, 1);
|
||||
|
@ -51,27 +51,27 @@ void TWIBus::address(const uint8_t adr) {
|
||||
|
||||
addr = adr;
|
||||
|
||||
debug(PSTR("address"), adr);
|
||||
debug(F("address"), adr);
|
||||
}
|
||||
|
||||
void TWIBus::addbyte(const char c) {
|
||||
if (buffer_s >= COUNT(buffer)) return;
|
||||
buffer[buffer_s++] = c;
|
||||
debug(PSTR("addbyte"), c);
|
||||
debug(F("addbyte"), c);
|
||||
}
|
||||
|
||||
void TWIBus::addbytes(char src[], uint8_t bytes) {
|
||||
debug(PSTR("addbytes"), bytes);
|
||||
debug(F("addbytes"), bytes);
|
||||
while (bytes--) addbyte(*src++);
|
||||
}
|
||||
|
||||
void TWIBus::addstring(char str[]) {
|
||||
debug(PSTR("addstring"), str);
|
||||
debug(F("addstring"), str);
|
||||
while (char c = *str++) addbyte(c);
|
||||
}
|
||||
|
||||
void TWIBus::send() {
|
||||
debug(PSTR("send"), addr);
|
||||
debug(F("send"), addr);
|
||||
|
||||
Wire.beginTransmission(I2C_ADDRESS(addr));
|
||||
Wire.write(buffer, buffer_s);
|
||||
@ -81,20 +81,20 @@ void TWIBus::send() {
|
||||
}
|
||||
|
||||
// static
|
||||
void TWIBus::echoprefix(uint8_t bytes, const char pref[], uint8_t adr) {
|
||||
void TWIBus::echoprefix(uint8_t bytes, FSTR_P const pref, uint8_t adr) {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM_P(pref);
|
||||
SERIAL_ECHOF(pref);
|
||||
SERIAL_ECHOPGM(": from:", adr, " bytes:", bytes, " data:");
|
||||
}
|
||||
|
||||
// static
|
||||
void TWIBus::echodata(uint8_t bytes, const char pref[], uint8_t adr) {
|
||||
void TWIBus::echodata(uint8_t bytes, FSTR_P const pref, uint8_t adr) {
|
||||
echoprefix(bytes, pref, adr);
|
||||
while (bytes-- && Wire.available()) SERIAL_CHAR(Wire.read());
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
void TWIBus::echobuffer(const char pref[], uint8_t adr) {
|
||||
void TWIBus::echobuffer(FSTR_P const pref, uint8_t adr) {
|
||||
echoprefix(buffer_s, pref, adr);
|
||||
LOOP_L_N(i, buffer_s) SERIAL_CHAR(buffer[i]);
|
||||
SERIAL_EOL();
|
||||
@ -103,11 +103,11 @@ void TWIBus::echobuffer(const char pref[], uint8_t adr) {
|
||||
bool TWIBus::request(const uint8_t bytes) {
|
||||
if (!addr) return false;
|
||||
|
||||
debug(PSTR("request"), bytes);
|
||||
debug(F("request"), bytes);
|
||||
|
||||
// requestFrom() is a blocking function
|
||||
if (Wire.requestFrom(I2C_ADDRESS(addr), bytes) == 0) {
|
||||
debug("request fail", I2C_ADDRESS(addr));
|
||||
debug(F("request fail"), I2C_ADDRESS(addr));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -115,10 +115,10 @@ bool TWIBus::request(const uint8_t bytes) {
|
||||
}
|
||||
|
||||
void TWIBus::relay(const uint8_t bytes) {
|
||||
debug(PSTR("relay"), bytes);
|
||||
debug(F("relay"), bytes);
|
||||
|
||||
if (request(bytes))
|
||||
echodata(bytes, PSTR("i2c-reply"), addr);
|
||||
echodata(bytes, F("i2c-reply"), addr);
|
||||
}
|
||||
|
||||
uint8_t TWIBus::capture(char *dst, const uint8_t bytes) {
|
||||
@ -127,7 +127,7 @@ uint8_t TWIBus::capture(char *dst, const uint8_t bytes) {
|
||||
while (count < bytes && Wire.available())
|
||||
dst[count++] = Wire.read();
|
||||
|
||||
debug(PSTR("capture"), count);
|
||||
debug(F("capture"), count);
|
||||
|
||||
return count;
|
||||
}
|
||||
@ -140,12 +140,12 @@ void TWIBus::flush() {
|
||||
#if I2C_SLAVE_ADDRESS > 0
|
||||
|
||||
void TWIBus::receive(uint8_t bytes) {
|
||||
debug(PSTR("receive"), bytes);
|
||||
echodata(bytes, PSTR("i2c-receive"), 0);
|
||||
debug(F("receive"), bytes);
|
||||
echodata(bytes, F("i2c-receive"), 0);
|
||||
}
|
||||
|
||||
void TWIBus::reply(char str[]/*=nullptr*/) {
|
||||
debug(PSTR("reply"), str);
|
||||
debug(F("reply"), str);
|
||||
|
||||
if (str) {
|
||||
reset();
|
||||
@ -170,18 +170,16 @@ void TWIBus::flush() {
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
|
||||
// static
|
||||
void TWIBus::prefix(const char func[]) {
|
||||
SERIAL_ECHOPGM("TWIBus::");
|
||||
SERIAL_ECHOPGM_P(func);
|
||||
SERIAL_ECHOPGM(": ");
|
||||
void TWIBus::prefix(FSTR_P const func) {
|
||||
SERIAL_ECHOPGM("TWIBus::", func, ": ");
|
||||
}
|
||||
void TWIBus::debug(const char func[], uint32_t adr) {
|
||||
void TWIBus::debug(FSTR_P const func, uint32_t adr) {
|
||||
if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(adr); }
|
||||
}
|
||||
void TWIBus::debug(const char func[], char c) {
|
||||
void TWIBus::debug(FSTR_P const func, char c) {
|
||||
if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(c); }
|
||||
}
|
||||
void TWIBus::debug(const char func[], char str[]) {
|
||||
void TWIBus::debug(FSTR_P const func, char str[]) {
|
||||
if (DEBUGGING(INFO)) { prefix(func); SERIAL_ECHOLN(str); }
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ class TWIBus {
|
||||
*
|
||||
* @param bytes the number of bytes to request
|
||||
*/
|
||||
static void echoprefix(uint8_t bytes, const char prefix[], uint8_t adr);
|
||||
static void echoprefix(uint8_t bytes, FSTR_P prefix, uint8_t adr);
|
||||
|
||||
/**
|
||||
* @brief Echo data on the bus to serial
|
||||
@ -151,7 +151,7 @@ class TWIBus {
|
||||
*
|
||||
* @param bytes the number of bytes to request
|
||||
*/
|
||||
static void echodata(uint8_t bytes, const char prefix[], uint8_t adr);
|
||||
static void echodata(uint8_t bytes, FSTR_P prefix, uint8_t adr);
|
||||
|
||||
/**
|
||||
* @brief Echo data in the buffer to serial
|
||||
@ -160,7 +160,7 @@ class TWIBus {
|
||||
*
|
||||
* @param bytes the number of bytes to request
|
||||
*/
|
||||
void echobuffer(const char prefix[], uint8_t adr);
|
||||
void echobuffer(FSTR_P prefix, uint8_t adr);
|
||||
|
||||
/**
|
||||
* @brief Request data from the slave device and wait.
|
||||
@ -237,17 +237,16 @@ class TWIBus {
|
||||
* @brief Prints a debug message
|
||||
* @details Prints a simple debug message "TWIBus::function: value"
|
||||
*/
|
||||
static void prefix(const char func[]);
|
||||
static void debug(const char func[], uint32_t adr);
|
||||
static void debug(const char func[], char c);
|
||||
static void debug(const char func[], char adr[]);
|
||||
static inline void debug(const char func[], uint8_t v) { debug(func, (uint32_t)v); }
|
||||
static void prefix(FSTR_P const func);
|
||||
static void debug(FSTR_P const func, uint32_t adr);
|
||||
static void debug(FSTR_P const func, char c);
|
||||
static void debug(FSTR_P const func, char adr[]);
|
||||
#else
|
||||
static inline void debug(const char[], uint32_t) {}
|
||||
static inline void debug(const char[], char) {}
|
||||
static inline void debug(const char[], char[]) {}
|
||||
static inline void debug(const char[], uint8_t) {}
|
||||
static inline void debug(FSTR_P const, uint32_t) {}
|
||||
static inline void debug(FSTR_P const, char) {}
|
||||
static inline void debug(FSTR_P const, char[]) {}
|
||||
#endif
|
||||
static inline void debug(FSTR_P const func, uint8_t v) { debug(func, (uint32_t)v); }
|
||||
};
|
||||
|
||||
extern TWIBus i2c;
|
||||
|
Reference in New Issue
Block a user