i2cdevlib
i2cdevlib copied to clipboard
unclear macro definition
I see strange definitions in the lines 109-113 of the header https://github.com/jrowberg/i2cdevlib/blob/master/ESP32_ESP-IDF/components/MPU6050/MPU6050_6Axis_MotionApps20.h
#define HEX "f"
#define DEBUG_PRINT(x) printf("%d", x)
#define DEBUG_PRINTF(x, y) Serial.print(x, y)
#define DEBUG_PRINTLN(x) printf("%s\n", x)
#define DEBUG_PRINTLNF(x, y) printf("%#06x%s\n", x, y)
There are a lot of calls like DEBUG_PRINTLNF(getIntStatus(), HEX); in the library.
As a result "f" is concatenated to the real getIntStatus() value.
For example, if the status is 1 - I see: "Current interrupt status - 0x0001f".
It is misleading.
What is a purpose of such behaviour?