moving application communications buffer to the application class

This commit is contained in:
Attila Body 2020-11-16 00:17:19 +01:00
parent ba34922951
commit 0e09fd9a7a
2 changed files with 8 additions and 9 deletions

View file

@ -57,8 +57,6 @@ Application::Application()
void Application::Loop() void Application::Loop()
{ {
char buffer[128];
Ili9341Fsmc &lcd(Ili9341Fsmc::Init(nullptr, nullptr, DMA2, LL_DMA_STREAM_4, false)); Ili9341Fsmc &lcd(Ili9341Fsmc::Init(nullptr, nullptr, DMA2, LL_DMA_STREAM_4, false));
lcd.SetScrollMode(true); lcd.SetScrollMode(true);
@ -88,13 +86,13 @@ void Application::Loop()
uint16_t x = ReadTouch(SPI2, true); uint16_t x = ReadTouch(SPI2, true);
uint16_t y = ReadTouch(SPI2, false); uint16_t y = ReadTouch(SPI2, false);
unsigned len = strcpy_ex(buffer, "X: "); unsigned len = strcpy_ex(m_appBuffer, "X: ");
len += uitodec(buffer+len, x); len += uitodec(m_appBuffer+len, x);
len += strcpy_ex(buffer + len, ", Y: "); len += strcpy_ex(m_appBuffer + len, ", Y: ");
len += uitodec(buffer + len, y); len += uitodec(m_appBuffer + len, y);
len += strcpy_ex(buffer + len, "\r\n"); len += strcpy_ex(m_appBuffer + len, "\r\n");
lcd.Print(buffer, len); lcd.Print(m_appBuffer, len);
m_console.SendLine(buffer, len); m_console.SendLine(m_appBuffer, len);
} }
} }
} }

View file

@ -40,6 +40,7 @@ private:
SerialConsole<257> m_console; SerialConsole<257> m_console;
volatile bool m_lineReceived = false; volatile bool m_lineReceived = false;
volatile SerialConsole<257>::Buffer *m_rcvdBuffer; volatile SerialConsole<257>::Buffer *m_rcvdBuffer;
char m_appBuffer[128];
volatile bool m_transmissionCompleted = true; volatile bool m_transmissionCompleted = true;
}; };