Followup to LVGL patch (#18920)

This commit is contained in:
Victor Oliveira 2020-08-06 00:40:08 -03:00 committed by GitHub
parent 6da477e6bf
commit d922c002ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View file

@ -24,12 +24,13 @@
#if HAS_TFT_LVGL_UI #if HAS_TFT_LVGL_UI
#include "../../../../inc/MarlinConfig.h"
#include "SPIFlashStorage.h" #include "SPIFlashStorage.h"
uint8_t SPIFlashStorage::::m_pageData[SPI_FLASH_PageSize]; uint8_t SPIFlashStorage::m_pageData[SPI_FLASH_PageSize];
uint32_t SPIFlashStorage::::m_currentPage; uint32_t SPIFlashStorage::m_currentPage;
uint16_t SPIFlashStorage::::m_pageDataUsed; uint16_t SPIFlashStorage::m_pageDataUsed;
uint32_t SPIFlashStorage::::m_startAddress; uint32_t SPIFlashStorage::m_startAddress;
#if HAS_SPI_FLASH_COMPRESSION #if HAS_SPI_FLASH_COMPRESSION
@ -291,7 +292,7 @@ void SPIFlashStorage::beginRead(uint32_t startAddress) {
uint16_t SPIFlashStorage::outData(uint8_t* data, uint16_t size) { uint16_t SPIFlashStorage::outData(uint8_t* data, uint16_t size) {
// Don't read more than we have // Don't read more than we have
NOMORE(size > pageDataFree()); NOMORE(size, pageDataFree());
memcpy(data, m_pageData + m_pageDataUsed, size); memcpy(data, m_pageData + m_pageDataUsed, size);
m_pageDataUsed += size; m_pageDataUsed += size;
return size; return size;

View file

@ -79,7 +79,7 @@ public:
static void endWrite(); static void endWrite();
static void writeData(uint8_t* data, uint16_t size); static void writeData(uint8_t* data, uint16_t size);
static // Read operation // Read operation
static void beginRead(uint32_t startAddress); static void beginRead(uint32_t startAddress);
static void readData(uint8_t* data, uint16_t size); static void readData(uint8_t* data, uint16_t size);

View file

@ -482,7 +482,7 @@ uint8_t public_buf[512];
if (card.longFilename[0] == '.') continue; if (card.longFilename[0] == '.') continue;
int8_t a = arrayFindStr(assets, COUNT(assets), card.longFilename); int8_t a = arrayFindStr(assets, COUNT(assets), card.longFilename);
if (a >= 0 && a < COUNT(assets)) { if (a >= 0 && a < (int8_t)COUNT(assets)) {
uint8_t assetType = ASSET_TYPE_ICON; uint8_t assetType = ASSET_TYPE_ICON;
if (strstr(assets[a], "_logo")) if (strstr(assets[a], "_logo"))
assetType = ASSET_TYPE_LOGO; assetType = ASSET_TYPE_LOGO;
@ -498,7 +498,7 @@ uint8_t public_buf[512];
#if HAS_SPI_FLASH_FONT #if HAS_SPI_FLASH_FONT
a = arrayFindStr(fonts, COUNT(fonts), card.longFilename); a = arrayFindStr(fonts, COUNT(fonts), card.longFilename);
if (a >= 0 && a < COUNT(fonts)) if (a >= 0 && a < (int8_t)COUNT(fonts))
loadAsset(dir, d, fonts[a], ASSET_TYPE_FONT); loadAsset(dir, d, fonts[a], ASSET_TYPE_FONT);
#endif #endif
} }