Skip to content

Commit 2ba1cb0

Browse files
committed
clang
1 parent eb01cf9 commit 2ba1cb0

File tree

4 files changed

+25
-29
lines changed

4 files changed

+25
-29
lines changed

examples/EPDTest/EPDTest.ino

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// Uncomment the following line if you are using 1.54" EPD with SSD1681
2626
//Adafruit_SSD1681 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2727
// Uncomment the following line if you are using 1.54" EPD with UC8151D
28-
Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
28+
//Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2929

3030

3131
//Uncomment the following line if you are using 2.13" EPD with SSD1680
@@ -41,22 +41,26 @@ Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY)
4141
//Adafruit_UC8151D display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
4242

4343
//Uncomment the following line if you are using 2.13" EPD with IL0373
44-
//Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
44+
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
4545
//#define FLEXIBLE_213
4646

4747

48-
/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD */
48+
//Uncomment the following line if you are using 2.7" EPD with IL91874
4949
//Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
5050

51-
// 2.7" tricolor with Adafruit_EK79686
52-
//Adafruit_EK79686 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
51+
// Uncomment the following line if you are using 2.7" EPD with EK79686
52+
//Adafruit_EK79686 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
5353

54-
/* Uncomment the following line if you are using 2.9" EPD */
54+
55+
// Uncomment the following line if you are using 2.9" EPD with IL0373
5556
//Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
5657
//#define FLEXIBLE_290
5758

58-
/* Uncomment the following line if you are using 4.2" tricolor EPD */
59-
//Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
59+
// Uncomment the following line if you are using 2.9" EPD with SSD1680
60+
//Adafruit_SSD1680 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
61+
62+
// Uncomment the following line if you are using 2.9" EPD with UC8151D
63+
//Adafruit_UC8151D display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
6064

6165

6266
#define COLOR1 EPD_BLACK

src/Adafruit_EPD.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ class Adafruit_EPD : public Adafruit_GFX {
194194
void dcLow();
195195
};
196196

197+
#include "drivers/Adafruit_ACeP.h"
197198
#include "drivers/Adafruit_EK79686.h"
198199
#include "drivers/Adafruit_IL0373.h"
199200
#include "drivers/Adafruit_IL0398.h"
@@ -204,8 +205,7 @@ class Adafruit_EPD : public Adafruit_GFX {
204205
#include "drivers/Adafruit_SSD1675B.h"
205206
#include "drivers/Adafruit_SSD1680.h"
206207
#include "drivers/Adafruit_SSD1681.h"
207-
#include "drivers/Adafruit_UC8276.h"
208208
#include "drivers/Adafruit_UC8151D.h"
209-
#include "drivers/Adafruit_ACeP.h"
209+
#include "drivers/Adafruit_UC8276.h"
210210

211211
#endif /* _ADAFRUIT_EPD_H_ */

src/drivers/Adafruit_ACeP.cpp

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#define BUSY_WAIT 500
55

6-
76
// clang-format off
87

98
const uint8_t acep_default_init_code[] {
@@ -21,7 +20,6 @@ const uint8_t acep_default_init_code[] {
2120

2221
// clang-format on
2322

24-
2523
/**************************************************************************/
2624
/*!
2725
@brief constructor if using external SRAM chip and software SPI
@@ -37,10 +35,9 @@ const uint8_t acep_default_init_code[] {
3735
@param BUSY the busy pin to use
3836
*/
3937
/**************************************************************************/
40-
Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID,
41-
int8_t SCLK, int8_t DC, int8_t RST,
42-
int8_t CS, int8_t SRCS, int8_t MISO,
43-
int8_t BUSY)
38+
Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID, int8_t SCLK,
39+
int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
40+
int8_t MISO, int8_t BUSY)
4441
: Adafruit_EPD(width, height, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY) {
4542

4643
if ((width % 8) != 0) {
@@ -59,7 +56,6 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID,
5956
}
6057

6158
singleByteTxns = true;
62-
6359
}
6460

6561
// constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
@@ -77,8 +73,7 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t SID,
7773
*/
7874
/**************************************************************************/
7975
Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t DC, int8_t RST,
80-
int8_t CS, int8_t SRCS, int8_t BUSY,
81-
SPIClass *spi)
76+
int8_t CS, int8_t SRCS, int8_t BUSY, SPIClass *spi)
8277
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY, spi) {
8378

8479
if ((height % 8) != 0) {
@@ -106,7 +101,7 @@ Adafruit_ACEP::Adafruit_ACEP(int width, int height, int8_t DC, int8_t RST,
106101
/**************************************************************************/
107102
void Adafruit_ACEP::busy_wait(void) {
108103
if (_busy_pin >= 0) {
109-
while (! digitalRead(_busy_pin)) { // wait for busy high
104+
while (!digitalRead(_busy_pin)) { // wait for busy high
110105
delay(10);
111106
}
112107
} else {
@@ -169,9 +164,9 @@ void Adafruit_ACEP::update() {
169164
buf[3] = 0xC0;
170165
EPD_command(ACEP_RESOLUTION, buf, 4);
171166
EPD_command(ACEP_DTM);
172-
for (int i=0; i< 134400/256; i++) {
167+
for (int i = 0; i < 134400 / 256; i++) {
173168
uint8_t block[256];
174-
memset(block, ((i % 6) << 4) | (i %6), 256);
169+
memset(block, ((i % 6) << 4) | (i % 6), 256);
175170
EPD_data(block, 256);
176171
}
177172
EPD_command(ACEP_POWER_ON);
@@ -241,6 +236,4 @@ uint8_t Adafruit_ACEP::writeRAMCommand(uint8_t index) {
241236
@param y Y address counter value
242237
*/
243238
/**************************************************************************/
244-
void Adafruit_ACEP::setRAMAddress(uint16_t x, uint16_t y) {
245-
246-
}
239+
void Adafruit_ACEP::setRAMAddress(uint16_t x, uint16_t y) {}

src/drivers/Adafruit_ACeP.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "Adafruit_EPD.h"
55
#include <Arduino.h>
66

7-
87
#define ACEP_PANEL_SETTING 0x00
98
#define ACEP_POWER_SETTING 0x01
109
#define ACEP_POWER_OFF 0x02
@@ -29,10 +28,10 @@
2928
class Adafruit_ACEP : public Adafruit_EPD {
3029
public:
3130
Adafruit_ACEP(int width, int height, int8_t SID, int8_t SCLK, int8_t DC,
32-
int8_t RST, int8_t CS, int8_t SRCS, int8_t MISO,
33-
int8_t BUSY = -1);
31+
int8_t RST, int8_t CS, int8_t SRCS, int8_t MISO,
32+
int8_t BUSY = -1);
3433
Adafruit_ACEP(int width, int height, int8_t DC, int8_t RST, int8_t CS,
35-
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
34+
int8_t SRCS, int8_t BUSY = -1, SPIClass *spi = &SPI);
3635

3736
void begin(bool reset = true);
3837
void powerUp();

0 commit comments

Comments
 (0)