From 3b745887410c2f4be2cb879cab79783434be27ee Mon Sep 17 00:00:00 2001 From: philippe44 Date: Wed, 15 Jan 2020 23:51:22 -0800 Subject: [PATCH] LMS seems to handle 32 pixels screen only --- components/display/driver_SSD1306.c | 9 ++++++--- components/services/audio_controls.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/display/driver_SSD1306.c b/components/display/driver_SSD1306.c index 126cdf86..d69d3bec 100644 --- a/components/display/driver_SSD1306.c +++ b/components/display/driver_SSD1306.c @@ -246,7 +246,7 @@ static void vfdc_handler( u8_t *_data, int bytes_read) { void grfe_handler( u8_t *data, int len) { data += 8; len -= 8; - + #ifndef FULL_REFRESH // force addressing mode by lines if (AddressMode != AddressMode_Horizontal) { @@ -255,7 +255,7 @@ void grfe_handler( u8_t *data, int len) { } // try to minmize I2C traffic which is very slow - int rows = Display.Height / 8; + int rows = (Display.Height > 32) ? 4 : Display.Height / 8; for (int r = 0; r < rows; r++) { uint8_t first = 0, last; uint8_t *optr = Display.Framebuffer + r*Display.Width, *iptr = data + r; @@ -281,12 +281,15 @@ void grfe_handler( u8_t *data, int len) { // to be verified, but this is as fast as using a pointer on data for (int i = len - 1; i >= 0; i--) data[i] = BitReverseTable256[data[i]]; + if (Display.Height > 32) SSD1306_SetPageAddress( &Display, 0, 32/8-1); + // force addressing mode by columns if (AddressMode != AddressMode_Vertical) { AddressMode = AddressMode_Vertical; SSD1306_SetDisplayAddressMode( &Display, AddressMode ); } - SSD1306_WriteRawData( &Display, data, len); + + SSD1306_WriteRawData(&Display, data, len); #endif } diff --git a/components/services/audio_controls.c b/components/services/audio_controls.c index 93e8bad2..974e8d8f 100644 --- a/components/services/audio_controls.c +++ b/components/services/audio_controls.c @@ -89,7 +89,7 @@ static void control_handler(void *client, button_event_e event, button_press_e p ESP_LOGD(TAG, "control gpio:%u press:%u long:%u event:%u action:%u", key->gpio, press, long_press, event, action); if (action > ACTRLS_MAX) { - // need to do the remap here + // need to do the remap here using button_remap ESP_LOGD(TAG, "remapping buttons"); } else if (action != ACTRLS_NONE) { ESP_LOGD(TAG, "calling action %u", action);