Browse Source

Followup to LVGL patch (#18920)

Victor Oliveira 4 years ago
parent
commit
d922c002ca
No account linked to committer's email address

+ 6
- 5
Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp View File

24
 
24
 
25
 #if HAS_TFT_LVGL_UI
25
 #if HAS_TFT_LVGL_UI
26
 
26
 
27
+#include "../../../../inc/MarlinConfig.h"
27
 #include "SPIFlashStorage.h"
28
 #include "SPIFlashStorage.h"
28
 
29
 
29
-uint8_t SPIFlashStorage::::m_pageData[SPI_FLASH_PageSize];
30
-uint32_t SPIFlashStorage::::m_currentPage;
31
-uint16_t SPIFlashStorage::::m_pageDataUsed;
32
-uint32_t SPIFlashStorage::::m_startAddress;
30
+uint8_t SPIFlashStorage::m_pageData[SPI_FLASH_PageSize];
31
+uint32_t SPIFlashStorage::m_currentPage;
32
+uint16_t SPIFlashStorage::m_pageDataUsed;
33
+uint32_t SPIFlashStorage::m_startAddress;
33
 
34
 
34
 #if HAS_SPI_FLASH_COMPRESSION
35
 #if HAS_SPI_FLASH_COMPRESSION
35
 
36
 
291
 
292
 
292
 uint16_t SPIFlashStorage::outData(uint8_t* data, uint16_t size) {
293
 uint16_t SPIFlashStorage::outData(uint8_t* data, uint16_t size) {
293
   // Don't read more than we have
294
   // Don't read more than we have
294
-  NOMORE(size > pageDataFree());
295
+  NOMORE(size, pageDataFree());
295
   memcpy(data, m_pageData + m_pageDataUsed, size);
296
   memcpy(data, m_pageData + m_pageDataUsed, size);
296
   m_pageDataUsed += size;
297
   m_pageDataUsed += size;
297
   return size;
298
   return size;

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.h View File

79
   static void endWrite();
79
   static void endWrite();
80
   static void writeData(uint8_t* data, uint16_t size);
80
   static void writeData(uint8_t* data, uint16_t size);
81
 
81
 
82
-  static // Read operation
82
+  // Read operation
83
   static void beginRead(uint32_t startAddress);
83
   static void beginRead(uint32_t startAddress);
84
   static void readData(uint8_t* data, uint16_t size);
84
   static void readData(uint8_t* data, uint16_t size);
85
 
85
 

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp View File

482
         if (card.longFilename[0] == '.') continue;
482
         if (card.longFilename[0] == '.') continue;
483
 
483
 
484
         int8_t a = arrayFindStr(assets, COUNT(assets), card.longFilename);
484
         int8_t a = arrayFindStr(assets, COUNT(assets), card.longFilename);
485
-        if (a >= 0 && a < COUNT(assets)) {
485
+        if (a >= 0 && a < (int8_t)COUNT(assets)) {
486
           uint8_t assetType = ASSET_TYPE_ICON;
486
           uint8_t assetType = ASSET_TYPE_ICON;
487
           if (strstr(assets[a], "_logo"))
487
           if (strstr(assets[a], "_logo"))
488
             assetType = ASSET_TYPE_LOGO;
488
             assetType = ASSET_TYPE_LOGO;
498
 
498
 
499
         #if HAS_SPI_FLASH_FONT
499
         #if HAS_SPI_FLASH_FONT
500
           a = arrayFindStr(fonts, COUNT(fonts), card.longFilename);
500
           a = arrayFindStr(fonts, COUNT(fonts), card.longFilename);
501
-          if (a >= 0 && a < COUNT(fonts))
501
+          if (a >= 0 && a < (int8_t)COUNT(fonts))
502
             loadAsset(dir, d, fonts[a], ASSET_TYPE_FONT);
502
             loadAsset(dir, d, fonts[a], ASSET_TYPE_FONT);
503
         #endif
503
         #endif
504
       }
504
       }

Loading…
Cancel
Save