Skip to content

Commit d64174a

Browse files
thobreavictorandrehc
authored andcommitted
[stm32] float int from_range
1 parent 310e23a commit d64174a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modm/math/algorithm/prescaler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ GenericPrescaler
146146
const uint32_t prescaler_ceiling = std::min(uint32_t(desired) + 1, end);
147147
const T baud_lower = input_frequency / prescaler_ceiling;
148148
const T baud_upper = input_frequency / prescaler_floor;
149-
const double baud_middle = (baud_upper + baud_lower) / 2.0;
149+
const float baud_middle = static_cast<float>((baud_upper + baud_lower) / 2.0);
150150
if (desired_frequency <= baud_middle)
151151
return {input_frequency, desired_frequency, prescaler_ceiling - begin, prescaler_ceiling};
152152
return {input_frequency, desired_frequency, prescaler_floor - begin, prescaler_floor};

0 commit comments

Comments
 (0)