moved state to global
This commit is contained in:
parent
32cd24b5c8
commit
440ef14ac1
2 changed files with 17 additions and 19 deletions
|
|
@ -163,13 +163,13 @@ static uint8_t u8x8_byte_i2c(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *a
|
|||
|
||||
u8g2_t* display_init(void)
|
||||
{
|
||||
#if defined(SSD1306_128X32) && SSD1306_128X32
|
||||
#if SSD1306_128X32
|
||||
u8g2_Setup_ssd1306_i2c_128x32_univision_f(&u8g2, U8G2_R0, u8x8_byte_i2c, u8x8_gpio_and_delay);
|
||||
#elif defined(SSD1312_96X16) && SSD1312_96X16
|
||||
#elif SSD1312_96X16
|
||||
// NOTE: display size is wrong, hardware is 96x16, but driver is configured for 120x28
|
||||
u8g2_Setup_ssd1312_i2c_128x32_f(&u8g2, U8G2_R0, u8x8_byte_i2c, u8x8_gpio_and_delay);
|
||||
#else
|
||||
static_assert(0, "unsupported display size");
|
||||
static_assert(0, "unsupported display");
|
||||
#endif
|
||||
// TODO: log errors and return NULL on failure
|
||||
u8g2_InitDisplay(&u8g2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue