Skip to content

Commit

Permalink
raising version 1.1.8
Browse files Browse the repository at this point in the history
fix compiler warning.
  • Loading branch information
lovyan03 committed Jul 13, 2023
1 parent 575c407 commit 00a7b84
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "https://github.com/lovyan03/LovyanGFX.git"
},
"version": "1.1.7",
"version": "1.1.8",
"frameworks": ["arduino", "espidf", "*"],
"platforms": ["espressif32", "espressif8266", "atmelsam", "native"],
"headers": "LovyanGFX.hpp",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=LovyanGFX
version=1.1.7
version=1.1.8
author=lovyan03
maintainer=lovyan03
sentence=TFT LCD Graphics driver with touch for ESP32, ESP8266, SAMD21, SAMD51, RP2040
Expand Down
4 changes: 2 additions & 2 deletions src/lgfx/utility/lgfx_qrcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,11 +850,11 @@ int8_t lgfx_qrcode_initBytes(QRCode *qrcode, uint8_t *modules, uint8_t version,

// Find the best (lowest penalty) mask
uint8_t mask = 0;
int32_t minPenalty = INT32_MAX;
uint32_t minPenalty = ~0u;
for (uint_fast8_t i = 0; i < 8; i++) {
drawFormatBits(&modulesGrid, &isFunctionGrid, eccFormatBits, i);
applyMask(&modulesGrid, &isFunctionGrid, i);
int penalty = getPenaltyScore(&modulesGrid);
uint32_t penalty = getPenaltyScore(&modulesGrid);
if (penalty < minPenalty) {
mask = i;
minPenalty = penalty;
Expand Down
6 changes: 6 additions & 0 deletions src/lgfx/v1/Panel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,13 @@ namespace lgfx
auto ye = y + h;
auto buf = (RGBColor*)alloca(w * sizeof(RGBColor));
#pragma GCC diagnostic push
#if defined(__has_warning)
#if __has_warning("-Wmaybe-uninitialized")
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#else
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
/// Not actually used uninitialized. Just grabbing a copy of the pointer before we start the loop that fills it.
pixelcopy_t pc_write(buf ,_write_depth, RGBColor::depth, false);
#pragma GCC diagnostic pop
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/gitTagVersion.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define LGFX_VERSION_MAJOR 1
#define LGFX_VERSION_MINOR 1
#define LGFX_VERSION_PATCH 7
#define LGFX_VERSION_PATCH 8
#define LOVYANGFX_VERSION F( LGFX_VERSION_MAJOR "." LGFX_VERSION_MINOR "." LGFX_VERSION_PATCH )
2 changes: 1 addition & 1 deletion src/lgfx/v1/panel/Panel_GDEW0154M09.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ namespace lgfx
uint32_t idx = 0;
do
{
readbuf[idx] = _read_pixel(x + idx, y) ? ~0u : 0;
readbuf[idx] = _read_pixel(x + idx, y) ? -1 : 0;
} while (++idx != w);
param->src_x32 = 0;
readpos = param->fp_copy(dst, readpos, readpos + w, param);
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/panel/Panel_RA8875.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ namespace lgfx
return true;
}

void Panel_RA8875::_write_reg(uint8_t reg, uint8_t data)
void Panel_RA8875::_write_reg(uint_fast16_t reg, uint_fast16_t data)
{
_flg_memorywrite = false;
if (_flg_serialbus)
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/panel/Panel_RA8875.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace lgfx

void _set_write_pos(uint_fast16_t x, uint_fast16_t y);
bool _wait_busy( uint32_t timeout = 1000);
void _write_reg(uint8_t reg, uint8_t data);
void _write_reg(uint_fast16_t reg, uint_fast16_t data);
void _write_reg_0x51(uint8_t reg, uint8_t data);
void _start_memorywrite(void);
};
Expand Down
13 changes: 9 additions & 4 deletions src/lgfx/v1/panel/Panel_SSD1306.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace lgfx
{
//----------------------------------------------------------------------------

static constexpr uint8_t Bayer[16] = { 8, 136, 40, 168, 200, 72, 232, 104, 56, 184, 24, 152, 248, 120, 216, 88 };
static constexpr uint8_t Bayer[] = { 8, 136, 40, 168, 200, 72, 232, 104, 56, 184, 24, 152, 248, 120, 216, 88, 8, 136, 40, 168, 200, 72, 232, 104, 56, 184, 24, 152, 248, 120, 216, 88 };

inline static uint32_t to_gray(uint8_t r, uint8_t g, uint8_t b)
{
Expand All @@ -44,6 +44,11 @@ namespace lgfx
) >> 24;
}

void Panel_1bitOLED::setTilePattern(uint_fast8_t i)
{
_bayer_offset = Bayer[i & 15] >> 4;
}

color_depth_t Panel_1bitOLED::setColorDepth(color_depth_t depth)
{
_write_depth = color_depth_t::rgb565_2Byte;
Expand Down Expand Up @@ -131,7 +136,7 @@ namespace lgfx
{
x = xs;
uint32_t idx = x + (y >> 3) * _cfg.panel_width;
auto btbl = &Bayer[(y & 3) << 2];
auto btbl = &Bayer[_bayer_offset + ((y & 3) << 2)];
uint32_t mask = 1 << (y&7);
do
{
Expand Down Expand Up @@ -223,7 +228,7 @@ namespace lgfx
uint32_t idx = 0;
do
{
readbuf[idx] = _read_pixel(x + idx, y) ? ~0u : 0;
readbuf[idx] = _read_pixel(x + idx, y) ? -1 : 0;
} while (++idx != w);
param->src_x32 = 0;
readpos = param->fp_copy(dst, readpos, readpos + w, param);
Expand All @@ -235,7 +240,7 @@ namespace lgfx
_rotate_pos(x, y);
uint32_t idx = x + (y >> 3) * _cfg.panel_width;
uint32_t mask = 1 << (y&7);
bool flg = 256 <= value + Bayer[(x & 3) | (y & 3) << 2];
bool flg = 256 <= value + Bayer[_bayer_offset + ((x & 3) | (y & 3) << 2)];
if (flg) _buf[idx] |= mask;
else _buf[idx] &= ~mask;
}
Expand Down

0 comments on commit 00a7b84

Please sign in to comment.