Keep compact contacts within the STM32 flash boundary
This commit is contained in:
1 parent
036661e7e4
commit
025eadb39f
4 files changed
+66
-13
No files matched your search
@@ -131,8 +131,8 @@ inline void writeLE32(uint8_t* dest, uint32_t value) {
|
||||
inline uint32_t updateCRC32(uint32_t crc, const uint8_t* data, size_t len) {
|
||||
while (len-- > 0) {
|
||||
crc ^= *data++;
|
||||
for (uint8_t bit = 0; bit < 8; bit++) {
|
||||
crc = (crc >> 1) ^ ((crc & 1) ? 0xEDB88320UL : 0);
|
||||
for (unsigned bit = 0; bit < 8; bit++) {
|
||||
crc = (crc >> 1) ^ (0xEDB88320UL & (0U - (crc & 1U)));
|
||||
}
|
||||
}
|
||||
return crc;
|
||||
|
||||
Reference in new issue
Block a user