diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-07-15 21:51:55 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-07-15 21:51:55 +0300 |
commit | 9146d4a77fe81b52545c18e5541061190f311a6a (patch) | |
tree | 265db7d8c783fbdd946c65a494569f6094509a38 /src/RepRapFirmware.h | |
parent | 89e757ff204628e40891c0f220e061b6d13af5dd (diff) |
Refactored 12864 display code in preparation for ST7567 support
Also allow driver numbers of the form 0.# on boards that do not support
CAN expansion
Diffstat (limited to 'src/RepRapFirmware.h')
-rw-r--r-- | src/RepRapFirmware.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/RepRapFirmware.h b/src/RepRapFirmware.h index b44a2825..a52fb204 100644 --- a/src/RepRapFirmware.h +++ b/src/RepRapFirmware.h @@ -186,9 +186,12 @@ struct DriverId #else - void SetFromBinary(uint32_t val) noexcept + // 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 { - localDriver = (uint8_t)val; + localDriver = val & 0x000000FF; + const uint32_t brdNum = val >> 16; + return (brdNum != 0); } void SetLocal(unsigned int driver) noexcept |