Fix Chiron typos, file nav

This commit is contained in:
Scott Lahteine 2021-04-20 19:16:27 -05:00
parent 778b8a45e9
commit 57d0f0ce2e
3 changed files with 4 additions and 3 deletions

View File

@ -75,7 +75,7 @@ void FileNavigator::reset() {
currentfolderdepth = 0; currentfolderdepth = 0;
currentindex = 0; currentindex = 0;
lastpanelindex = 0; lastpanelindex = 0;
ZERO(currentfolderindex) ZERO(currentfolderindex);
// Start at root folder // Start at root folder
while (!filelist.isAtRootDir()) filelist.upDir(); while (!filelist.isAtRootDir()) filelist.upDir();
@ -108,7 +108,7 @@ void FileNavigator::upDIR() {
if (currentfolderdepth == 0) if (currentfolderdepth == 0)
currentfoldername[0] = '\0'; currentfoldername[0] = '\0';
else { else {
const char *pos = strchr(currentfoldername, '/'); char * const pos = strchr(currentfoldername, '/');
*(pos + 1) = '\0'; *(pos + 1) = '\0';
} }
} }

View File

@ -38,6 +38,7 @@ namespace Anycubic {
class FileNavigator { class FileNavigator {
public: public:
FileNavigator();
static void reset(); static void reset();
static void getFiles(uint16_t, panel_type_t, uint8_t filesneeded=4); static void getFiles(uint16_t, panel_type_t, uint8_t filesneeded=4);
static void upDIR(); static void upDIR();

View File

@ -466,7 +466,7 @@ void ChironTFT::SelectFile() {
void ChironTFT::ProcessPanelRequest() { void ChironTFT::ProcessPanelRequest() {
// Break these up into logical blocks // as its easier to navigate than one huge switch case! // Break these up into logical blocks // as its easier to navigate than one huge switch case!
const int8_t tpos = FindToken('A'); int8_t tpos = FindToken('A');
// Panel request are 'A0' - 'A36' // Panel request are 'A0' - 'A36'
if (tpos != -1) { if (tpos != -1) {
const int8_t req = atoi(&panel_command[tpos+1]); const int8_t req = atoi(&panel_command[tpos+1]);