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
62b1272e34
commit
788c54efc2
|
@ -67,6 +67,11 @@ struct AP_HAL::CANFrame {
|
|||
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
|
||||
{
|
||||
return id & FlagEFF;
|
||||
|
|
Loading…
Reference in New Issue