doc clarifications, code alignment with esp32

This commit is contained in:
devsaurus 2017-11-21 19:14:57 +01:00
parent adc08d17c3
commit 5f3e210f98
2 changed files with 8 additions and 5 deletions

View File

@ -12,6 +12,7 @@
#include "u8g2_fonts.h" #include "u8g2_fonts.h"
#ifdef ESP_PLATFORM #ifdef ESP_PLATFORM
// ESP32
#include "spi_common.h" #include "spi_common.h"
#include "sdkconfig.h" #include "sdkconfig.h"
@ -659,12 +660,14 @@ static int ldisplay_spi( lua_State *L, display_setup_fn_t setup_fn )
int stack = 0; int stack = 0;
#ifndef ESP_PLATFORM #ifndef ESP_PLATFORM
// ESP8266
typedef struct { typedef struct {
int host; int host;
} lspi_host_t; } lspi_host_t;
lspi_host_t host_elem; lspi_host_t host_elem;
lspi_host_t *host = &host_elem; lspi_host_t *host = &host_elem;
#else #else
// ESP32
lspi_host_t *host = NULL; lspi_host_t *host = NULL;
#endif #endif
int host_ref = LUA_NOREF; int host_ref = LUA_NOREF;
@ -680,12 +683,12 @@ static int ldisplay_spi( lua_State *L, display_setup_fn_t setup_fn )
/* reference host object to avoid automatic gc */ /* reference host object to avoid automatic gc */
lua_pushvalue( L, stack ); lua_pushvalue( L, stack );
host_ref = luaL_ref( L, LUA_REGISTRYINDEX ); host_ref = luaL_ref( L, LUA_REGISTRYINDEX );
get_spi_pins = TRUE; get_spi_pins = 1;
} else if (lua_type( L, stack ) == LUA_TNUMBER) { } else if (lua_type( L, stack ) == LUA_TNUMBER) {
host->host = luaL_checkint( L, stack ); host->host = luaL_checkint( L, stack );
get_spi_pins = TRUE; get_spi_pins = 1;
} else { } else {
get_spi_pins = FALSE; get_spi_pins = 0;
stack--; stack--;
} }

View File

@ -3,7 +3,7 @@
| :----- | :-------------------- | :---------- | :------ | | :----- | :-------------------- | :---------- | :------ |
| 2017-06-02 | [Oli Kraus](https://github.com/olikraus/u8glib), [Arnim Läuger](https://github.com/devsaurus) | [Arnim Läuger](https://github.com/devsaurus) | [u8g2.c](../../../apps/modules/u8g2.c)| | 2017-06-02 | [Oli Kraus](https://github.com/olikraus/u8glib), [Arnim Läuger](https://github.com/devsaurus) | [Arnim Läuger](https://github.com/devsaurus) | [u8g2.c](../../../apps/modules/u8g2.c)|
U8g2 is a graphics library developed at [olikraus/u8g2](https://github.com/olikraus/u8g2) with support for many different displays. It is the successor of [U8glib](https://github.com/olikraus/u8glib) which is not developed any further. U8g2 is a graphics library developed at [olikraus/u8g2](https://github.com/olikraus/u8g2) with support for many different displays. It is the successor of [U8glib](https://github.com/olikraus/u8glib) which is not developed any further. Please see [How to port U8g code](https://github.com/olikraus/u8g2/wiki/u8gvsu8g2) for generic porting instructions.
The NodeMCU firmware supports the following displays in I²C and SPI mode: The NodeMCU firmware supports the following displays in I²C and SPI mode:
@ -40,7 +40,7 @@ SPI only:
- st75256 - jlx172104 and jlx256128 variants - st75256 - jlx172104 and jlx256128 variants
- uc1701 - dogs102 and mini12864 variants - uc1701 - dogs102 and mini12864 variants
This integration is based on [v2.19.8](https://github.com/olikraus/U8g2_Arduino/releases/tag/2.19.8). This integration uses full "RAM" memory buffer without picture loop and calls u8g2's `begin()` internally when creating a display object. It is based on [v2.19.8](https://github.com/olikraus/U8g2_Arduino/releases/tag/2.19.8).
## Overview ## Overview