diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-11-15 23:22:20 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-11-15 23:22:20 +0300 |
commit | d49e75586d2bb09383e6bbc8a22178cfd9f859a2 (patch) | |
tree | 382c93b1d93bf76140430e156e47ea96b2ad9298 /src/RepRapFirmware.h | |
parent | e84ac30f6241ea85455b702eede62592e66f81dc (diff) |
Various changes for ATE
Added constructors for DriverId
Added support for ReadInputs request and response
Removed unused DDA parameter from CanMotion commands
Diffstat (limited to 'src/RepRapFirmware.h')
-rw-r--r-- | src/RepRapFirmware.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/RepRapFirmware.h b/src/RepRapFirmware.h index 56443eed..cfd3b2ca 100644 --- a/src/RepRapFirmware.h +++ b/src/RepRapFirmware.h @@ -169,6 +169,11 @@ struct DriverId CanAddress boardAddress; + DriverId() noexcept : localDriver(0), boardAddress(CanId::NoAddress) { } + + // Constructor used by ATE configurations + DriverId(CanAddress addr, uint8_t drv) noexcept : localDriver(drv), boardAddress(addr) { } + void SetFromBinary(uint32_t val) noexcept { localDriver = val & 0x000000FF; @@ -182,12 +187,6 @@ struct DriverId boardAddress = CanId::MasterAddress; } - void Clear() noexcept - { - localDriver = 0; - boardAddress = CanId::NoAddress; - } - bool IsLocal() const noexcept { return boardAddress == CanId::MasterAddress; } bool IsRemote() const noexcept { return boardAddress != CanId::MasterAddress; } @@ -213,6 +212,8 @@ struct DriverId #else + DriverId() noexcept : localDriver(0) { } + // Set the driver ID from the binary value, returning true if there was a nonzero board number so that the caller knows the address is not valid bool SetFromBinary(uint32_t val) noexcept { @@ -236,8 +237,6 @@ struct DriverId return localDriver != other.localDriver; } - void Clear() noexcept { localDriver = 0; } - bool IsLocal() const noexcept { return true; } bool IsRemote() const noexcept { return false; } |