Quellcode durchsuchen

Followup to LVGL patch (#18920)

Victor Oliveira vor 4 Jahren
Ursprung
Commit
d922c002ca
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 6
- 5
Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.cpp Datei anzeigen

@@ -24,12 +24,13 @@
24 24
 
25 25
 #if HAS_TFT_LVGL_UI
26 26
 
27
+#include "../../../../inc/MarlinConfig.h"
27 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 35
 #if HAS_SPI_FLASH_COMPRESSION
35 36
 
@@ -291,7 +292,7 @@ void SPIFlashStorage::beginRead(uint32_t startAddress) {
291 292
 
292 293
 uint16_t SPIFlashStorage::outData(uint8_t* data, uint16_t size) {
293 294
   // Don't read more than we have
294
-  NOMORE(size > pageDataFree());
295
+  NOMORE(size, pageDataFree());
295 296
   memcpy(data, m_pageData + m_pageDataUsed, size);
296 297
   m_pageDataUsed += size;
297 298
   return size;

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/SPIFlashStorage.h Datei anzeigen

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

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp Datei anzeigen

@@ -482,7 +482,7 @@ uint8_t public_buf[512];
482 482
         if (card.longFilename[0] == '.') continue;
483 483
 
484 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 486
           uint8_t assetType = ASSET_TYPE_ICON;
487 487
           if (strstr(assets[a], "_logo"))
488 488
             assetType = ASSET_TYPE_LOGO;
@@ -498,7 +498,7 @@ uint8_t public_buf[512];
498 498
 
499 499
         #if HAS_SPI_FLASH_FONT
500 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 502
             loadAsset(dir, d, fonts[a], ASSET_TYPE_FONT);
503 503
         #endif
504 504
       }

Laden…
Abbrechen
Speichern