16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 17:09:19 +02:00

(uart) add possibility to enable/disable UART transmission from Debug panel

This commit is contained in:
Marcin Nowak
2021-10-16 16:56:28 +02:00
parent a0153b1d7b
commit 3f308cf812
3 changed files with 38 additions and 13 deletions

View File

@@ -614,7 +614,7 @@ debug_panel::render() {
render_section_settings();
#ifdef WITH_UART
if(true == render_section( "UART", m_uartlines)) {
//ImGui::Checkbox("Enabled", &Global.uart_conf.enable);
ImGui::Checkbox("Enabled", &Application.uart_status.enabled);
}
#endif
// toggles
@@ -1230,8 +1230,14 @@ debug_panel::update_section_scantable( std::vector<text_line> &Output ) {
#ifdef WITH_UART
void
debug_panel::update_section_uart( std::vector<text_line> &Output ) {
Output.emplace_back(("Port: " + Global.uart_conf.port).c_str(), Global.UITextColor);
Output.emplace_back(("Baud: " + std::to_string(Global.uart_conf.baud)).c_str(), Global.UITextColor);
Output.emplace_back(
("Port: " + Application.uart_status.port_name).c_str(),
Global.UITextColor
);
Output.emplace_back(
("Baud: " + std::to_string(Application.uart_status.baud)).c_str(),
Global.UITextColor
);
if(Application.uart_status.is_connected) {
std::string synctext = Application.uart_status.is_synced ? "SYNCED" : "NOT SYNCED";
Output.emplace_back(("CONNECTED, " + synctext).c_str(), Global.UITextColor);