From 3f16da4618de185925b6da2a517c316ccee9df12 Mon Sep 17 00:00:00 2001 From: kgy2002 <46291300+kgy2002@users.noreply.github.com> Date: Tue, 23 Mar 2021 02:50:43 -0700 Subject: [PATCH 1/2] Update u8g_ll_api.c Replace u8g_Begin with u8g_UpdateDimension per comment --- src/clib/u8g_ll_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/clib/u8g_ll_api.c b/src/clib/u8g_ll_api.c index 715e89c..f690951 100755 --- a/src/clib/u8g_ll_api.c +++ b/src/clib/u8g_ll_api.c @@ -252,7 +252,8 @@ uint8_t u8g_InitSPI(u8g_t *u8g, u8g_dev_t *dev, uint8_t sck, uint8_t mosi, uint8 /* if - in future releases - this is removed, then still call u8g_UpdateDimension() */ /* if Arduino call u8g_UpdateDimension else u8g_Begin */ /* issue 146 */ - return u8g_Begin(u8g); + u8g_UpdateDimension(u8g); + return 1; } uint8_t u8g_InitHWSPI(u8g_t *u8g, u8g_dev_t *dev, uint8_t cs, uint8_t a0, uint8_t reset) From a16fe43bce6b55d1bf9db0c27fa85f92e73d2a18 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 24 Mar 2021 08:06:42 -0500 Subject: [PATCH 2/2] check ARDUINO flag --- src/clib/u8g_ll_api.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/clib/u8g_ll_api.c b/src/clib/u8g_ll_api.c index f690951..b920560 100755 --- a/src/clib/u8g_ll_api.c +++ b/src/clib/u8g_ll_api.c @@ -204,7 +204,12 @@ uint8_t u8g_Init(u8g_t *u8g, u8g_dev_t *dev) /* if - in future releases - this is removed, then still call u8g_UpdateDimension() */ /* if Arduino call u8g_UpdateDimension else u8g_Begin */ /* issue 146 */ - return u8g_Begin(u8g); + #ifdef ARDUINO + u8g_UpdateDimension(u8g); + return 1; + #else + return u8g_Begin(u8g); + #endif } /* special init for pure ARM systems */ @@ -229,7 +234,12 @@ uint8_t u8g_InitComFn(u8g_t *u8g, u8g_dev_t *dev, u8g_com_fnptr com_fn) /* if - in future releases - this is removed, then still call u8g_UpdateDimension() */ /* if Arduino call u8g_UpdateDimension else u8g_Begin */ /* issue 146 */ - return u8g_Begin(u8g); + #ifdef ARDUINO + u8g_UpdateDimension(u8g); + return 1; + #else + return u8g_Begin(u8g); + #endif } @@ -252,8 +262,12 @@ uint8_t u8g_InitSPI(u8g_t *u8g, u8g_dev_t *dev, uint8_t sck, uint8_t mosi, uint8 /* if - in future releases - this is removed, then still call u8g_UpdateDimension() */ /* if Arduino call u8g_UpdateDimension else u8g_Begin */ /* issue 146 */ - u8g_UpdateDimension(u8g); - return 1; + #ifdef ARDUINO + u8g_UpdateDimension(u8g); + return 1; + #else + return u8g_Begin(u8g); + #endif } uint8_t u8g_InitHWSPI(u8g_t *u8g, u8g_dev_t *dev, uint8_t cs, uint8_t a0, uint8_t reset)