Skip to content

Commit 79b19ed

Browse files
committed
clang-format
1 parent 662dddc commit 79b19ed

File tree

9 files changed

+94
-90
lines changed

9 files changed

+94
-90
lines changed

src/Wippersnapper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ class DisplayController;
245245
static NessoBattery battery; ///< Nesso-N1 Battery instance
246246
#endif
247247

248-
249248
/**************************************************************************/
250249
/*!
251250
@brief Class that provides storage and functions for the Adafruit IO

src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ void Wippersnapper_DigitalGPIO::initDigitalPin(
6767

6868
#ifdef STATUS_LED_PIN
6969
#if !defined(ARDUINO_ARDUINO_NESSO_N1)
70-
// if (String("D") + pinName == STATUS_LED_PIN.pin)
71-
// #else
70+
// if (String("D") + pinName == STATUS_LED_PIN.pin)
71+
// #else
7272
// deinit status led, use it as a dio component instead
7373
if (pinName == STATUS_LED_PIN)
7474
releaseStatusLED();
@@ -80,7 +80,9 @@ void Wippersnapper_DigitalGPIO::initDigitalPin(
8080
WS_DEBUG_PRINTLN(pinName);
8181

8282
// Initialize LOW
83-
#if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) // not until we support ExpanderPins || defined(STATUS_LED_INVERTED)
83+
#if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) // not until we support
84+
// ExpanderPins ||
85+
// defined(STATUS_LED_INVERTED)
8486
if (pinName == STATUS_LED_PIN) {
8587
// The Adafruit Feather ESP8266's built-in LED is reverse wired so setting
8688
// the pin LOW will turn the LED on.

src/components/digitalIO/Wippersnapper_DigitalGPIO.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ class Wippersnapper_DigitalGPIO {
5252
void digitalWriteSvc(uint8_t pinName, int pinValue);
5353
#if defined(ARDUINO_ARDUINO_NESSO_N1)
5454
// void
55-
// initDigitalPin(wippersnapper_pin_v1_ConfigurePinRequest_Direction direction,
55+
// initDigitalPin(wippersnapper_pin_v1_ConfigurePinRequest_Direction
56+
// direction,
5657
// ExpanderPin pinName, float period,
5758
// wippersnapper_pin_v1_ConfigurePinRequest_Pull pull);
5859
// void
59-
// deinitDigitalPin(wippersnapper_pin_v1_ConfigurePinRequest_Direction direction,
60+
// deinitDigitalPin(wippersnapper_pin_v1_ConfigurePinRequest_Direction
61+
// direction,
6062
// ExpanderPin pinName);
6163

6264
int digitalReadSvc(ExpanderPin pinName);

src/components/display/assets/icons.h

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
/**
2020
* @brief cloud-thin-full icon from FontAwesome (16x16px)
21-
*
21+
*
2222
* ................
2323
* ................
2424
* .....#####......
@@ -43,7 +43,7 @@ const unsigned char epd_bmp_cloud_online[] = {
4343

4444
/**
4545
* @brief cloud-xmark-thin-full icon from FontAwesome (16x16px)
46-
*
46+
*
4747
* ................
4848
* ................
4949
* .....#####......
@@ -68,7 +68,7 @@ const unsigned char epd_bmp_cloud_offline[] PROGMEM = {
6868

6969
/**
7070
* @brief wifi-thin-full icon from FontAwesome (16x16px)
71-
*
71+
*
7272
* ................
7373
* .....######.....
7474
* ..####....####..
@@ -93,7 +93,7 @@ const unsigned char epd_bmp_wifi_full[] = {
9393

9494
/**
9595
* @brief wifi-fair-thin-full icon from FontAwesome (16x16px)
96-
*
96+
*
9797
* ................
9898
* ................
9999
* ................
@@ -118,7 +118,7 @@ const unsigned char epd_bmp_wifi_fair[] = {
118118

119119
/**
120120
* @brief wifi-weak-thin-full icon from FontAwesome (16x16px)
121-
*
121+
*
122122
* ................
123123
* ................
124124
* ................
@@ -143,7 +143,7 @@ const unsigned char epd_bmp_wifi_weak[] = {
143143

144144
/**
145145
* @brief wifi-slash-thin-full icon from FontAwesome (16x16px)
146-
*
146+
*
147147
* ................
148148
* .#..............
149149
* ..#..#####......
@@ -168,7 +168,7 @@ const unsigned char epd_bmp_wifi_no_signal[] = {
168168

169169
/**
170170
* @brief battery-full-thin-full icon from FontAwesome (16x16px)
171-
*
171+
*
172172
* ................
173173
* ................
174174
* ................
@@ -191,9 +191,8 @@ const unsigned char epd_bmp_bat_full[] = {
191191
0xfa, 0xf0, 0x0b, 0xf0, 0x0b, 0xf0, 0x0b, 0xf0, 0x0b, 0xff, 0xfa,
192192
0xc0, 0x06, 0x7f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
193193

194-
195194
/** * @brief battery-75-thin-full icon from FontAwesome (16x16px)
196-
*
195+
*
197196
* ................
198197
* ................
199198
* ................
@@ -218,7 +217,7 @@ const unsigned char epd_bmp_bat_75[] = {
218217

219218
/**
220219
* @brief battery-50-thin-full icon from FontAwesome (16x16px)
221-
*
220+
*
222221
* ................
223222
* ................
224223
* ................
@@ -243,7 +242,7 @@ const unsigned char epd_bmp_bat_50[] = {
243242

244243
/**
245244
* @brief battery-25-thin-full icon from FontAwesome (16x16px)
246-
*
245+
*
247246
* ................
248247
* ................
249248
* ................
@@ -268,7 +267,7 @@ const unsigned char epd_bmp_bat_25[] = {
268267

269268
/**
270269
* @brief battery-empty-thin-full icon from FontAwesome (16x16px)
271-
*
270+
*
272271
* ................
273272
* ................
274273
* ................
@@ -291,5 +290,4 @@ const unsigned char epd_bmp_bat_empty[] = {
291290
0x06, 0xc0, 0x06, 0xc0, 0x06, 0xc0, 0x06, 0xc0, 0x06, 0xc0, 0x06,
292291
0xc0, 0x06, 0x7f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
293292

294-
295293
#endif // _ICONS_H_

src/components/display/drivers/dispDrvBase.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ class dispDrvBase {
145145
// No-op for base class
146146
}
147147

148-
149148
/*!
150149
@brief Draws the battery icon based on the current battery level.
151150
@param bat

src/components/display/drivers/dispDrvSt7789.h

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,30 @@ class dispDrvSt7789 : public dispDrvBase {
7777
@return True if the display was initialized successfully, false otherwise.
7878
*/
7979
bool begin() override {
80-
#if defined(ARDUINO_ARDUINO_NESSO_N1)
81-
WS_DEBUG_PRINT("pin_cs: "); WS_DEBUG_PRINTLN(_pin_cs);
82-
WS_DEBUG_PRINT(" == LCD_CS "); WS_DEBUG_PRINTLN(_pin_cs == LCD_CS);
80+
#if defined(ARDUINO_ARDUINO_NESSO_N1)
81+
WS_DEBUG_PRINT("pin_cs: ");
82+
WS_DEBUG_PRINTLN(_pin_cs);
83+
WS_DEBUG_PRINT(" == LCD_CS ");
84+
WS_DEBUG_PRINTLN(_pin_cs == LCD_CS);
8385
if (_pin_cs == LCD_CS)
84-
_display = new Adafruit_ST7789((int8_t) _pin_cs, (int8_t) _pin_dc, &LCD_RESET);
86+
_display =
87+
new Adafruit_ST7789((int8_t)_pin_cs, (int8_t)_pin_dc, &LCD_RESET);
8588
else
86-
#endif
87-
_display = new Adafruit_ST7789(_pin_cs, _pin_dc, _pin_rst);
89+
#endif
90+
_display = new Adafruit_ST7789(_pin_cs, _pin_dc, _pin_rst);
8891
if (!_display)
8992
return false;
9093

9194
// Built in displays with custom init / swapped w+h
9295
#ifdef ARDUINO_ARDUINO_NESSO_N1
93-
if (_pin_cs == LCD_CS) {
94-
_display->init(135, 240);// Init ST7789 240x135
95-
_display->invertDisplay(true);
96-
} else {
96+
if (_pin_cs == LCD_CS) {
97+
_display->init(135, 240); // Init ST7789 240x135
98+
_display->invertDisplay(true);
99+
} else {
97100
#endif
98-
_display->init(_width, _height);
101+
_display->init(_width, _height);
99102
#if defined(ARDUINO_ARDUINO_NESSO_N1)
100-
}
103+
}
101104
#endif
102105
_display->setRotation(_rotation);
103106
_display->fillScreen(ST77XX_BLACK);
@@ -122,33 +125,32 @@ _display->init(_width, _height);
122125
return true;
123126
}
124127

