Skip to content

Commit 8baad48

Browse files
committed
clang
1 parent b7c89e5 commit 8baad48

File tree

7 files changed

+28
-25
lines changed

7 files changed

+28
-25
lines changed

src/Wippersnapper_V2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129

130130
#define WS_VERSION \
131131
"1.0.0-offline-beta.3" ///< WipperSnapper app. version
132-
///< (semver-formatted)
132+
///< (semver-formatted)
133133

134134
#define WS_WDT_TIMEOUT 60000 ///< WDT timeout
135135
#define WS_MAX_ALT_WIFI_NETWORKS 3 ///< Maximum number of alternative networks

src/components/i2c/controller.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,8 @@ bool I2cController::Handle_I2cDeviceAddOrReplace(pb_istream_t *stream) {
656656
wippersnapper_i2c_I2cDeviceDescriptor device_descriptor =
657657
_i2c_model->GetI2cDeviceAddOrReplaceMsg()->i2c_device_description;
658658

659-
660659
// Did the driver initialize correctly?
661-
if ( IsDriverInitialized(device_descriptor)) {
660+
if (IsDriverInitialized(device_descriptor)) {
662661
WS_DEBUG_PRINTLN("[i2c] Driver already initialized, skipping...");
663662
return true;
664663
}
@@ -817,7 +816,8 @@ bool I2cController::Handle_I2cDeviceAddOrReplace(pb_istream_t *stream) {
817816
"the correct value for"
818817
"i2cDeviceAddress?");
819818
}
820-
return true; // don't cause an error during runtime if the device is not found
819+
return true; // don't cause an error during runtime if the device is not
820+
// found
821821
}
822822
WS_DEBUG_PRINTLN("[i2c] Driver successfully initialized!");
823823
}
@@ -858,7 +858,7 @@ bool I2cController::Handle_I2cDeviceAddOrReplace(pb_istream_t *stream) {
858858
bool I2cController::ScanI2cBus(bool default_bus = true) {
859859
_i2c_bus_default->InitBus(default_bus);
860860
_scan_results = wippersnapper_i2c_I2cBusScanned_init_zero;
861-
if (! default_bus)
861+
if (!default_bus)
862862
return _i2c_bus_alt->ScanBus(&_scan_results);
863863
return _i2c_bus_default->ScanBus(&_scan_results);
864864
}
@@ -877,7 +877,7 @@ bool I2cController::WasDeviceScanned(uint32_t address) {
877877
if (num_found_devices == 0)
878878
return false; // no devices found on bus, or scan was not performed
879879

880-
// Check if the device was found on the bus
880+
// Check if the device was found on the bus
881881
for (pb_size_t i; i < num_found_devices; i++) {
882882
if (_scan_results.i2c_bus_found_devices[i].i2c_device_address == address)
883883
return true; // device found on bus!

src/components/i2c/controller.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
"UNKNOWN_SCAN" ///< Name for I2C devices found by an i2c scan
7272

7373
typedef struct {
74-
uint32_t address; ///< I2C address of the device
75-
bool is_initialized; ///< Flag to indicate if the device is initialized
74+
uint32_t address; ///< I2C address of the device
75+
bool is_initialized; ///< Flag to indicate if the device is initialized
7676
} initialized_device_t; ///< Struct to hold initialized device info
7777

7878
class Wippersnapper_V2; ///< Forward declaration
@@ -107,7 +107,8 @@ class I2cController {
107107
bool WasDeviceScanned(uint32_t address);
108108
uint32_t GetScanDeviceAddress(int index);
109109
size_t GetScanDeviceCount();
110-
bool IsDriverInitialized(wippersnapper_i2c_I2cDeviceDescriptor& device_descriptor);
110+
bool
111+
IsDriverInitialized(wippersnapper_i2c_I2cDeviceDescriptor &device_descriptor);
111112

112113
private:
113114
I2cModel *_i2c_model; ///< Pointer to an I2C model object

src/components/i2c/drivers/drvBase.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,12 @@ class drvBase {
758758
_sensors[15]; ///< Sensors attached to the device.
759759

760760
/***************************************************************************/
761-
/*!
762-
@brief Converts a SensorType to a string.
763-
@param type
764-
The SensorType to convert.
765-
@returns The string representation of the SensorType.
766-
*/
761+
/*!
762+
@brief Converts a SensorType to a string.
763+
@param type
764+
The SensorType to convert.
765+
@returns The string representation of the SensorType.
766+
*/
767767
/***************************************************************************/
768768
const char *SensorTypeToString(wippersnapper_sensor_SensorType type) {
769769
switch (type) {
@@ -859,8 +859,8 @@ class drvBase {
859859
ulong _sensor_period_prv; ///< The sensor's previous period, in milliseconds.
860860
size_t _sensors_count; ///< Number of sensors on the device.
861861
wippersnapper_sensor_SensorType
862-
_default_sensor_types[15]; ///< Default sensor types
863-
size_t _default_sensor_types_count; ///< Number of default sensor types
862+
_default_sensor_types[15]; ///< Default sensor types
863+
size_t _default_sensor_types_count; ///< Number of default sensor types
864864
const char *_sensor_type_strings[15]; ///< Sensor type strings
865865
};
866866
#endif // DRV_BASE_H

src/components/i2c/hardware.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ TwoWire *I2cHardware::GetBus() { return _bus; }
156156
bool I2cHardware::ScanBus(wippersnapper_i2c_I2cBusScanned *scan_results) {
157157
if (!scan_results)
158158
return false;
159-
160-
if (! _bus) {
159+
160+
if (!_bus) {
161161
WS_DEBUG_PRINTLN("[i2c] ERROR: I2C bus not initialized!");
162162
return false;
163163
}

src/components/i2c/hardware.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ class I2cHardware {
4141
void SelectMuxChannel(uint32_t channel);
4242
bool HasMux();
4343
void ClearMuxChannel();
44+
4445
private:
4546
void TogglePowerPin();
4647
wippersnapper_i2c_I2cBusStatus _bus_status; ///< I2C bus status
4748
TwoWire *_bus = nullptr; ///< I2C bus
4849
bool _has_mux; ///< Is a MUX present on the bus?
49-
uint32_t _mux_address; ///< I2C address for the MUX
50-
int _mux_max_channels; ///< Maximum possible number of MUX channels
51-
char *_sda; ///< SDA pin
52-
char *_scl; ///< SCL pin
50+
uint32_t _mux_address; ///< I2C address for the MUX
51+
int _mux_max_channels; ///< Maximum possible number of MUX channels
52+
char *_sda; ///< SDA pin
53+
char *_scl; ///< SCL pin
5354
};
5455
#endif // WS_I2C_HARDWARE_H

src/provisioning/sdcard/ws_sdcard.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ bool ws_sdcard::InitSdCard(uint8_t pin_cs) {
4747
ws_sdcard::ws_sdcard() {
4848
_use_test_data = false;
4949
_is_soft_rtc = false;
50-
50+
5151
_sz_cur_log_file = 0;
5252
_sd_cur_log_files = 0;
5353

@@ -497,7 +497,8 @@ bool ws_sdcard::ParseI2cDeviceAddReplace(
497497
// MUXes, Seesaw, special devices should have an auto-init flag set to false
498498
const char *is_auto = component["autoConfig"] | "true";
499499
if (strcmp(is_auto, "false") == 0) {
500-
WS_DEBUG_PRINTLN("[SD] autoConfig = false, do not attempt to automatically initialize this address");
500+
WS_DEBUG_PRINTLN("[SD] autoConfig = false, do not attempt to automatically "
501+
"initialize this address");
501502
_cfg_i2c_addresses.push_back(
502503
msg_i2c_add.i2c_device_description.i2c_device_address);
503504
}

0 commit comments

Comments
 (0)