Fix and improve STM32F1 serial (#19464)

This commit is contained in:
Jason Smith
2020-09-24 18:28:48 -07:00
committed by Scott Lahteine
parent 449a31dea9
commit 9d02cedfed
28 changed files with 1009 additions and 942 deletions

View File

@@ -59,12 +59,12 @@ char *itostr2(const uint8_t &x) {
}
static void sendNewLine(void) {
ANYCUBIC_LCD_SERIAL.write('\r');
ANYCUBIC_LCD_SERIAL.write('\n');
LCD_SERIAL.write('\r');
LCD_SERIAL.write('\n');
}
static void send(const char *str) {
ANYCUBIC_LCD_SERIAL.print(str);
LCD_SERIAL.print(str);
}
static void sendLine(const char *str) {
@@ -74,7 +74,7 @@ static void sendLine(const char *str) {
static void send_P(PGM_P str) {
while (const char c = pgm_read_byte(str++))
ANYCUBIC_LCD_SERIAL.write(c);
LCD_SERIAL.write(c);
}
static void sendLine_P(PGM_P str) {
@@ -576,8 +576,8 @@ void AnycubicTFTClass::OnPrintTimerStopped() {
void AnycubicTFTClass::GetCommandFromTFT() {
char *starpos = NULL;
while (ANYCUBIC_LCD_SERIAL.available() > 0 && TFTbuflen < TFTBUFSIZE) {
serial3_char = ANYCUBIC_LCD_SERIAL.read();
while (LCD_SERIAL.available() > 0 && TFTbuflen < TFTBUFSIZE) {
serial3_char = LCD_SERIAL.read();
if (serial3_char == '\n' ||
serial3_char == '\r' ||
serial3_char == ':' ||
@@ -639,11 +639,11 @@ void AnycubicTFTClass::GetCommandFromTFT() {
float yPostition = ExtUI::getAxisPosition_mm(ExtUI::Y);
float zPostition = ExtUI::getAxisPosition_mm(ExtUI::Z);
SEND_PGM("A5V X: ");
ANYCUBIC_LCD_SERIAL.print(xPostition);
LCD_SERIAL.print(xPostition);
SEND_PGM(" Y: ");
ANYCUBIC_LCD_SERIAL.print(yPostition);
LCD_SERIAL.print(yPostition);
SEND_PGM(" Z: ");
ANYCUBIC_LCD_SERIAL.print(zPostition);
LCD_SERIAL.print(zPostition);
SENDLINE_PGM("");
}
break;