Skip to content

Commit 08e0720

Browse files
committed
Fix astyle
1 parent 76a177f commit 08e0720

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ int I2CEEBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
6464

6565
auto *charBuffer = reinterpret_cast<char *>(buffer);
6666

67-
auto const handler = [&](const bd_addr_t &pagedStart, const bd_size_t &pagedLength,
68-
const uint8_t &pagedDeviceAddress) -> int
69-
{
67+
auto const handler = [&](const bd_addr_t &pagedStart, const bd_size_t &pagedLength, const uint8_t &pagedDeviceAddress) -> int {
7068
_i2c->start();
7169

7270
if (1 != _i2c->write(pagedDeviceAddress))
@@ -110,9 +108,7 @@ int I2CEEBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size
110108

111109
auto const *charBuffer = reinterpret_cast<char const *>(buffer);
112110

113-
auto const handler = [&](const bd_addr_t &pagedStart, const bd_size_t &pagedLength,
114-
const uint8_t &pagedDeviceAddress) -> int
115-
{
111+
auto const handler = [&](const bd_addr_t &pagedStart, const bd_size_t &pagedLength, const uint8_t &pagedDeviceAddress) -> int {
116112
// While we have some more data to write.
117113
while (size > 0)
118114
{
@@ -126,12 +122,12 @@ int I2CEEBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size
126122
return BD_ERROR_DEVICE_ERROR;
127123
}
128124

129-
if (!_address_is_eight_bit && 1 != _i2c->write((char) (pagedStart >> 8u)))
125+
if (!_address_is_eight_bit && 1 != _i2c->write((char)(pagedStart >> 8u)))
130126
{
131127
return BD_ERROR_DEVICE_ERROR;
132128
}
133129

134-
if (1 != _i2c->write((char) (addr & 0xffu)))
130+
if (1 != _i2c->write((char)(addr & 0xffu)))
135131
{
136132
return BD_ERROR_DEVICE_ERROR;
137133
}
@@ -148,7 +144,8 @@ int I2CEEBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t size
148144

149145
int err = _sync();
150146

151-
if (err) {
147+
if (err)
148+
{
152149
return err;
153150
}
154151

@@ -224,8 +221,7 @@ int I2CEEBlockDevice::do_paged(const bd_addr_t &startAddress,
224221

225222
auto const pageSize = 256;
226223
bd_size_t lengthDone = 0;
227-
while (lengthDone != length)
228-
{
224+
while (lengthDone != length) {
229225
/* Integer division => Round down */
230226
uint8_t const currentPage = currentStartAddress / pageSize;
231227
bd_addr_t const nextPageBegin = (currentPage + 1) * pageSize;
@@ -249,8 +245,7 @@ int I2CEEBlockDevice::do_paged(const bd_addr_t &startAddress,
249245

250246
uint8_t I2CEEBlockDevice::get_paged_device_address(const uint8_t &page)
251247
{
252-
if (!this->_address_is_eight_bit)
253-
{
248+
if (!this->_address_is_eight_bit) {
254249
return this->_i2c_addr;
255250
}
256251
else
@@ -265,8 +260,7 @@ uint8_t I2CEEBlockDevice::get_paged_device_address(const uint8_t &page)
265260
uint8_t i = 1;
266261
uint8_t addressMask = 0;
267262
auto p = page;
268-
while (p != 0u)
269-
{
263+
while (p != 0u) {
270264
addressMask |= (1u << i);
271265
p >>= 1u;
272266
i++;

components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ class I2CEEBlockDevice : public BlockDevice {
181181

182182
int _sync();
183183

184-
using paged_handler = std::function<
185-
int(const bd_addr_t &address, const bd_size_t &length, const uint8_t &deviceAddress)>;
184+
using paged_handler = std::function<int(const bd_addr_t &address, const bd_size_t &length, const uint8_t &deviceAddress)>;
186185

187186
/**
188187
* Executes a handler across page boundaries for eight bit mode.

0 commit comments

Comments
 (0)