Skip to content

Commit de8dd63

Browse files
authored
Merge pull request #144 from lovyan03/develop
0.4.2
2 parents 404e561 + ec6bfa8 commit de8dd63

File tree

181 files changed

+13185
-10765
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+13185
-10765
lines changed

examples/Sprite/MovingCircles/MovingCircles.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
#define LGFX_USE_V1
12
#include <LovyanGFX.hpp>
23

4+
#define LGFX_AUTODETECT
5+
#include <LGFX_AUTODETECT.hpp> // クラス"LGFX"を準備します
6+
// #include <lgfx_user/LGFX_ESP32_sample.hpp> // またはユーザ自身が用意したLGFXクラスを準備します
7+
8+
static LGFX lcd;
9+
310
static std::uint32_t sec, psec;
411
static std::uint32_t fps = 0, frame_count = 0;
512
static std::int32_t lcd_width ;
@@ -37,7 +44,6 @@ struct obj_info_t {
3744
static constexpr std::uint32_t obj_count = 200;
3845
static obj_info_t objects[obj_count];
3946

40-
static LGFX lcd;
4147
static LGFX_Sprite sprites[2];
4248
static int_fast16_t sprite_height;
4349

@@ -104,11 +110,7 @@ void loop(void)
104110
sprites[flip].setTextColor(TFT_WHITE);
105111
sprites[flip].printf("obj:%d fps:%d", obj_count, fps);
106112
}
107-
std::uint32_t len = sprite_height * lcd_width;
108-
if (y + sprite_height > lcd_height) {
109-
len = (lcd_height - y) * lcd_width;
110-
}
111-
lcd.pushPixelsDMA(sprites[flip].getBuffer(), len);
113+
sprites[flip].pushSprite(&lcd, 0, y);
112114
}
113115

114116
++frame_count;
@@ -117,7 +119,5 @@ void loop(void)
117119
psec = sec;
118120
fps = frame_count;
119121
frame_count = 0;
120-
lcd.setAddrWindow(0, 0, lcd.width(), lcd.height());
121122
}
122123
}
123-

examples/Sprite/MovingIcons/MovingIcons.ino

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
#define LGFX_USE_V1
12
#include <LovyanGFX.hpp>
23

4+
#define LGFX_AUTODETECT
5+
#include <LGFX_AUTODETECT.hpp> // クラス"LGFX"を準備します
6+
// #include <lgfx_user/LGFX_ESP32_sample.hpp> // またはユーザ自身が用意したLGFXクラスを準備します
7+
8+
static LGFX lcd;
9+
310
extern const unsigned short info[];
411
extern const unsigned short alert[];
512
extern const unsigned short closeX[];
@@ -63,7 +70,6 @@ struct obj_info_t {
6370
static constexpr size_t obj_count = 50;
6471
static obj_info_t objects[obj_count];
6572

66-
static LGFX lcd;
6773
static LGFX_Sprite sprites[2];
6874
static LGFX_Sprite icons[3];
6975
static int_fast16_t sprite_height;
@@ -144,11 +150,7 @@ void loop(void)
144150
sprites[flip].setTextColor(0xFFFFFFU);
145151
sprites[flip].printf("obj:%d fps:%d", obj_count, fps);
146152
}
147-
size_t len = sprite_height * lcd_width;
148-
if (y + sprite_height > lcd_height) {
149-
len = (lcd_height - y) * lcd_width;
150-
}
151-
lcd.pushPixelsDMA(sprites[flip].getBuffer(), len);
153+
sprites[flip].pushSprite(&lcd, 0, y);
152154
}
153155

154156
++frame_count;
@@ -157,7 +159,6 @@ void loop(void)
157159
psec = sec;
158160
fps = frame_count;
159161
frame_count = 0;
160-
lcd.setAddrWindow(0, 0, lcd.width(), lcd.height());
161162
}
162163
}
163164

@@ -261,4 +262,4 @@ constexpr unsigned short closeX[1024] ={
261262
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x4800,0xA800,0xB0C3,0xA0A2,0x9800,0x9800,0x9800,0x9800,0xA000,0xA000,0xA000,0x9800,0x9800,0x9800,0xA082,0xB0E3,0xA800,0x4800,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // row 28, 928 pixels
262263
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x5800,0xA800,0xB0A2,0xA8E3,0xA0A2,0xA041,0x9800,0x9800,0xA041,0xA0A2,0xA8E3,0xB0A2,0xA800,0x5800,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // row 29, 960 pixels
263264
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3000,0x6000,0x8800,0xA000,0xA800,0xA800,0xA000,0x8800,0x6000,0x3000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // row 30, 992 pixels
264-
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}; // row 31, 1024 pixels
265+
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000}; // row 31, 1024 pixels

library.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "LovyanGFX",
3-
"description": "TFT LCD Graphics driver with touch for ESP32 and SAMD51",
4-
"keywords": "lcd,tft,gfx,lgfx,esp32,m5stack,m5stackcore2,m5stickc,m5stickcplus,odroid-go,ttgo t-watch,ttgo t-wristband,esp-wrover-kit,wioterminal,wifiboy,makepython,hx8357,ili9163,ili9342,ili9341,ili9486,ili9488,st7735,st7789,st7796,ssd1351",
3+
"description": "TFT LCD Graphics driver with touch for ESP32, ESP8266, SAMD21, SAMD51",
4+
"keywords": "lcd,tft,gfx,lgfx,esp32,esp8266,samd21,samd51,m5stack,m5stackcore2,m5stickc,m5stickcplus,odroid-go,ttgo t-watch,ttgo t-wristband,esp-wrover-kit,wioterminal,wifiboy,makepython,hx8357,ili9163,ili9342,ili9341,ili9486,ili9488,st7735,st7789,st7796,ssd1351",
55
"authors": {
66
"name": "lovyan03",
77
"url": "https://github.com/lovyan03",
@@ -11,7 +11,7 @@
1111
"type": "git",
1212
"url": "https://github.com/lovyan03/LovyanGFX.git"
1313
},
14-
"version": "0.4.1",
14+
"version": "0.4.2",
1515
"frameworks": ["arduino", "espidf"],
1616
"platforms": ["espressif32", "espressif8266", "atmelsam"],
1717
"build": {

library.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=LovyanGFX
2-
version=0.4.1
2+
version=0.4.2
33
author=lovyan03
44
maintainer=lovyan03
5-
sentence=TFT LCD Graphics driver with touch for ESP32 and SAMD51
6-
paragraph=Supports TFT LCD displays using drivers that operate with hardware SPI. ESP32, SAMD51(Seeeduino), M5Stack, M5StackCore2, M5StickC, M5StickCPlus, ODROID-GO, TTGO T-Watch, TTGO T-Wristband, ESP-WROVER-KIT, WioTerminal, WiFiBoy, MakePython, HX8357, ILI9163, ILI9342, ILI9341, ILI9486, ILI9488, ST7735, ST7789, ST7796, SSD1351
5+
sentence=TFT LCD Graphics driver with touch for ESP32, ESP8266, SAMD21, SAMD51
6+
paragraph=Supports TFT LCD displays using drivers that operate with hardware SPI. ESP32, ESP8266, SAMD21, SAMD51, M5Stack, M5StackCore2, M5StickC, M5StickCPlus, ODROID-GO, TTGO T-Watch, TTGO T-Wristband, ESP-WROVER-KIT, WioTerminal, WiFiBoy, MakePython, HX8357, ILI9163, ILI9342, ILI9341, ILI9486, ILI9488, ST7735, ST7789, ST7796, SSD1351
77
category=Display
88
url=https://github.com/lovyan03/LovyanGFX
99
includes=LovyanGFX.hpp

src/LGFX_TFT_eSPI.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Original Source:
2424

2525
#include "LovyanGFX.hpp"
2626

27-
using TFT_eSPI = lgfx::LGFX;
27+
using TFT_eSPI = LGFX;
2828

29-
class TFT_eSprite : public lgfx::LGFX_Sprite {
29+
class TFT_eSprite : public LGFX_Sprite {
3030
public:
3131
TFT_eSprite() : LGFX_Sprite() { _psram = true; }
3232
TFT_eSprite(LovyanGFX* parent) : LGFX_Sprite(parent) { _psram = true; }

src/LovyanGFX.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ Original Source:
2222
#ifndef LOVYANGFX_HPP_
2323
#define LOVYANGFX_HPP_
2424

25-
#ifdef min
26-
#undef min
27-
#endif
28-
#ifdef max
29-
#undef max
30-
#endif
3125
#ifdef setFont
3226
#undef setFont
3327
#endif

src/lgfx/internal/algorithm.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#pragma once
2+
3+
#if defined ( CONFIG_ARCH_BOARD_SPRESENSE )
4+
#include <Arduino.h>
5+
#include <stdio.h>
6+
#include <stdlib.h>
7+
#ifdef atof
8+
#undef atof
9+
#endif
10+
#ifdef atoi
11+
#undef atoi
12+
#endif
13+
#ifdef atol
14+
#undef atol
15+
#endif
16+
__attribute__((weak)) float atof(const char* nptr) { return strtod((nptr), NULL); }
17+
__attribute__((weak)) int atoi(const char* nptr) { return (int)strtol((nptr), NULL, 10); }
18+
__attribute__((weak)) long atol(const char* nptr) { return strtol((nptr), NULL, 10); }
19+
__attribute__((weak)) int mblen(const char*, size_t) { return 0; }
20+
__attribute__((weak)) size_t mbstowcs(wchar_t*, const char*, size_t) { return 0; }
21+
__attribute__((weak)) int mbtowc(wchar_t*, const char*, size_t) { return 0; }
22+
__attribute__((weak)) size_t wcstombs(char*, const wchar_t*, size_t) { return 0; }
23+
__attribute__((weak)) int wctomb(char*, wchar_t) { return 0; }
24+
25+
#ifdef max
26+
#undef max
27+
#endif
28+
29+
#ifdef min
30+
#undef min
31+
#endif
32+
33+
#endif
34+
#include <algorithm>

src/lgfx/internal/limits.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#if defined ( CONFIG_ARCH_BOARD_SPRESENSE )
4+
#ifdef max
5+
#undef max
6+
#endif
7+
8+
#ifdef min
9+
#undef min
10+
#endif
11+
12+
#endif
13+
#include <limits>

src/lgfx/internal/memory.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#if defined ( CONFIG_ARCH_BOARD_SPRESENSE )
4+
#include <stdint.h>
5+
#include <stdio.h>
6+
#include <wchar.h>
7+
__attribute__((weak)) int vfwscanf(void*, const wchar_t *, ...) { return 0; }
8+
__attribute__((weak)) int vswscanf(const wchar_t*, const wchar_t *, ...) { return 0; }
9+
__attribute__((weak)) int vwscanf(const wchar_t*, ...) { return 0; }
10+
11+
#define _GLIBCXX_CSTDINT 1
12+
#endif
13+
#include <memory>

src/lgfx/utility/lgfx_tjpgd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ static inline int32_t BYTECLIP (
131131
/* Output 4x4 bayer pattern table */
132132
/*---------------------------------------------*/
133133

134+
#if JD_BAYER
134135
static const int_fast8_t Bayer[16] = { 0, 4, 1, 5,-2, 2,-1, 3, 1, 5, 0, 4,-1, 3,-2, 2};
136+
#endif
135137

136138

137139
/*-----------------------------------------------------------------------*/

0 commit comments

Comments
 (0)