Browse Source

Clean up W25QXXFlash class

Scott Lahteine 4 years ago
parent
commit
6759aff220

+ 0
- 4
Marlin/src/gcode/control/M993_M994.cpp View File

41
     return;
41
     return;
42
   }
42
   }
43
 
43
 
44
-  W25QXXFlash W25QXX;
45
-
46
   uint8_t buf[1024];
44
   uint8_t buf[1024];
47
   uint32_t addr = 0;
45
   uint32_t addr = 0;
48
   W25QXX.init(SPI_QUARTER_SPEED);
46
   W25QXX.init(SPI_QUARTER_SPEED);
71
     return;
69
     return;
72
   }
70
   }
73
 
71
 
74
-  W25QXXFlash W25QXX;
75
-
76
   uint8_t buf[1024];
72
   uint8_t buf[1024];
77
   uint32_t addr = 0;
73
   uint32_t addr = 0;
78
   W25QXX.init(SPI_QUARTER_SPEED);
74
   W25QXX.init(SPI_QUARTER_SPEED);

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

27
 #include "../../../../inc/MarlinConfig.h"
27
 #include "../../../../inc/MarlinConfig.h"
28
 #include "SPIFlashStorage.h"
28
 #include "SPIFlashStorage.h"
29
 
29
 
30
-extern W25QXXFlash W25QXX;
31
-
32
 uint8_t SPIFlashStorage::m_pageData[SPI_FLASH_PageSize];
30
 uint8_t SPIFlashStorage::m_pageData[SPI_FLASH_PageSize];
33
 uint32_t SPIFlashStorage::m_currentPage;
31
 uint32_t SPIFlashStorage::m_currentPage;
34
 uint16_t SPIFlashStorage::m_pageDataUsed;
32
 uint16_t SPIFlashStorage::m_pageDataUsed;

+ 0
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp View File

49
   #include "../../../../feature/pause.h"
49
   #include "../../../../feature/pause.h"
50
 #endif
50
 #endif
51
 
51
 
52
-W25QXXFlash W25QXX;
53
 CFG_ITMES gCfgItems;
52
 CFG_ITMES gCfgItems;
54
 UI_CFG uiCfg;
53
 UI_CFG uiCfg;
55
 DISP_STATE_STACK disp_state_stack;
54
 DISP_STATE_STACK disp_state_stack;

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

156
 extern void default_view_Read(uint8_t *default_view_Rbuff, uint32_t default_view_Readsize);
156
 extern void default_view_Read(uint8_t *default_view_Rbuff, uint32_t default_view_Readsize);
157
 extern void flash_view_Read(uint8_t *flash_view_Rbuff, uint32_t flash_view_Readsize);
157
 extern void flash_view_Read(uint8_t *flash_view_Rbuff, uint32_t flash_view_Readsize);
158
 
158
 
159
-extern W25QXXFlash W25QXX;
160
-
161
 #ifdef __cplusplus
159
 #ifdef __cplusplus
162
 } /* C-declarations for C++ */
160
 } /* C-declarations for C++ */
163
 #endif
161
 #endif

+ 2
- 1
Marlin/src/libs/W25Qxx.cpp View File

24
 
24
 
25
 #if HAS_SPI_FLASH
25
 #if HAS_SPI_FLASH
26
 
26
 
27
+#include "W25Qxx.h"
27
 #include <SPI.h>
28
 #include <SPI.h>
28
 
29
 
29
-#include "W25Qxx.h"
30
+W25QXXFlash W25QXX;
30
 
31
 
31
 #ifndef SPI_FLASH_MISO_PIN
32
 #ifndef SPI_FLASH_MISO_PIN
32
   #define SPI_FLASH_MISO_PIN W25QXX_MISO_PIN
33
   #define SPI_FLASH_MISO_PIN W25QXX_MISO_PIN

+ 2
- 8
Marlin/src/libs/W25Qxx.h View File

1
-/**
1
+/**
2
  * Marlin 3D Printer Firmware
2
  * Marlin 3D Printer Firmware
3
  * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
3
  * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
  *
4
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
 
23
 
24
-//#ifdef __cplusplus
25
-//extern "C" { /* C-declarations for C++ */
26
-//#endif
27
-
28
 #include <stdint.h>
24
 #include <stdint.h>
29
 
25
 
30
 #define W25X_WriteEnable        0x06
26
 #define W25X_WriteEnable        0x06
71
   static void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead);
67
   static void SPI_FLASH_BufferRead(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead);
72
 };
68
 };
73
 
69
 
74
-//#ifdef __cplusplus
75
-//} /* C-declarations for C++ */
76
-//#endif
70
+extern W25QXXFlash W25QXX;

Loading…
Cancel
Save