Hi,
I've spent some time making two of my SSD1306 displays work with u8g2 library using two different i2c ports (Wire & Wire1) on Teensy 4.1 and wanted to share my experience.
The author of this library seems to assume that there is a #define WIRE_INTERFACES_COUNT 3 somewhere in the board definition and only then enables the functionality. Without it the U8G2_SSD1306_128X64_NONAME_F_2ND_HW_I2C constructor creates a no-op object.
The issue is mentioned here but in the context of Teensy 3.x and i2c_t3 (that does not support Teensy 4.x).
I worked around the problem by commenting out the relevant check in U8x8lib.cpp:
Not sure if #define WIRE_INTERFACES_COUNT 3 is a standard practice but maybe it is worth adding it? I took a shot at it but I'm not sure where to put it, and platformio does not make it easy to edit those files.
I've spent some time making two of my SSD1306 displays work with u8g2 library using two different i2c ports (Wire & Wire1) on Teensy 4.1 and wanted to share my experience.
The author of this library seems to assume that there is a #define WIRE_INTERFACES_COUNT 3 somewhere in the board definition and only then enables the functionality. Without it the U8G2_SSD1306_128X64_NONAME_F_2ND_HW_I2C constructor creates a no-op object.
The issue is mentioned here but in the context of Teensy 3.x and i2c_t3 (that does not support Teensy 4.x).
I worked around the problem by commenting out the relevant check in U8x8lib.cpp:
Code:
extern "C" uint8_t u8x8_byte_arduino_2nd_hw_i2c(U8X8_UNUSED u8x8_t *u8x8, U8X8_UNUSED uint8_t msg, U8X8_UNUSED uint8_t arg_int, U8X8_UNUSED void *arg_ptr)
{
// #ifdef U8X8_HAVE_2ND_HW_I2C
switch(msg)
{
...
// #endif
return 1;
}
Not sure if #define WIRE_INTERFACES_COUNT 3 is a standard practice but maybe it is worth adding it? I took a shot at it but I'm not sure where to put it, and platformio does not make it easy to edit those files.