Open Bob-the-Kuhn opened 6 years ago
I do not much remember the old u8glib code. Flexible pin handling was only there with the Arduino variant. Going back to the old code would probably cost much more than 15min :-(
What is the reason why u8g2 requires more flash? Any measurements? What is the difference in bytes? One known problem is Wire.h. It is linked even if it is not used. To avoid this, you need to disable I2C in u8x8.h (u8g2 project, see FAQ).
Thanks for taking the time to answer. Much appreciated.
I have ARDUINO_AVR_DIGISPARK enabled which will disable U8X8_HAVE_HW_I2C. Even with that U8G2 is about 1300-1400 bytes more than U8G.
hmmm.. I see...
Don't spend more than 15 minutes on this. I have a solution but would like an easier to duplicate method.
U8G2 has a nice way of connecting a U8G2 device to a custom com function. Unfortunately U8G2 costs more FLASH than U8G so I'm stuck with U8G.
Is there a way of using u8g_InitComFn with a pin list? This would be using the U8glib-ARM library.
All the u8g_InitComFn examples I've found have the pins hard coded into the custom com function. I need something where I can pass in the pins.
The goal is to be able to attach a custom com function to an existing U8G device with minimal code. This is going to be repeated for multiple printers and multiple CPUs so easy to understand is highly desired.
I was hoping that something like this would work but so far no joy.
I have been able to copy existing device files, make some minor changes and include my custom com function there. The new device is called from the main function via a new class. Attached is one example. I was hoping there is an easier to follow method. U8G_custom_com.zip