Skip to content

Commit 2268c0f

Browse files
committed
Clang
1 parent 83bceab commit 2268c0f

File tree

4 files changed

+34
-19
lines changed

4 files changed

+34
-19
lines changed

src/Wippersnapper_V2.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ bool Wippersnapper_V2::generateWSTopics() {
751751
@param error
752752
The error message to write to the serial and filesystem.
753753
*/
754-
void Wippersnapper_V2::errorWriteHangV2(const char* error) {
754+
void Wippersnapper_V2::errorWriteHangV2(const char *error) {
755755
// Print error
756756
WS_DEBUG_PRINTLN(error);
757757
#ifdef USE_TINYUSB
@@ -919,7 +919,8 @@ void Wippersnapper_V2::runNetFSMV2() {
919919
If false, the device will not allow the WDT to bite and
920920
instead hang indefinitely, holding the WIPPER drive open
921921
*/
922-
void Wippersnapper_V2::haltErrorV2(const char* error, ws_led_status_t ledStatusColor,
922+
void Wippersnapper_V2::haltErrorV2(const char *error,
923+
ws_led_status_t ledStatusColor,
923924
bool reboot) {
924925
WS_DEBUG_PRINT("ERROR ");
925926
if (reboot) {

src/Wippersnapper_V2.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
*/
3131
#ifdef WS_DEBUG
3232
#define WS_DEBUG_PRINT(...) \
33-
{ WS_PRINTER.print(__VA_ARGS__); } /**< Print debug message to serial */
33+
{ \
34+
WS_PRINTER.print(__VA_ARGS__); \
35+
} /**< Print debug message to serial */
3436
#define WS_DEBUG_PRINTLN(...) \
3537
{ \
3638
WS_PRINTER.println(__VA_ARGS__); \
@@ -42,9 +44,11 @@
4244
} /**< Print debug message in hexadecimal */
4345
#else
4446
#define WS_DEBUG_PRINT(...) \
45-
{} /**< Debug print */
47+
{ \
48+
} /**< Debug print */
4649
#define WS_DEBUG_PRINTLN(...) \
47-
{} /**< Debug println */
50+
{ \
51+
} /**< Debug println */
4852
#endif
4953

5054
/*!
@@ -212,10 +216,10 @@ class Wippersnapper_V2 {
212216
void BlinkKATStatus();
213217

214218
// Error handling helpers
215-
void haltErrorV2(const char* error,
219+
void haltErrorV2(const char *error,
216220
ws_led_status_t ledStatusColor = WS_LED_STATUS_ERROR_RUNTIME,
217221
bool reboot = true);
218-
void errorWriteHangV2(const char* error);
222+
void errorWriteHangV2(const char *error);
219223

220224
bool _is_offline_mode; ///< Global flag for if the device is in offline mode
221225

@@ -250,7 +254,7 @@ class Wippersnapper_V2 {
250254
nullptr; ///< Instance of Pixels controller
251255
PWMController *_pwm_controller = nullptr; ///< Instance of PWM controller
252256
ServoController *_servo_controller =
253-
nullptr; ///< Instance of Servo controller
257+
nullptr; ///< Instance of Servo controller
254258
UARTController *_uart_controller = nullptr; ///< Instance of UART controller
255259

256260
// TODO: does this really need to be global?

src/components/uart/drivers/drvUartUs100.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
class UARTDevice {
3333
public:
3434
UARTDevice(Stream *serial) { _serial_dev = serial; }
35-
~UARTDevice() { /* no-op destructor */
36-
}
35+
~UARTDevice() { /* no-op destructor */ }
3736

3837
bool CreateDevice() {
3938
if (_generic_dev != nullptr) {

src/components/uart/model.h

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,33 @@ class UARTModel {
3232
bool DecodeUartDeviceRemove(pb_istream_t *stream);
3333
wippersnapper_uart_UartAdd *GetUartAddMsg();
3434
// UartAdded
35-
bool EncodeUartAdded(int32_t uart_nbr, wippersnapper_uart_UartDeviceType type, const char *id, bool success);
35+
bool EncodeUartAdded(int32_t uart_nbr, wippersnapper_uart_UartDeviceType type,
36+
const char *id, bool success);
3637
wippersnapper_uart_UartAdded *GetUartAddedMsg();
3738
// UartRemove
3839
wippersnapper_uart_UartRemove *GetUartRemoveMsg();
3940
// UartInputEvent
40-
bool AddUartInputEvent(sensors_event_t &event, wippersnapper_sensor_SensorType sensor_type);
41+
bool AddUartInputEvent(sensors_event_t &event,
42+
wippersnapper_sensor_SensorType sensor_type);
4143
bool EncodeUartInputEvent();
4244
wippersnapper_uart_UartInputEvent *GetUartInputEventMsg();
4345
void ClearUartInputEventMsg();
44-
void ConfigureUartInputEventMsg(uint32_t uart_nbr, wippersnapper_uart_UartDeviceType type, const char *device_id);
46+
void ConfigureUartInputEventMsg(uint32_t uart_nbr,
47+
wippersnapper_uart_UartDeviceType type,
48+
const char *device_id);
49+
4550
private:
46-
wippersnapper_uart_UartAdd _msg_UartAdd; ///< wippersnapper_uart_UartAdd message
47-
wippersnapper_uart_UartAdded _msg_UartAdded; ///< wippersnapper_uart_UartAdded message
48-
wippersnapper_uart_UartRemove _msg_UartRemove; ///< wippersnapper_uart_UartRemove message
49-
wippersnapper_uart_UartWrite _msg_UartWrite; ///< wippersnapper_uart_UartWrite message
50-
wippersnapper_uart_UartWritten _msg_UartWritten; ///< wippersnapper_uart_UartWritten message
51-
wippersnapper_uart_UartInputEvent _msg_UartInputEvent; ///< wippersnapper_uart_UartInputEvent message
51+
wippersnapper_uart_UartAdd
52+
_msg_UartAdd; ///< wippersnapper_uart_UartAdd message
53+
wippersnapper_uart_UartAdded
54+
_msg_UartAdded; ///< wippersnapper_uart_UartAdded message
55+
wippersnapper_uart_UartRemove
56+
_msg_UartRemove; ///< wippersnapper_uart_UartRemove message
57+
wippersnapper_uart_UartWrite
58+
_msg_UartWrite; ///< wippersnapper_uart_UartWrite message
59+
wippersnapper_uart_UartWritten
60+
_msg_UartWritten; ///< wippersnapper_uart_UartWritten message
61+
wippersnapper_uart_UartInputEvent
62+
_msg_UartInputEvent; ///< wippersnapper_uart_UartInputEvent message
5263
};
5364
#endif // WS_UART_MODEL_H

0 commit comments

Comments
 (0)