mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 07:23:34 +08:00
TransferID::subtracted()
This commit is contained in:
@@ -52,4 +52,11 @@ int TransferID::computeForwardDistance(TransferID rhs) const
|
||||
return d;
|
||||
}
|
||||
|
||||
int TransferID::subtracted(TransferID rhs) const
|
||||
{
|
||||
const int x = rhs.computeForwardDistance(*this);
|
||||
|
||||
return (x >= ((1 << BitLen) / 2)) ? (x - (1 << BitLen)) : x;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user