-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error moving TFT_Espi code to LGFX_TFT_eSPI.hpp #676
Comments
anybody? |
This is what AI ddeep seek makes of the code, same as me, same problem // Adapted by Bodmer to use the TFT_eSPI library: #include <LovyanGFX.hpp> // Hardware-specific library #include <FS.h> // JPEG decoder library #ifndef _GFX_UI_H // Maximum of 85 for BUFFPIXEL as 3 x this value is stored in an 8 bit variable! class GfxUi { private: }; #endif // Adapted by Bodmer to use the TFT_eSPI library: https://github.com/Bodmer/TFT_eSPI #include "GfxUi.h" GfxUi::GfxUi(LGFX *tft) { void GfxUi::drawProgressBar(uint16_t x0, uint16_t y0, uint16_t w, uint16_t h, uint8_t percentage, uint16_t frameColor, uint16_t barColor) { // Bodmer's streamlined x2 faster "no seek" version fs::File bmpFS; // Check file exists and open it // Note: ESP32 passes "open" test even if file does not exist, whereas ESP8266 returns NULL // Open requested file uint32_t seekOffset; if (read16(bmpFS) == 0x4D42)
} // These read 16- and 32-bit types from the SD card file. uint16_t GfxUi::read16(fs::File &f) { uint32_t GfxUi::read32(fs::File &f) { //==================================================================================== |
well after modifing the source a lot, some C++ Class to plain C, I got it working after days |
Carefully written Issues are more likely to be given priority.
丁寧に記述された報告は優先して対応される可能性が高くなります。
Environment ( 実行環境 )
Problem Description ( 問題の内容 )
e:\Arduino files\libraries\LovyanGFX\src/LGFX_TFT_eSPI.hpp:27:18: error: 'LGFX' does not name a type
27 | using TFT_eSPI = LGFX;
| ^~~~
E:\Arduino files\lovyan_open_weather_v01\GfxUi.h:23:17: error: expected ')' before '*' token
23 | GfxUi(TFT_eSPI *tft, OpenFontRender *render);
| ~ ^~
| )
E:\Arduino files\lovyan_open_weather_v01\GfxUi.h:31:3: error: 'TFT_eSPI' does not name a type; did you mean 'TFT_eSprite'?
31 | TFT_eSPI *_tft;
| ^~~~~~~~
| TFT_eSprite
E:\Arduino files\lovyan_open_weather_v01\GfxUi.cpp:10:13: error: expected constructor, destructor, or type conversion before '(' token
10 | GfxUi::GfxUi(TFT_eSPI *tft, OpenFontRender *ofr) {
Expected Behavior ( 期待される動作 )
Actual Behavior ( 実際の動作 )
Steps to reproduce ( 再現のための前提条件 )
try to move TFT_Espi code to lovyan
// If possible, attach a picture of your setup/wiring here.
Code to reproduce this issue ( 再現させるためのコード )
Please submit complete source code that can reproduce your problem.
あなたの問題を再現できる完全なソースコードを提示してください。
// SPDX-FileCopyrightText: 2023 ThingPulse Ltd., https://thingpulse.com
// SPDX-License-Identifier: MIT
// Based on https://github.com/Bodmer/OpenWeather/blob/main/examples/TFT_eSPI_OpenWeather_LittleFS/GfxUi.h
#pragma once
#include <FS.h>
#include <LittleFS.h>
#include <OpenFontRender.h>
//#include <TFT_eSPI.h>
#include <LGFX_TFT_eSPI.hpp>
// JPEG decoder library
#include <TJpg_Decoder.h>
// Maximum of 85 for BUFFPIXEL as 3 x this value is stored in an 8 bit variable!
// 32 is an efficient size for LittleFS due to SPI hardware pipeline buffer size
// A larger value of 80 is better for SD cards
#define BUFFPIXEL 32
class GfxUi {
public:
GfxUi(TFT_eSPI *tft, OpenFontRender *render);
void drawBmp(String filename, uint16_t x, uint16_t y);
void drawLogo();
void drawProgressBar(uint16_t x, uint16_t y, uint16_t w, uint16_t h,
uint8_t percentage, uint16_t frameColor,
uint16_t barColor);
private:
TFT_eSPI *_tft;
OpenFontRender *_ofr;
uint16_t read16(fs::File &f);
uint32_t read32(fs::File &f);
};
The text was updated successfully, but these errors were encountered: