Simplify serial port redirect (#13234)

This commit is contained in:
Scott Lahteine
2019-02-23 22:53:01 -06:00
committed by GitHub
parent 88cc1d1a31
commit e15354e387
22 changed files with 575 additions and 876 deletions

View File

@@ -70,24 +70,12 @@ public:
const bool re_sort=false
#endif
);
static void report_status(
#if NUM_SERIAL > 1
const int8_t port = -1
#endif
);
static void report_status();
static void printingHasFinished();
static void printFilename(
#if NUM_SERIAL > 1
const int8_t port = -1
#endif
);
static void printFilename();
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
static void printLongPath(char *path
#if NUM_SERIAL > 1
, const int8_t port = -1
#endif
);
static void printLongPath(char *path);
#endif
static void getfilename(uint16_t nr, const char* const match=NULL);
@@ -95,11 +83,7 @@ public:
static void getAbsFilename(char *t);
static void ls(
#if NUM_SERIAL > 1
const int8_t port = -1
#endif
);
static void ls();
static void chdir(const char *relpath);
static int8_t updir();
static void setroot();
@@ -144,13 +128,9 @@ public:
#if ENABLED(AUTO_REPORT_SD_STATUS)
static void auto_report_sd_status(void);
static inline void set_auto_report_interval(uint8_t v
static inline void set_auto_report_interval(const uint8_t v) {
#if NUM_SERIAL > 1
, int8_t port
#endif
) {
#if NUM_SERIAL > 1
serialport = port;
auto_report_port = serial_port_index;
#endif
NOMORE(v, 60);
auto_report_sd_interval = v;
@@ -167,9 +147,9 @@ public:
#if ENABLED(FAST_FILE_TRANSFER)
#if NUM_SERIAL > 1
static uint8_t transfer_port;
static int8_t transfer_port;
#else
static constexpr uint8_t transfer_port = 0;
static constexpr int8_t transfer_port = SERIAL_PORT;
#endif
#endif
@@ -244,11 +224,7 @@ private:
static LsAction lsAction; //stored for recursion.
static uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
static char *diveDirName;
static void lsDive(const char *prepend, SdFile parent, const char * const match=NULL
#if NUM_SERIAL > 1
, const int8_t port = -1
#endif
);
static void lsDive(const char *prepend, SdFile parent, const char * const match=NULL);
#if ENABLED(SDCARD_SORT_ALPHA)
static void flush_presort();
@@ -258,7 +234,7 @@ private:
static uint8_t auto_report_sd_interval;
static millis_t next_sd_report_ms;
#if NUM_SERIAL > 1
static int8_t serialport;
static int8_t auto_report_port;
#endif
#endif
};