From dade859ff9ad7d8ed3226d7f1668ff6998ec7059 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 7 Jun 2021 09:01:18 +1000 Subject: [PATCH] AP_PiccoloCAN: Remove unncessary floating point operations --- libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp b/libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp index bd406239f0..ec1bcc9857 100644 --- a/libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp +++ b/libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp @@ -177,12 +177,12 @@ void AP_PiccoloCAN::loop() // Calculate the output rate for ESC commands _esc_hz = constrain_int16(_esc_hz, PICCOLO_MSG_RATE_HZ_MIN, PICCOLO_MSG_RATE_HZ_MAX); - uint16_t escCmdRateMs = (uint16_t) ((float) 1000 / _esc_hz); + uint16_t escCmdRateMs = 1000 / _esc_hz; // Calculate the output rate for servo commands _srv_hz = constrain_int16(_srv_hz, PICCOLO_MSG_RATE_HZ_MIN, PICCOLO_MSG_RATE_HZ_MAX); - uint16_t servoCmdRateMs = (uint16_t) ((float) 1000 / _srv_hz); + uint16_t servoCmdRateMs = 1000 / _srv_hz; uint64_t timeout = AP_HAL::micros64() + 250ULL;