فهرست منبع

LMS seems to handle 32 pixels screen only

philippe44 5 سال پیش
والد
کامیت
3b74588741
2فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 6 3
      components/display/driver_SSD1306.c
  2. 1 1
      components/services/audio_controls.c

+ 6 - 3
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	
 }
 

+ 1 - 1
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);