From a55aed29b42ddbfd6c0fe1bb50d9fa232b3bf657 Mon Sep 17 00:00:00 2001 From: milek7 Date: Tue, 26 Sep 2017 16:27:13 +0200 Subject: [PATCH] uart pressure changes --- uart.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uart.cpp b/uart.cpp index 0bf3f938..8c4dcc1b 100644 --- a/uart.cpp +++ b/uart.cpp @@ -137,9 +137,9 @@ void uart_input::poll() uint8_t buzzer = (uint8_t)t->get_alarm(); uint8_t tacho = (uint8_t)t->get_tacho(); - uint16_t tank_press = (uint16_t)std::min(conf.tankuart, t->get_tank_pressure() / conf.tankmax * conf.tankuart); - uint16_t pipe_press = (uint16_t)std::min(conf.pipeuart, t->get_pipe_pressure() / conf.pipemax * conf.pipeuart); - uint16_t brake_press = (uint16_t)std::min(conf.brakeuart, t->get_brake_pressure() / conf.brakemax * conf.brakeuart); + uint16_t tank_press = (uint16_t)std::min(conf.tankuart, t->get_tank_pressure() * 0.1f / conf.tankmax * conf.tankuart); + uint16_t pipe_press = (uint16_t)std::min(conf.pipeuart, t->get_pipe_pressure() * 0.1f / conf.pipemax * conf.pipeuart); + uint16_t brake_press = (uint16_t)std::min(conf.brakeuart, t->get_brake_pressure() * 0.1f / conf.brakemax * conf.brakeuart); uint16_t hv_voltage = (uint16_t)std::min(conf.hvuart, t->get_hv_voltage() / conf.hvmax * conf.hvuart); auto current = t->get_current(); uint16_t current1 = (uint16_t)std::min(conf.currentuart, current[0]) / conf.currentmax * conf.currentuart;