Skip to content

Commit

Permalink
bugfix #534
Browse files Browse the repository at this point in the history
  • Loading branch information
moononournation committed Sep 9, 2024
1 parent 88252bc commit 9e52e96
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/Arduino_DataBus.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ typedef volatile ARDUINOGFX_PORT_t *PORTreg_t;
#endif // !defined(LITTLE_FOOT_PRINT)

#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#if (ESP_ARDUINO_VERSION_MAJOR < 3)
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#include <esp_lcd_panel_io.h>
#include <esp_lcd_panel_io_interface.h>
#include <esp_pm.h>
Expand Down Expand Up @@ -229,7 +229,7 @@ struct lcd_panel_io_i80_t
} flags;
lcd_i80_trans_descriptor_t trans_pool[]; // Transaction pool
};
#endif // #if (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

typedef enum
Expand Down
4 changes: 2 additions & 2 deletions src/databus/Arduino_ESP32LCD16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "Arduino_ESP32LCD16.h"

#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#if (ESP_ARDUINO_VERSION_MAJOR < 3)
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)

#define WAIT_LCD_NOT_BUSY while (LCD_CAM.lcd_user.val & LCD_CAM_LCD_START)

Expand Down Expand Up @@ -594,5 +594,5 @@ GFX_INLINE void Arduino_ESP32LCD16::CS_LOW(void)
}
}

#endif // #if defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
15 changes: 4 additions & 11 deletions src/databus/Arduino_ESP32LCD16.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
/*
* start rewrite from:
* https://github.com/lovyan03/LovyanGFX/blob/master/src/lgfx/v0/platforms/LGFX_PARALLEL_ESP32.hpp
*/
#pragma once

#include "Arduino_DataBus.h"

#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#if (ESP_ARDUINO_VERSION_MAJOR < 3)

#ifndef _ARDUINO_ESP32LCD16_H_
#define _ARDUINO_ESP32LCD16_H_
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)

#ifndef LCD_MAX_PIXELS_AT_ONCE
#define LCD_MAX_PIXELS_AT_ONCE 2046
Expand Down Expand Up @@ -99,7 +94,5 @@ class Arduino_ESP32LCD16 : public Arduino_DataBus
};
};

#endif // _ARDUINO_ESP32LCD16_H_

#endif // #if (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
4 changes: 2 additions & 2 deletions src/databus/Arduino_ESP32LCD8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "Arduino_ESP32LCD8.h"

#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#if (ESP_ARDUINO_VERSION_MAJOR < 3)
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)

#define WAIT_LCD_NOT_BUSY while (LCD_CAM.lcd_user.val & LCD_CAM_LCD_START)

Expand Down Expand Up @@ -744,5 +744,5 @@ GFX_INLINE void Arduino_ESP32LCD8::CS_LOW(void)
}
}

#endif // #if defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
4 changes: 2 additions & 2 deletions src/databus/Arduino_ESP32LCD8.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Arduino_DataBus.h"

#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#if (ESP_ARDUINO_VERSION_MAJOR < 3)
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)

#ifndef LCD_MAX_PIXELS_AT_ONCE
#define LCD_MAX_PIXELS_AT_ONCE 2046
Expand Down Expand Up @@ -82,5 +82,5 @@ class Arduino_ESP32LCD8 : public Arduino_DataBus
};
};

#endif // #if (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
4 changes: 2 additions & 2 deletions src/databus/Arduino_ESP32RGBPanel.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Arduino_ESP32RGBPanel.h"

#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#if (ESP_ARDUINO_VERSION_MAJOR < 3)
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)

Arduino_ESP32RGBPanel::Arduino_ESP32RGBPanel(
int8_t de, int8_t vsync, int8_t hsync, int8_t pclk,
Expand Down Expand Up @@ -129,5 +129,5 @@ uint16_t *Arduino_ESP32RGBPanel::getFrameBuffer(int16_t w, int16_t h)

return (uint16_t *)_rgb_panel->fb;
}
#endif // #if (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
11 changes: 4 additions & 7 deletions src/databus/Arduino_ESP32RGBPanel.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#pragma once

#include "Arduino_DataBus.h"

#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#if (ESP_ARDUINO_VERSION_MAJOR < 3)

#ifndef _ARDUINO_ESP32RGBPANEL_H_
#define _ARDUINO_ESP32RGBPANEL_H_
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)

#include "esp_lcd_panel_io.h"
#include "esp_lcd_panel_rgb.h"
Expand Down Expand Up @@ -96,7 +95,5 @@ class Arduino_ESP32RGBPanel
esp_rgb_panel_t *_rgb_panel;
};

#endif // _ARDUINO_ESP32RGBPANEL_H_

#endif // #if (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
4 changes: 2 additions & 2 deletions src/databus/Arduino_ESP32SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#if defined(ESP32)
#include "soc/spi_struct.h"
#if CONFIG_IDF_TARGET_ESP32S3
#if (ESP_ARDUINO_VERSION_MAJOR < 3)
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#include "driver/periph_ctrl.h"
#else
#include "esp_private/periph_ctrl.h"
#endif
#elif CONFIG_IDF_TARGET_ESP32C3
#if (ESP_ARDUINO_VERSION_MAJOR < 3)
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#include "driver/periph_ctrl.h"
#else
#include "esp_private/periph_ctrl.h"
Expand Down
2 changes: 2 additions & 0 deletions src/databus/Arduino_ESP32SPIDMA.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

#if defined(ESP32)
#include <driver/spi_master.h>
#if (ESP_ARDUINO_VERSION_MAJOR >= 3)
#include <esp_memory_utils.h>
#endif

#ifndef ESP32SPIDMA_MAX_PIXELS_AT_ONCE
#define ESP32SPIDMA_MAX_PIXELS_AT_ONCE 1024
Expand Down
4 changes: 2 additions & 2 deletions src/display/Arduino_RGB_Display.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "../Arduino_DataBus.h"

#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#if (ESP_ARDUINO_VERSION_MAJOR < 3)
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)

#include "../Arduino_GFX.h"
#include "Arduino_RGB_Display.h"
Expand Down Expand Up @@ -519,5 +519,5 @@ uint16_t *Arduino_RGB_Display::getFramebuffer()
return _framebuffer;
}

#endif // #if (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
11 changes: 4 additions & 7 deletions src/display/Arduino_RGB_Display.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#pragma once

#include "../Arduino_DataBus.h"

#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#if (ESP_ARDUINO_VERSION_MAJOR < 3)

#ifndef _ARDUINO_RGB_DISPLAY_H_
#define _ARDUINO_RGB_DISPLAY_H_
#if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)

#include "../Arduino_GFX.h"
#include "../databus/Arduino_ESP32RGBPanel.h"
Expand Down Expand Up @@ -2299,7 +2298,5 @@ class Arduino_RGB_Display : public Arduino_GFX
private:
};

#endif // _ARDUINO_RGB_DISPLAY_H_

#endif // #if (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if (!defined(ESP_ARDUINO_VERSION_MAJOR)) || (ESP_ARDUINO_VERSION_MAJOR < 3)
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

0 comments on commit 9e52e96

Please sign in to comment.