genesys: Throw an exception when motor speed is too low

merge-requests/244/head
Povilas Kanapickas 2020-06-27 00:47:15 +03:00
rodzic f6f891bd93
commit 6fdc5e6e1f
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -141,6 +141,10 @@ MotorSlopeTable create_slope_table_for_speed(const MotorSlope& slope, unsigned t
dbg.log(DBG_warn, "failed to reach target speed");
}
if (target_speed_shifted_w >= std::numeric_limits<std::uint16_t>::max()) {
throw SaneException("Target motor speed is too low");
}
unsigned final_speed = std::max(target_speed_shifted_w, max_speed_shifted_w);
table.table.reserve(max_size);