125-
126128
/*!
127129
@brief Draws the battery icon based on the current battery level.
128130
@param bat
129131
The current battery level as a percentage (0-100).
130132
*/
131133
void drawBatteryIcon(uint8_t bat) override {
132134
const unsigned char *bat_icon = epd_bmp_bat_empty;
133-
if (bat >= 75) {
134-
bat_icon = epd_bmp_bat_full;
135-
} else if (bat < 75 && bat >= 50) {
136-
bat_icon = epd_bmp_bat_75;
137-
} else if (bat < 50 && bat >= 25) {
138-
bat_icon = epd_bmp_bat_50;
139-
} else if (bat < 25 && bat >= 10) {
140-
bat_icon = epd_bmp_bat_25;
141-
} else {
142-
bat_icon = epd_bmp_bat_empty;
143-
}
144-
// Clear and draw the new battery icon, based on battery level
145-
_display->fillRect(_statusbar_icon_battery_x, _statusbar_icons_y,
146-
ST7789_STATUSBAR_ICON_SZ, ST7789_STATUSBAR_ICON_SZ,
147-
ST77XX_WHITE);
148-
_display->drawBitmap(_statusbar_icon_battery_x, _statusbar_icons_y,
149-
bat_icon, ST7789_STATUSBAR_ICON_SZ,
150-
ST7789_STATUSBAR_ICON_SZ, ST77XX_BLACK);
151-
_statusbar_bat = bat;
135+
if (bat >= 75) {
136+
bat_icon = epd_bmp_bat_full;
137+
} else if (bat < 75 && bat >= 50) {
138+
bat_icon = epd_bmp_bat_75;
139+
} else if (bat < 50 && bat >= 25) {
140+
bat_icon = epd_bmp_bat_50;
141+
} else if (bat < 25 && bat >= 10) {
142+
bat_icon = epd_bmp_bat_25;
143+
} else {
144+
bat_icon = epd_bmp_bat_empty;
145+
}
146+
// Clear and draw the new battery icon, based on battery level
147+
_display->fillRect(_statusbar_icon_battery_x, _statusbar_icons_y,
148+
ST7789_STATUSBAR_ICON_SZ, ST7789_STATUSBAR_ICON_SZ,
149+
ST77XX_WHITE);
150+
_display->drawBitmap(_statusbar_icon_battery_x, _statusbar_icons_y,
151+
bat_icon, ST7789_STATUSBAR_ICON_SZ,
152+
ST7789_STATUSBAR_ICON_SZ, ST77XX_BLACK);
153+
_statusbar_bat = bat;
152154
}
153155

154156
/*!
@@ -223,7 +225,6 @@ _display->init(_width, _height);
223225
_display->setTextSize(_text_sz);
224226
}
225227

226-
227228
/*!
228229
@brief Updates the status bar with current information (battery level,
229230
connectivity status, etc).

src/components/pwm/ws_pwm.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ void ws_pwm::detach(uint8_t pin) {
8888
void ws_pwm::writeDutyCycle(uint8_t pin, int dutyCycle) {
8989
#if defined(ARDUINO_ARCH_ESP32)
9090
_ledcMgr->analogWrite(pin, dutyCycle);
91-
#elif (defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) || defined(STATUS_LED_INVERTED)) && defined(STATUS_LED_PIN)
91+
#elif (defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH) || \
92+
defined(STATUS_LED_INVERTED)) && \
93+
defined(STATUS_LED_PIN)
9294
// Adafruit Feather ESP8266's analogWrite() is inverted because its LED pin is
9395
// reverse-wired
9496
analogWrite(pin, 255 - dutyCycle);

0 commit comments

Comments
 (0)