Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#
Diff: MaximInterfaceDevices/DS2431.cpp
- Revision:
- 10:947d3f44e0a0
- Parent:
- 8:5ea891c7d1a1
- Child:
- 11:3f3bf6bf5e6c
--- a/MaximInterfaceDevices/DS2431.cpp Fri Sep 27 16:19:38 2019 -0500
+++ b/MaximInterfaceDevices/DS2431.cpp Mon Sep 30 09:39:32 2019 -0500
@@ -83,7 +83,7 @@
if (!result) {
return result;
}
- const uint_fast16_t calculatedCrc = calculateCrc16(block) ^ 0xFFFFu;
+ const uint_fast16_t calculatedCrc = calculateCrc16(block) ^ 0xFFFF;
result = master->readBlock(make_span(block, 2));
if (!result) {
return result;
@@ -116,7 +116,7 @@
uint_fast16_t receivedCrc = static_cast<uint_fast16_t>(*(--blockIt)) << 8;
receivedCrc |= *(--blockIt);
const uint_fast16_t expectedCrc =
- calculateCrc16(make_span(block.data(), block.size() - 2)) ^ 0xFFFFu;
+ calculateCrc16(make_span(block.data(), block.size() - 2)) ^ 0xFFFF;
if (expectedCrc != receivedCrc) {
return CrcError;
}