optimisation: compare uint16_t against uint16_t
AxisDistance returns uint16_t type and is currently compared with long double axis length. The axis lengths fit easily into uint16_t: selectorLimits.lenght = 75 idlerLimits.lenght = 225 Change in memory: Flash: -122 bytes SRAM: 0 bytespull/335/head
parent
0a205e41ff
commit
362e56aaf0
|
|
@ -39,7 +39,7 @@ void Idler::PlanHomingMoveBack() {
|
|||
bool Idler::FinishHomingAndPlanMoveToParkPos() {
|
||||
// check the axis' length
|
||||
if (AxisDistance(mm::axisUnitToTruncatedUnit<config::U_deg>(mm::motion.CurPosition<mm::Idler>()))
|
||||
< (config::idlerLimits.lenght.v - 10)) { //@@TODO is 10 degrees ok?
|
||||
< uint16_t(config::idlerLimits.lenght.v - 10)) { //@@TODO is 10 degrees ok?
|
||||
return false; // we couldn't home correctly, we cannot set the Idler's position
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ void Selector::PlanHomingMoveBack() {
|
|||
|
||||
bool Selector::FinishHomingAndPlanMoveToParkPos() {
|
||||
// check the axis' length
|
||||
if (AxisDistance(mm::axisUnitToTruncatedUnit<config::U_mm>(mm::motion.CurPosition<mm::Selector>())) < (config::selectorLimits.lenght.v - 3)) { //@@TODO is 3mm ok?
|
||||
if (AxisDistance(mm::axisUnitToTruncatedUnit<config::U_mm>(mm::motion.CurPosition<mm::Selector>())) < uint16_t(config::selectorLimits.lenght.v - 3)) { //@@TODO is 3mm ok?
|
||||
return false; // we couldn't home correctly, we cannot set the Selector's position
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue