mirror of https://github.com/ArduPilot/ardupilot
AP_HAL: added id_signed for CANFrame
makes for more efficient lua processing
This commit is contained in:
parent
acb18cf946
commit
24b83135e0
|
@ -67,6 +67,11 @@ struct AP_HAL::CANFrame {
|
||||||
return (id == rhs.id) && (dlc == rhs.dlc) && (memcmp(data, rhs.data, dlc) == 0);
|
return (id == rhs.id) && (dlc == rhs.dlc) && (memcmp(data, rhs.data, dlc) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// signed version of id, for use by scriping where uint32_t is expensive
|
||||||
|
int32_t id_signed(void) const {
|
||||||
|
return isExtended()? int32_t(id & MaskExtID) : int32_t(id & MaskStdID);
|
||||||
|
}
|
||||||
|
|
||||||
bool isExtended() const
|
bool isExtended() const
|
||||||
{
|
{
|
||||||
return id & FlagEFF;
|
return id & FlagEFF;
|
||||||
|
|
Loading…
Reference in New Issue