From f1db9d5956d705669662d23f18545276cd5424ae Mon Sep 17 00:00:00 2001 From: caternuson Date: Fri, 25 Jun 2021 09:20:30 -0700 Subject: [PATCH] clang --- Adafruit_BusIO_Register.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Adafruit_BusIO_Register.cpp b/Adafruit_BusIO_Register.cpp index a1f5d91..1f88d9e 100644 --- a/Adafruit_BusIO_Register.cpp +++ b/Adafruit_BusIO_Register.cpp @@ -104,12 +104,14 @@ bool Adafruit_BusIO_Register::write(uint8_t *buffer, uint8_t len) { if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { // very special case! - // pass the special opcode address which we set as the high byte of the regaddr - addrbuffer[0] = (uint8_t)(_address >> 8) & ~0x01; // set bottom bit low to write + // pass the special opcode address which we set as the high byte of the + // regaddr + addrbuffer[0] = + (uint8_t)(_address >> 8) & ~0x01; // set bottom bit low to write // the 'actual' reg addr is the second byte then addrbuffer[1] = (uint8_t)(_address & 0xFF); // the address appears to be a byte longer - return _spidevice->write(buffer, len, addrbuffer, _addrwidth+1); + return _spidevice->write(buffer, len, addrbuffer, _addrwidth + 1); } if (_spiregtype == ADDRBIT8_HIGH_TOREAD) { @@ -204,12 +206,15 @@ bool Adafruit_BusIO_Register::read(uint8_t *buffer, uint8_t len) { if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { // very special case! - // pass the special opcode address which we set as the high byte of the regaddr - addrbuffer[0] = (uint8_t)(_address >> 8) | 0x01; // set bottom bit high to read + // pass the special opcode address which we set as the high byte of the + // regaddr + addrbuffer[0] = + (uint8_t)(_address >> 8) | 0x01; // set bottom bit high to read // the 'actual' reg addr is the second byte then addrbuffer[1] = (uint8_t)(_address & 0xFF); // the address appears to be a byte longer - return _spidevice->write_then_read(addrbuffer, _addrwidth+1, buffer, len); + return _spidevice->write_then_read(addrbuffer, _addrwidth + 1, buffer, + len); } if (_spiregtype == ADDRBIT8_HIGH_TOREAD) { addrbuffer[0] |= 0x80;