New ML support - lcd optimalization
lcd_puts_P and lcd_printf_P functions LineFeed implemented in LiquidCrystal_Prusa
This commit is contained in:
parent
0f75bcb442
commit
0cf7d12ae3
4 changed files with 36 additions and 10 deletions
|
@ -273,7 +273,7 @@ void LiquidCrystal_Prusa::setCursor(uint8_t col, uint8_t row)
|
|||
if ( row >= _numlines ) {
|
||||
row = _numlines-1; // we count rows starting w/0
|
||||
}
|
||||
|
||||
_currline = row;
|
||||
command(LCD_SETDDRAMADDR | (col + row_offsets[row]));
|
||||
}
|
||||
|
||||
|
@ -356,6 +356,12 @@ inline void LiquidCrystal_Prusa::command(uint8_t value) {
|
|||
}
|
||||
|
||||
inline size_t LiquidCrystal_Prusa::write(uint8_t value) {
|
||||
if (value == '\n')
|
||||
{
|
||||
if (_currline > 3) _currline = -1;
|
||||
setCursor(0, _currline + 1); // LF
|
||||
return 1;
|
||||
}
|
||||
if (_escape[0] || (value == 0x1b))
|
||||
return escape_write(value);
|
||||
send(value, HIGH);
|
||||
|
@ -421,7 +427,7 @@ inline size_t LiquidCrystal_Prusa::escape_write(uint8_t chr)
|
|||
break;
|
||||
case '2':
|
||||
if (chr == 'J') // escape = "\x1b[2J"
|
||||
{ clear(); break; } // EraseScreen
|
||||
{ clear(); _currline = 0; break; } // EraseScreen
|
||||
default:
|
||||
if (e_2_is_num && // escape = "\x1b[%1d"
|
||||
((chr == ';') || // escape = "\x1b[%1d;"
|
||||
|
|
|
@ -903,14 +903,18 @@ int uart_putchar(char c, FILE *stream)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void lcd_splash()
|
||||
{
|
||||
// lcd_print_at_PGM(0, 1, PSTR(" Original Prusa "));
|
||||
// lcd_print_at_PGM(0, 2, PSTR(" 3D Printers "));
|
||||
// lcd.print_P(PSTR("\x1b[1;3HOriginal Prusa\x1b[2;4H3D Printers"));
|
||||
fputs_P(PSTR(ESC_2J ESC_H(1,1) "Original Prusa i3" ESC_H(3,2) "Prusa Research"), lcdout);
|
||||
// fputs_P(PSTR(ESC_2J ESC_H(1,1) "Original Prusa i3" ESC_H(3,2) "Prusa Research"), lcdout);
|
||||
lcd_puts_P(PSTR(ESC_2J ESC_H(1,1) "Original Prusa i3" ESC_H(3,2) "Prusa Research"));
|
||||
// lcd_printf_P(_N(ESC_2J "x:%.3f\ny:%.3f\nz:%.3f\ne:%.3f"), _x, _y, _z, _e);
|
||||
}
|
||||
|
||||
|
||||
void factory_reset()
|
||||
{
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
|
@ -1169,6 +1173,7 @@ void setup()
|
|||
SERIAL_ECHO_START;
|
||||
printf_P(PSTR(" " FW_VERSION_FULL "\n"));
|
||||
|
||||
|
||||
#ifdef DEBUG_SEC_LANG
|
||||
lang_table_header_t header;
|
||||
uint32_t src_addr = 0x00000;
|
||||
|
|
|
@ -26,7 +26,22 @@
|
|||
#include "tmc2130.h"
|
||||
#endif //TMC2130
|
||||
|
||||
#define _STRINGIFY(s) #s
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
int lcd_puts_P(const char* str)
|
||||
{
|
||||
return fputs_P(str, lcdout);
|
||||
}
|
||||
|
||||
int lcd_printf_P(const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
int ret = vfprintf_P(lcdout, format, args);
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
|
||||
|
@ -4058,8 +4073,7 @@ void lcd_wizard(int state) {
|
|||
}
|
||||
}
|
||||
|
||||
SERIAL_ECHOPGM("State: ");
|
||||
MYSERIAL.println(state);
|
||||
printf_P(_N("State: %d\n"), state);
|
||||
switch (state) { //final message
|
||||
case 0: //user dont want to use wizard
|
||||
msg = _T(MSG_WIZARD_QUIT);
|
||||
|
@ -6370,8 +6384,7 @@ static bool lcd_selfcheck_axis_sg(char axis) {
|
|||
//end of second measurement, now check for possible errors:
|
||||
|
||||
for(int i = 0; i < 2; i++){ //check if measured axis length corresponds to expected length
|
||||
SERIAL_ECHOPGM("Measured axis length:");
|
||||
MYSERIAL.println(measured_axis_length[i]);
|
||||
printf_P(_N("Measured axis length:%.3f\n"), measured_axis_length[i]);
|
||||
if (abs(measured_axis_length[i] - axis_length) > max_error_mm) {
|
||||
enable_endstops(false);
|
||||
|
||||
|
@ -6390,8 +6403,7 @@ static bool lcd_selfcheck_axis_sg(char axis) {
|
|||
}
|
||||
}
|
||||
|
||||
SERIAL_ECHOPGM("Axis length difference:");
|
||||
MYSERIAL.println(abs(measured_axis_length[0] - measured_axis_length[1]));
|
||||
printf_P(_N("Axis length difference:%.3f\n"), abs(measured_axis_length[0] - measured_axis_length[1]));
|
||||
|
||||
if (abs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low
|
||||
//loose pulleys
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
#include "Marlin.h"
|
||||
#include "mesh_bed_calibration.h"
|
||||
|
||||
extern int lcd_puts_P(const char* str);
|
||||
extern int lcd_printf_P(const char* format, ...);
|
||||
|
||||
#ifdef ULTRA_LCD
|
||||
|
||||
static void lcd_language_menu();
|
||||
|
|
Loading…
Reference in a new issue