Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» IA RTS refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 14, 2023
1 parent 18e63ad commit 5201869
Show file tree
Hide file tree
Showing 4 changed files with 2,210 additions and 2,218 deletions.
26 changes: 13 additions & 13 deletions Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,23 @@ void FileNavigator::getFiles(uint16_t index) {
// Clear currently drawn screen
for (int i = 0; i < DISPLAY_FILES; i++) {
for (int j = 0; j < 20; j++)
rtscheck.RTS_SndData(0, SDFILE_ADDR + (i * 20) + j);
rts.sendData(0, SDFILE_ADDR + (i * 20) + j);
}

for (int j = 0; j < 10; j++) {
rtscheck.RTS_SndData(0, Printfilename + j); // clear screen.
rtscheck.RTS_SndData(0, Choosefilename + j); // clear filename
rts.sendData(0, Printfilename + j); // clear screen.
rts.sendData(0, Choosefilename + j); // clear filename
}
for (int j = 0; j < 8; j++)
rtscheck.RTS_SndData(0, FilenameCount + j);
rts.sendData(0, FilenameCount + j);
for (int j = 1; j <= DISPLAY_FILES; j++) {
rtscheck.RTS_SndData(10, FilenameIcon + j);
rtscheck.RTS_SndData(10, FilenameIcon1 + j);
rts.sendData(10, FilenameIcon + j);
rts.sendData(10, FilenameIcon1 + j);
}

if (currentindex == 0 && folderdepth > 0) { // Add a link to go up a folder
files--;
rtscheck.RTS_SndData("Up Directory", SDFILE_ADDR);
rts.sendData("Up Directory", SDFILE_ADDR);
fcnt++;
}
else if (currentindex == DISPLAY_FILES && folderdepth > 0)
Expand All @@ -123,18 +123,18 @@ void FileNavigator::getFiles(uint16_t index) {
if (filelen > 20) {
char *buf = (char *)filelist.filename();
buf[18] = '\0'; // cutoff at screen edge
rtscheck.RTS_SndData(buf, (SDFILE_ADDR + (fcnt * 20)));
rts.sendData(buf, (SDFILE_ADDR + (fcnt * 20)));
}
else
rtscheck.RTS_SndData(filelist.filename(), (SDFILE_ADDR + (fcnt * 20)));
rts.sendData(filelist.filename(), (SDFILE_ADDR + (fcnt * 20)));

if (filelist.isDir()) {
rtscheck.RTS_SndData((uint8_t)4, FilenameIcon + (fcnt+1));
rtscheck.RTS_SndData((unsigned long)0x041F, (FilenameNature + ((1+fcnt) * 16))); // Change BG of selected line to Blue
rts.sendData((uint8_t)4, FilenameIcon + (fcnt+1));
rts.sendData((unsigned long)0x041F, (FilenameNature + ((1+fcnt) * 16))); // Change BG of selected line to Blue
}
else {
rtscheck.RTS_SndData((uint8_t)0, FilenameIcon + (fcnt+1));
rtscheck.RTS_SndData((unsigned long)0xFFFF, (FilenameNature + ((1+fcnt) * 16))); // white
rts.sendData((uint8_t)0, FilenameIcon + (fcnt+1));
rts.sendData((unsigned long)0xFFFF, (FilenameNature + ((1+fcnt) * 16))); // white
}
SERIAL_ECHOLNPGM("-", seek, " '", filelist.filename(), "' '", currentfoldername, "", filelist.shortFilename(), "'\n");
fcnt++;
Expand Down
Loading

0 comments on commit 5201869

Please sign in to comment.