16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 06:29:18 +02:00

(uart, driveruipanels) add possibility to change uart baud rate in debug panel

This commit is contained in:
Marcin Nowak
2021-10-27 02:14:06 +02:00
parent 855ab880d8
commit f2c74d2f08
3 changed files with 57 additions and 0 deletions

View File

@@ -34,6 +34,10 @@ http://mozilla.org/MPL/2.0/.
#define DRIVER_HINT_CONTENT
#include "driverhints.h"
#ifdef WITH_UART
#include "uart.h"
#endif
void
drivingaid_panel::update() {
@@ -548,7 +552,9 @@ debug_panel::update() {
m_powergridlines.clear();
m_cameralines.clear();
m_rendererlines.clear();
#ifdef WITH_UART
m_uartlines.clear();
#endif
update_section_vehicle( m_vehiclelines );
update_section_engine( m_enginelines );
@@ -559,7 +565,9 @@ debug_panel::update() {
update_section_powergrid( m_powergridlines );
update_section_camera( m_cameralines );
update_section_renderer( m_rendererlines );
#ifdef WITH_UART
update_section_uart(m_uartlines);
#endif
}
void
@@ -621,6 +629,7 @@ debug_panel::render() {
avlports[i] = (char *) Application.uart_status.available_ports[i].c_str();
}
ImGui::Combo("Port", &Application.uart_status.selected_port_index, avlports, ports_num);
ImGui::Combo("Baud", &Application.uart_status.selected_baud_index, uart_baudrates_list, uart_baudrates_list_num);
}
ImGui::Checkbox("Enabled", &Application.uart_status.enabled);
}