Open karlo922 opened 7 months ago
I now got it working with just compiling everything u8g2 related as pure C and only doing the rest of my program in C++. So you can still answer if you may help others searching it, or we can close it :)
Sorry for the late reply. I'm writing my Ph.D. thesis recently.
It's great that the solution worked for the pure C code. The C++ wrapper is automatically generated from the tool codebuild
https://github.com/wuhanstudio/u8g2-arm-linux/tree/master/tools/codebuild
It looks like the C++ code does not work because the variable u8g2_t u8g2
is defined as a protected
member. Thus, the reference to the pins cannot be modified from the outside of the class.
class U8G2: public Print {
protected:
u8g2_t u8g2;
u8x8_char_cb cpp_next_cb; /* the cpp interface has its own decoding function for the Arduino print command */
Besides, the u8g2_t
is a struct defined in:
https://github.com/wuhanstudio/u8g2-arm-linux/blob/master/csrc/u8g2.h
typedef struct u8g2_struct u8g2_t;
Hi,
you helped me solving the issue with me master/slave display by suggesting following:
This works for the "C" version, but does not for "CPP". As I need to switch to C++ for my project - could you help me how I could achieve the same with C++?