[riot-notifications] [RIOT-OS/RIOT] U8g2: Refactoring and minor fixes (#10693)
notifications at github.com
Mon Jan 14 19:20:21 CET 2019
pvyleta commented on this pull request.
- i2c_t dev = (i2c_t) u8g2->dev;
+ i2c_t dev = I2C_DEV(u8x8_riot_ptr->device_index);
Sorry, I do not understand exactly how and why to do so. The code you are referring is for the test, but the original code is from the actual package. If I somehow select the bus (SPI or I2C) in makefile, then I would remove the possibility to have two displays, one on SPI and one on I2C at the same time - and that is something I would like to avoid.
In my proposal of the implementation, the user is simply selecting the bus by selecting the callback, and in the provided structure, they only need to provide the "index" of the selected bus.
One solution which comes to my mind is to provide both i2c_t and spi_t variables in the user structure, and the user would have to fill in the one corresponding to the desired bus - would that be a suitable option?
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications