moving application communications buffer to the application class
This commit is contained in:
parent
7ffe69927f
commit
3a20a7d846
2 changed files with 8 additions and 9 deletions
|
@ -57,8 +57,6 @@ Application::Application()
|
|||
|
||||
void Application::Loop()
|
||||
{
|
||||
char buffer[128];
|
||||
|
||||
Ili9341Fsmc &lcd(Ili9341Fsmc::Init(nullptr, nullptr, DMA2, LL_DMA_STREAM_4, false));
|
||||
lcd.SetScrollMode(true);
|
||||
|
||||
|
@ -88,13 +86,13 @@ void Application::Loop()
|
|||
|
||||
uint16_t x = ReadTouch(SPI2, true);
|
||||
uint16_t y = ReadTouch(SPI2, false);
|
||||
unsigned len = strcpy_ex(buffer, "X: ");
|
||||
len += uitodec(buffer+len, x);
|
||||
len += strcpy_ex(buffer + len, ", Y: ");
|
||||
len += uitodec(buffer + len, y);
|
||||
len += strcpy_ex(buffer + len, "\r\n");
|
||||
lcd.Print(buffer, len);
|
||||
m_console.SendLine(buffer, len);
|
||||
unsigned len = strcpy_ex(m_appBuffer, "X: ");
|
||||
len += uitodec(m_appBuffer+len, x);
|
||||
len += strcpy_ex(m_appBuffer + len, ", Y: ");
|
||||
len += uitodec(m_appBuffer + len, y);
|
||||
len += strcpy_ex(m_appBuffer + len, "\r\n");
|
||||
lcd.Print(m_appBuffer, len);
|
||||
m_console.SendLine(m_appBuffer, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ private:
|
|||
SerialConsole<257> m_console;
|
||||
volatile bool m_lineReceived = false;
|
||||
volatile SerialConsole<257>::Buffer *m_rcvdBuffer;
|
||||
char m_appBuffer[128];
|
||||
|
||||
volatile bool m_transmissionCompleted = true;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue