Skip to content

Commit 536fb54

Browse files
committed
Clangify
1 parent e69f538 commit 536fb54

File tree

14 files changed

+38
-33
lines changed

14 files changed

+38
-33
lines changed

src/adapters/wifi/ws_wifi_esp8266.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,10 @@ class ws_wifi_esp8266 : public Wippersnapper_V2 {
199199
/*******************************************************************/
200200
void setupMQTTClient(const char *clientID) {
201201
// Uncomment the following lines to use MQTT/SSL. You will need to
202-
// re-compile after. _wifi_client->setFingerprint(fingerprint); WsV2._mqttV2 =
203-
// new Adafruit_MQTT_Client(_wifi_client, WsV2._configV2.aio_url,
204-
// WsV2._configV2.io_port, clientID, WsV2._configV2.aio_user, WsV2._configV2.aio_key);
202+
// re-compile after. _wifi_client->setFingerprint(fingerprint); WsV2._mqttV2
203+
// = new Adafruit_MQTT_Client(_wifi_client, WsV2._configV2.aio_url,
204+
// WsV2._configV2.io_port, clientID, WsV2._configV2.aio_user,
205+
// WsV2._configV2.aio_key);
205206
if (WsV2._configV2.io_port == 8883)
206207
WsV2._configV2.io_port = 1883;
207208
WsV2._mqttV2 = new Adafruit_MQTT_Client(

src/adapters/wifi/ws_wifi_pico.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#ifndef WS_WIFI_PICO_H
1818
#define WS_WIFI_PICO_H
1919

20-
#if defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined (ARDUINO_RASPBERRY_PI_PICO_2W)
20+
#if defined(ARDUINO_RASPBERRY_PI_PICO_W) || \
21+
defined(ARDUINO_RASPBERRY_PI_PICO_2W)
2122

2223
#define PICO_CONNECT_TIMEOUT_MS 20000 /*!< Connection timeout (in ms) */
2324
#define PICO_CONNECT_RETRY_DELAY_MS 200 /*!< delay time between retries. */

src/components/checkin/model.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
@brief CheckinModel constructor
2020
*/
2121
/***********************************************************************/
22-
CheckinModel::CheckinModel()
23-
{
22+
CheckinModel::CheckinModel() {
2423
memset(&_CheckinRequest, 0, sizeof(_CheckinRequest));
2524
memset(&_CheckinResponse, 0, sizeof(_CheckinResponse));
2625
// no-op

src/components/digitalIO/model.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
@brief DigitalIOModel constructor
2020
*/
2121
/***********************************************************************/
22-
DigitalIOModel::DigitalIOModel()
23-
{
22+
DigitalIOModel::DigitalIOModel() {
2423
memset(&_msg_dio_add, 0, sizeof(_msg_dio_add));
2524
memset(&_msg_dio_remove, 0, sizeof(_msg_dio_remove));
2625
memset(&_msg_dio_event, 0, sizeof(_msg_dio_event));

src/components/i2c/controller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ bool I2cController::PublishI2cDeviceAddedorReplaced(
490490
bool I2cController::Handle_I2cDeviceRemove(pb_istream_t *stream) {
491491
// Attempt to decode an I2cDeviceRemove message
492492
WS_DEBUG_PRINTLN("[i2c] Decoding I2cDeviceRemove message...");
493-
if (! _i2c_model->DecodeI2cDeviceRemove(stream)) {
493+
if (!_i2c_model->DecodeI2cDeviceRemove(stream)) {
494494
WS_DEBUG_PRINTLN("[i2c] ERROR: Unable to decode I2cDeviceRemove message!");
495495
return false;
496496
}
@@ -896,7 +896,7 @@ void I2cController::ConfigureMuxChannel(uint32_t mux_channel, bool is_alt_bus) {
896896
*/
897897
/***********************************************************************/
898898
void I2cController::update() {
899-
//WS_DEBUG_PRINTLN("[i2c] Updating I2C controller...");
899+
// WS_DEBUG_PRINTLN("[i2c] Updating I2C controller...");
900900
if (_i2c_drivers.size() == 0)
901901
return; // bail out if no drivers exist
902902

src/components/i2c/controller.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@ class I2cController {
9292
const wippersnapper_i2c_I2cDeviceDescriptor &device_descriptor,
9393
const wippersnapper_i2c_I2cDeviceStatus &device_status);
9494
// Helpers //
95-
bool IsBusStatusOK(bool is_alt_bus=false);
95+
bool IsBusStatusOK(bool is_alt_bus = false);
9696
bool InitMux(const char *name, uint32_t address, bool is_alt_bus);
9797
void ConfigureMuxChannel(uint32_t mux_channel, bool is_alt_bus);
9898
bool RemoveDriver(uint32_t address);
99+
99100
private:
100101
I2cModel *_i2c_model; ///< Pointer to an I2C model object
101102
I2cHardware *_i2c_bus_default; ///< Pointer to the default I2C bus

src/components/i2c/hardware.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ bool I2cHardware::ScanBus(wippersnapper_i2c_I2cBusScanned *scan_results) {
216216
WS_DEBUG_PRINTLN("[i2c] Did not find device: NACK on transmit of data!");
217217
continue;
218218
} else if (endTransmissionRC == 2) {
219-
//WS_DEBUG_PRINTLN("[i2c] Did not find device: NACK on transmit of address!");
219+
// WS_DEBUG_PRINTLN("[i2c] Did not find device: NACK on transmit of
220+
// address!");
220221
continue;
221222
} else if (endTransmissionRC == 1) {
222223
WS_DEBUG_PRINTLN(

src/components/i2c/hardware.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ class I2cHardware {
3838
const char *scl = nullptr);
3939
TwoWire *GetBus();
4040
wippersnapper_i2c_I2cBusStatus GetBusStatus();
41-
bool ScanBus(wippersnapper_i2c_I2cBusScanned* scan_results);
41+
bool ScanBus(wippersnapper_i2c_I2cBusScanned *scan_results);
4242
// MUX
4343
bool AddMuxToBus(uint32_t address_register, const char *name);
4444
void RemoveMux();
4545
bool HasMux();
4646
void ClearMuxChannel();
4747
void SelectMuxChannel(uint32_t channel);
48-
bool ScanMux(wippersnapper_i2c_I2cBusScanned* scan_results);
48+
bool ScanMux(wippersnapper_i2c_I2cBusScanned *scan_results);
49+
4950
private:
5051
void TogglePowerPin();
5152
wippersnapper_i2c_I2cBusStatus _bus_status; ///< I2C bus status
@@ -54,6 +55,6 @@ class I2cHardware {
5455
uint8_t _bus_scl; ///< SCL pin
5556
bool _has_mux; ///< Is a MUX present on the bus?
5657
uint32_t _mux_address_register; ///< I2C address for the MUX
57-
int _mux_max_channels; ///< Maximum possible number of MUX channels
58+
int _mux_max_channels; ///< Maximum possible number of MUX channels
5859
};
5960
#endif // WS_I2C_HARDWARE_H

src/components/i2c/model.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
@brief I2C constructor
2020
*/
2121
/***********************************************************************/
22-
I2cModel::I2cModel()
23-
{
22+
I2cModel::I2cModel() {
2423
memset(&_msg_i2c_bus_scan, 0, sizeof(_msg_i2c_bus_scan));
2524
memset(&_msg_i2c_bus_scanned, 0, sizeof(_msg_i2c_bus_scanned));
2625
memset(&_msg_i2c_device_add_replace, 0, sizeof(_msg_i2c_device_add_replace));
27-
memset(&_msg_i2c_device_added_replaced, 0, sizeof(_msg_i2c_device_added_replaced));
26+
memset(&_msg_i2c_device_added_replaced, 0,
27+
sizeof(_msg_i2c_device_added_replaced));
2828
memset(&_msg_i2c_device_remove, 0, sizeof(_msg_i2c_device_remove));
2929
memset(&_msg_i2c_device_removed, 0, sizeof(_msg_i2c_device_removed));
3030
memset(&_msg_i2c_device_event, 0, sizeof(_msg_i2c_device_event));
@@ -40,7 +40,8 @@ I2cModel::~I2cModel() {
4040
memset(&_msg_i2c_bus_scan, 0, sizeof(_msg_i2c_bus_scan));
4141
memset(&_msg_i2c_bus_scanned, 0, sizeof(_msg_i2c_bus_scanned));
4242
memset(&_msg_i2c_device_add_replace, 0, sizeof(_msg_i2c_device_add_replace));
43-
memset(&_msg_i2c_device_added_replaced, 0, sizeof(_msg_i2c_device_added_replaced));
43+
memset(&_msg_i2c_device_added_replaced, 0,
44+
sizeof(_msg_i2c_device_added_replaced));
4445
memset(&_msg_i2c_device_remove, 0, sizeof(_msg_i2c_device_remove));
4546
memset(&_msg_i2c_device_removed, 0, sizeof(_msg_i2c_device_removed));
4647
memset(&_msg_i2c_device_event, 0, sizeof(_msg_i2c_device_event));
@@ -143,8 +144,10 @@ bool I2cModel::DecodeI2cDeviceRemove(pb_istream_t *stream) {
143144
WS_DEBUG_PRINTLN("[i2c] Set _msg_i2c_device_remove...");
144145
memset(&_msg_i2c_device_remove, 0, sizeof(_msg_i2c_device_remove));
145146
bool is_success = false;
146-
is_success = pb_decode(stream, wippersnapper_i2c_I2cDeviceRemove_fields, &_msg_i2c_device_remove);
147-
WS_DEBUG_PRINT("is_success: "); WS_DEBUG_PRINTLN(is_success);
147+
is_success = pb_decode(stream, wippersnapper_i2c_I2cDeviceRemove_fields,
148+
&_msg_i2c_device_remove);
149+
WS_DEBUG_PRINT("is_success: ");
150+
WS_DEBUG_PRINTLN(is_success);
148151
return is_success;
149152
}
150153

@@ -288,7 +291,8 @@ bool I2cModel::encodeMsgI2cDeviceAddedorReplaced(
288291
size_t sz_msg;
289292

290293
// Fill I2cDeviceAddedOrReplaced message
291-
memset(&_msg_i2c_device_added_replaced, 0, sizeof(_msg_i2c_device_added_replaced));
294+
memset(&_msg_i2c_device_added_replaced, 0,
295+
sizeof(_msg_i2c_device_added_replaced));
292296
_msg_i2c_device_added_replaced.has_i2c_device_description = true;
293297
_msg_i2c_device_added_replaced.i2c_device_description = device_descriptor;
294298
_msg_i2c_device_added_replaced.i2c_bus_status = bus_status;

src/components/pixels/hardware.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ class PixelsHardware {
3333
uint16_t GetPinData();
3434
void FillStrand(uint32_t color);
3535
void RemoveStrand();
36+
3637
private:
3738
Adafruit_NeoPixel *_neopixel = nullptr; ///< Used for NeoPixel strands
3839
Adafruit_DotStar *_dotstar = nullptr; ///< Used for DotStar strands
39-
wippersnapper_pixels_PixelsType _type; ///< Holds the type of strand
40-
uint16_t _pin_data; ///< Data pin for the strand
40+
wippersnapper_pixels_PixelsType _type; ///< Holds the type of strand
41+
uint16_t _pin_data; ///< Data pin for the strand
4142
bool AddNeoPixel(uint16_t num_pixels, uint16_t pin_data, neoPixelType order,
4243
uint8_t brightness);
4344
bool AddDotStar(uint16_t num_pixels, uint16_t pin_data, uint16_t pin_clock,

0 commit comments

Comments
 (0)