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: Max32630_One_Wire_Interface
Diff: RomId.cpp
- Revision:
- 73:2cecc1372acc
- Parent:
- 49:36954b62f503
- Child:
- 74:23be10c32fa3
diff -r 6892702709ee -r 2cecc1372acc RomId.cpp
--- a/RomId.cpp Mon May 09 16:20:56 2016 -0500
+++ b/RomId.cpp Thu May 12 14:38:16 2016 -0500
@@ -30,9 +30,11 @@
* ownership rights.
**********************************************************************/
-#include "RomId.hpp"
+#include "RomId.h"
-std::uint8_t RomId::calculateCRC8(std::uint8_t crc8, std::uint8_t data)
+using OneWire::RomId;
+
+uint8_t RomId::calculateCRC8(uint8_t crc8, uint8_t data)
{
int i;
@@ -49,9 +51,9 @@
return crc8;
}
-std::uint8_t RomId::calculateCRC8(const std::uint8_t * data, std::size_t data_len, std::uint8_t crc)
+uint8_t RomId::calculateCRC8(const uint8_t * data, size_t data_len, uint8_t crc)
{
- for (std::size_t i = 0; i < data_len; i++)
+ for (size_t i = 0; i < data_len; i++)
crc = calculateCRC8(crc, data[i]);
return crc;
}