Status bar, lcd optimization, compile warning fix
This commit is contained in:
parent
f87b5a2be7
commit
960f4a88ed
|
|
@ -741,9 +741,6 @@ void CardReader::presort() {
|
||||||
fileCnt = SDSORT_LIMIT;
|
fileCnt = SDSORT_LIMIT;
|
||||||
}
|
}
|
||||||
lcd_clear();
|
lcd_clear();
|
||||||
#if !SDSORT_USES_RAM
|
|
||||||
lcd_set_progress();
|
|
||||||
#endif
|
|
||||||
lcd_puts_at_P(0, 1, _i("Sorting files"));////MSG_SORTING c=20 r=1
|
lcd_puts_at_P(0, 1, _i("Sorting files"));////MSG_SORTING c=20 r=1
|
||||||
|
|
||||||
// Sort order is always needed. May be static or dynamic.
|
// Sort order is always needed. May be static or dynamic.
|
||||||
|
|
@ -837,11 +834,26 @@ void CardReader::presort() {
|
||||||
#define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1))
|
#define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1))
|
||||||
#define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? dir1 : !dir1))
|
#define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? dir1 : !dir1))
|
||||||
|
|
||||||
for (int16_t gap = fileCnt/2; gap > 0; gap /= 2)
|
uint16_t counter = 0;
|
||||||
|
uint16_t total = 0;
|
||||||
|
for (uint16_t i = fileCnt/2; i > 0; i /= 2) total += fileCnt - i; //total runs for progress bar
|
||||||
|
|
||||||
|
for (uint16_t gap = fileCnt/2; gap > 0; gap /= 2)
|
||||||
{
|
{
|
||||||
for (int16_t i = gap; i < fileCnt; i++)
|
for (uint16_t i = gap; i < fileCnt; i++)
|
||||||
{
|
{
|
||||||
if (!IS_SD_INSERTED) return;
|
if (!IS_SD_INSERTED) return;
|
||||||
|
|
||||||
|
int8_t percent = (counter * 100) / total;
|
||||||
|
for (int column = 0; column < 20; column++) {
|
||||||
|
if (column < (percent / 5))
|
||||||
|
{
|
||||||
|
lcd_set_cursor(column, 2);
|
||||||
|
lcd_print('\xFF'); //simple progress bar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
counter++;
|
||||||
|
|
||||||
manage_heater();
|
manage_heater();
|
||||||
uint8_t orderBckp = sort_order[i];
|
uint8_t orderBckp = sort_order[i];
|
||||||
getfilename_simple(positions[orderBckp]);
|
getfilename_simple(positions[orderBckp]);
|
||||||
|
|
@ -852,7 +864,7 @@ void CardReader::presort() {
|
||||||
bool dir1 = filenameIsDir;
|
bool dir1 = filenameIsDir;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int16_t j = i;
|
uint16_t j = i;
|
||||||
getfilename_simple(positions[sort_order[j - gap]]);
|
getfilename_simple(positions[sort_order[j - gap]]);
|
||||||
char *name2 = LONGEST_FILENAME; // use the string in-place
|
char *name2 = LONGEST_FILENAME; // use the string in-place
|
||||||
#if HAS_FOLDER_SORTING
|
#if HAS_FOLDER_SORTING
|
||||||
|
|
@ -878,7 +890,6 @@ void CardReader::presort() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#else //Bubble Sort
|
#else //Bubble Sort
|
||||||
uint32_t counter = 0;
|
uint32_t counter = 0;
|
||||||
uint16_t total = 0.5*(fileCnt - 1)*(fileCnt);
|
uint16_t total = 0.5*(fileCnt - 1)*(fileCnt);
|
||||||
|
|
@ -924,7 +935,7 @@ void CardReader::presort() {
|
||||||
if (column < (percent / 5))
|
if (column < (percent / 5))
|
||||||
{
|
{
|
||||||
lcd_set_cursor(column, 2);
|
lcd_set_cursor(column, 2);
|
||||||
lcd_print('\x01'); //simple progress bar
|
lcd_print('\xFF'); //simple progress bar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
counter++;
|
counter++;
|
||||||
|
|
@ -1010,10 +1021,9 @@ void CardReader::presort() {
|
||||||
for (int column = 0; column <= 19; column++)
|
for (int column = 0; column <= 19; column++)
|
||||||
{
|
{
|
||||||
lcd_set_cursor(column, 2);
|
lcd_set_cursor(column, 2);
|
||||||
lcd_print('\x01'); //simple progress bar
|
lcd_print('\xFF'); //simple progress bar
|
||||||
}
|
}
|
||||||
_delay(300);
|
_delay(300);
|
||||||
lcd_set_degree();
|
|
||||||
lcd_clear();
|
lcd_clear();
|
||||||
#endif
|
#endif
|
||||||
lcd_update(2);
|
lcd_update(2);
|
||||||
|
|
|
||||||
|
|
@ -957,21 +957,6 @@ void lcd_set_custom_characters_arrows(void)
|
||||||
lcd_createChar_P(1, lcd_chardata_arrdown);
|
lcd_createChar_P(1, lcd_chardata_arrdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t lcd_chardata_progress[8] PROGMEM = {
|
|
||||||
B11111,
|
|
||||||
B11111,
|
|
||||||
B11111,
|
|
||||||
B11111,
|
|
||||||
B11111,
|
|
||||||
B11111,
|
|
||||||
B11111,
|
|
||||||
B11111};
|
|
||||||
|
|
||||||
void lcd_set_custom_characters_progress(void)
|
|
||||||
{
|
|
||||||
lcd_createChar_P(1, lcd_chardata_progress);
|
|
||||||
}
|
|
||||||
|
|
||||||
const uint8_t lcd_chardata_arr2down[8] PROGMEM = {
|
const uint8_t lcd_chardata_arr2down[8] PROGMEM = {
|
||||||
B00000,
|
B00000,
|
||||||
B00000,
|
B00000,
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,6 @@ private:
|
||||||
|
|
||||||
extern void lcd_set_custom_characters(void);
|
extern void lcd_set_custom_characters(void);
|
||||||
extern void lcd_set_custom_characters_arrows(void);
|
extern void lcd_set_custom_characters_arrows(void);
|
||||||
extern void lcd_set_custom_characters_progress(void);
|
|
||||||
extern void lcd_set_custom_characters_nextpage(void);
|
extern void lcd_set_custom_characters_nextpage(void);
|
||||||
extern void lcd_set_custom_characters_degree(void);
|
extern void lcd_set_custom_characters_degree(void);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4590,17 +4590,10 @@ static void lcd_fsensor_state_set()
|
||||||
}
|
}
|
||||||
#endif //FILAMENT_SENSOR
|
#endif //FILAMENT_SENSOR
|
||||||
|
|
||||||
|
|
||||||
#if !SDSORT_USES_RAM
|
|
||||||
void lcd_set_degree() {
|
void lcd_set_degree() {
|
||||||
lcd_set_custom_characters_degree();
|
lcd_set_custom_characters_degree();
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_set_progress() {
|
|
||||||
lcd_set_custom_characters_progress();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (LANG_MODE != 0)
|
#if (LANG_MODE != 0)
|
||||||
|
|
||||||
void menu_setlang(unsigned char lang)
|
void menu_setlang(unsigned char lang)
|
||||||
|
|
@ -8665,7 +8658,6 @@ static void lcd_connect_printer() {
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int t = 0;
|
int t = 0;
|
||||||
lcd_set_custom_characters_progress();
|
|
||||||
lcd_puts_at_P(0, 0, _i("Connect printer to"));
|
lcd_puts_at_P(0, 0, _i("Connect printer to"));
|
||||||
lcd_puts_at_P(0, 1, _i("monitoring or hold"));
|
lcd_puts_at_P(0, 1, _i("monitoring or hold"));
|
||||||
lcd_puts_at_P(0, 2, _i("the knob to continue"));
|
lcd_puts_at_P(0, 2, _i("the knob to continue"));
|
||||||
|
|
@ -8682,12 +8674,11 @@ static void lcd_connect_printer() {
|
||||||
i = 0;
|
i = 0;
|
||||||
lcd_puts_at_P(0, 3, PSTR(" "));
|
lcd_puts_at_P(0, 3, PSTR(" "));
|
||||||
}
|
}
|
||||||
if (i!=0) lcd_puts_at_P((i * 20) / (NC_BUTTON_LONG_PRESS * 10), 3, "\x01");
|
if (i!=0) lcd_puts_at_P((i * 20) / (NC_BUTTON_LONG_PRESS * 10), 3, "\xFF");
|
||||||
if (i == NC_BUTTON_LONG_PRESS * 10) {
|
if (i == NC_BUTTON_LONG_PRESS * 10) {
|
||||||
no_response = false;
|
no_response = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lcd_set_custom_characters_degree();
|
|
||||||
lcd_update_enable(true);
|
lcd_update_enable(true);
|
||||||
lcd_update(2);
|
lcd_update(2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -213,10 +213,7 @@ void lcd_temp_calibration_set();
|
||||||
|
|
||||||
void display_loading();
|
void display_loading();
|
||||||
|
|
||||||
#if !SDSORT_USES_RAM
|
|
||||||
void lcd_set_degree();
|
void lcd_set_degree();
|
||||||
void lcd_set_progress();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void lcd_language();
|
void lcd_language();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue