Skip to content

Commit 3952d9e

Browse files
authored
Merge pull request #35 from m5stack/develop
0.0.20
2 parents f9f51ba + 80a7f2d commit 3952d9e

File tree

94 files changed

+1594
-36930
lines changed

Some content is hidden

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

94 files changed

+1594
-36930
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "git",
1111
"url": "https://github.com/m5stack/M5GFX.git"
1212
},
13-
"version": "0.0.19",
13+
"version": "0.0.20",
1414
"frameworks": "arduino",
1515
"platforms": "espressif32",
1616
"headers": "M5GFX.h"

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=M5GFX
2-
version=0.0.19
2+
version=0.0.20
33
author=M5Stack
44
maintainer=M5Stack
55
sentence=Library for M5Stack All Display

src/M5GFX.cpp

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,19 +286,33 @@ namespace m5gfx
286286
} while (lgfx::millis() - time < 10);
287287
}
288288

289+
/// TF card dummy clock送信 ;
290+
static void _send_sd_dummy_clock(int_fast16_t pin_cs)
291+
{
292+
static constexpr uint32_t dummy_clock[] = { ~0u, ~0u, ~0u, ~0u, ~0u };
293+
_pin_level(pin_cs, true);
294+
m5gfx::spi::writeBytes(VSPI_HOST, (const uint8_t*)dummy_clock, sizeof(dummy_clock));
295+
_pin_level(pin_cs, false);
296+
}
297+
289298
/// TF card をSPIモードに移行する ;
290299
static void _set_sd_spimode(int_fast16_t pin_cs)
291300
{
292-
_pin_level(pin_cs, true);
293301
m5gfx::spi::beginTransaction(VSPI_HOST, 400000, 0);
294-
static constexpr uint32_t dummy_clock[] = { ~0u, ~0u, ~0u, ~0u, ~0u };
295-
m5gfx::spi::writeBytes(VSPI_HOST, (const uint8_t*)dummy_clock, sizeof(dummy_clock));
302+
_send_sd_dummy_clock(pin_cs);
296303

297-
_pin_level(pin_cs, false);
298-
static constexpr uint8_t sd_cmd0[] = { 0x40, 0, 0, 0, 0, 0x95, 0xFF, 0xFF };
299-
m5gfx::spi::writeBytes(VSPI_HOST, sd_cmd0, sizeof(sd_cmd0));
300-
m5gfx::spi::endTransaction(VSPI_HOST);
304+
uint8_t sd_cmd58[] = { 0x7A, 0, 0, 0, 0, 0xFD, 0xFF, 0xFF }; // READ_OCR command.
305+
m5gfx::spi::readBytes(VSPI_HOST, sd_cmd58, sizeof(sd_cmd58));
306+
307+
if (sd_cmd58[6] == sd_cmd58[7]) // not SPI mode
308+
{
309+
_send_sd_dummy_clock(pin_cs);
310+
311+
static constexpr uint8_t sd_cmd0[] = { 0x40, 0, 0, 0, 0, 0x95, 0xFF, 0xFF }; // GO_IDLE_STATE command.
312+
m5gfx::spi::writeBytes(VSPI_HOST, sd_cmd0, sizeof(sd_cmd0));
313+
}
301314
_pin_level(pin_cs, true);
315+
m5gfx::spi::endTransaction(VSPI_HOST);
302316
}
303317

304318
static std::uint32_t _read_panel_id(lgfx::Bus_SPI* bus, std::int32_t pin_cs, std::uint32_t cmd = 0x04, std::uint8_t dummy_read_bit = 1) // 0x04 = RDDID command

src/lgfx/utility/miniz.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
// functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work.
191191
//#define MINIZ_NO_MALLOC
192192

193-
//
193+
//
194194
//#define MINIZ_NO_COMPRESSION
195195

196196

@@ -216,8 +216,6 @@
216216
#if MINIZ_X86_OR_X64_CPU
217217
// Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses.
218218
#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
219-
#elif defined (ESP_PLATFORM)
220-
#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
221219
#else
222220
#endif
223221

@@ -830,7 +828,7 @@ size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void
830828

831829
// Compresses an image to a compressed PNG file in memory.
832830
// On entry:
833-
// pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4.
831+
// pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4.
834832
// The image pitch in bytes per scanline will be w*num_chans. The leftmost pixel on the top scanline is stored first in memory.
835833
// level may range from [0,10], use MZ_NO_COMPRESSION, MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc. or a decent default is MZ_DEFAULT_LEVEL
836834
// If flip is true, the image will be flipped on the Y axis (useful for OpenGL apps).
@@ -4494,7 +4492,7 @@ mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,
44944492

44954493
if (!mz_zip_get_file_modified_time(pSrc_filename, &dos_time, &dos_date))
44964494
return MZ_FALSE;
4497-
4495+
44984496
pSrc_file = MZ_FOPEN(pSrc_filename, "rb");
44994497
if (!pSrc_file)
45004498
return MZ_FALSE;

src/lgfx/v1/Bus.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ namespace lgfx
4949
/// ペリフェラルを解放する。;
5050
virtual void release(void) = 0;
5151

52+
/// 通信速度を取得する。;
53+
virtual uint32_t getClock(void) const { return 0; }
54+
55+
/// 通信速度を設定する。;
56+
virtual void setClock(uint32_t) {};
57+
5258
/// 通信トランザクションを開始する。(ペリフェラルを占有する);
5359
virtual void beginTransaction(void) = 0;
5460

src/lgfx/v1/LGFXBase.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ namespace lgfx
11171117

11181118
//----------------------------------------------------------------------------
11191119

1120-
class Panel_Device;
1120+
struct Panel_Device;
11211121

11221122
class LGFX_Device : public LovyanGFX
11231123
{

src/lgfx/v1/Touch.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ namespace lgfx
4747
uint16_t y_max = 3600;
4848
bool bus_shared = true; /// パネルとタッチが同じバスに繋がっている場合true;
4949
int16_t pin_int = -1;
50+
int16_t pin_rst = -1;
5051
uint8_t offset_rotation = 0;
5152
union
5253
{

src/lgfx/v1/gitTagVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#define LGFX_VERSION_MAJOR 1
22
#define LGFX_VERSION_MINOR 0
3-
#define LGFX_VERSION_PATCH 15
3+
#define LGFX_VERSION_PATCH 16
44
#define LOVYANGFX_VERSION F( LGFX_VERSION_MAJOR "." LGFX_VERSION_MINOR "." LGFX_VERSION_PATCH )

0 commit comments

Comments
 (0)