Add fast binary file transfer to SD card option (#12249)
This commit is contained in:
		
				
					committed by
					
						
						Scott Lahteine
					
				
			
			
				
	
			
			
			
						parent
						
							72d8adfd1e
						
					
				
				
					commit
					66d44c72c3
				
			@@ -124,11 +124,8 @@ public:
 | 
			
		||||
  FORCE_INLINE uint32_t getIndex() { return sdpos; }
 | 
			
		||||
  FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; }
 | 
			
		||||
  FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; }
 | 
			
		||||
 | 
			
		||||
  #if defined(__STM32F1__) && ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
 | 
			
		||||
    FORCE_INLINE int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; }
 | 
			
		||||
    FORCE_INLINE int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; }
 | 
			
		||||
  #endif
 | 
			
		||||
  FORCE_INLINE int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; }
 | 
			
		||||
  FORCE_INLINE int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; }
 | 
			
		||||
 | 
			
		||||
  Sd2Card& getSd2Card() { return sd2card; }
 | 
			
		||||
 | 
			
		||||
@@ -154,6 +151,16 @@ public:
 | 
			
		||||
  bool saving, logging, sdprinting, cardOK, filenameIsDir, abort_sd_printing;
 | 
			
		||||
  char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH];
 | 
			
		||||
  int8_t autostart_index;
 | 
			
		||||
 | 
			
		||||
  #if ENABLED(FAST_FILE_TRANSFER)
 | 
			
		||||
    bool binary_mode;
 | 
			
		||||
    #if NUM_SERIAL > 1
 | 
			
		||||
      uint8_t transfer_port;
 | 
			
		||||
    #else
 | 
			
		||||
      constexpr uint8_t transfer_port = 0;
 | 
			
		||||
    #endif
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  SdFile root, workDir, workDirParents[MAX_DIR_DEPTH];
 | 
			
		||||
  uint8_t workDirDepth;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user