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: mbed_DS28EC20_GPIO
Diff: Platforms/mbed/I2CMaster.cpp
- Revision:
- 6:a8c83a2e6fa4
- Parent:
- 3:f818ea5172ed
diff -r caf56f265a13 -r a8c83a2e6fa4 Platforms/mbed/I2CMaster.cpp
--- a/Platforms/mbed/I2CMaster.cpp Fri Jan 19 10:25:02 2018 -0600
+++ b/Platforms/mbed/I2CMaster.cpp Wed Jan 23 13:11:04 2019 -0600
@@ -50,10 +50,10 @@
}
error_code I2CMaster::writePacketImpl(uint_least8_t address,
- const uint_least8_t * data,
- size_t dataLen, bool sendStop) {
- return (i2c->write(address, reinterpret_cast<const char *>(data), dataLen,
- !sendStop) == 0)
+ span<const uint_least8_t> data,
+ bool sendStop) {
+ return (i2c->write(address, reinterpret_cast<const char *>(data.data()),
+ data.size(), !sendStop) == 0)
? error_code()
: make_error_code(NackError);
}
@@ -64,13 +64,12 @@
}
error_code I2CMaster::readPacketImpl(uint_least8_t address,
- uint_least8_t * data, size_t dataLen,
- bool sendStop) {
- return (i2c->read(address, reinterpret_cast<char *>(data), dataLen,
+ span<uint_least8_t> data, bool sendStop) {
+ return (i2c->read(address, reinterpret_cast<char *>(data.data()), data.size(),
!sendStop) == 0)
? error_code()
: make_error_code(NackError);
}
} // namespace mbed
-} // namespace MaximInterface
\ No newline at end of file
+} // namespace MaximInterface