[riot-notifications] [RIOT-OS/RIOT] U8g2: Refactoring and minor fixes (#10693)

Petr notifications at github.com
Thu Jan 3 18:16:58 CET 2019


pvyleta commented on this pull request.



> @@ -6,10 +6,10 @@
 The library is originally written for Arduino boards, but it runs just fine on other platforms, as long as the right drivers are available.
 
 ## Usage
-Just put `USEPKG += u8g2` in your Makefile and `#include "u8g2.h"` to your code. Refer to the [U8g2 wiki](https://github.com/olikraus/u8g2/wiki) for more information on the API.
+Just put `USEPKG += u8g2` in your Makefile and `#include "u8g2.h"` into your code. In case you intend to use SPI/I2C, you should put `#include "u8x8_riot.h"` in your code as well, and use the methods efined there. Refer to the [U8g2 wiki](https://github.com/olikraus/u8g2/wiki) for more information on the API.

I was considering the possible drawbacks of adding new header, but in the end reached a conclusion, that I am not breaking anything. The header is not included anywhere in th U8g2 code, it is only to provide Riot-comaptible callbacks for the U8g2. In reality, the header could be defined elsewhere, completely out of the U8g2 itself and it would still work.

I have also considered the fact, that the user must now include additional header, but it seems to me more clear, than to "inject" riot-dependency into U8g2 itself, which is in my opinion more difficult to maintain if new versions of U8g2 are to be used.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10693#discussion_r245070584
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190103/cab541a3/attachment-0001.html>


More information about the notifications mailing list