Skip to content

Commit 4724600

Browse files
authored
Merge pull request #51 from adafruit/fix-warnings
Fix warnings
2 parents 1cae7b8 + aba4151 commit 4724600

37 files changed

+122
-71
lines changed

.github/workflows/githubci.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,21 @@ on: [pull_request, push, repository_dispatch]
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8-
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
arduino-platform:
12+
- 'uno'
13+
- 'leonardo'
14+
- 'mega2560'
15+
- 'esp8266'
16+
- 'esp32'
17+
- 'trinket_m0'
18+
- 'cpb'
19+
- 'cpx'
20+
- 'metro_m0'
21+
- 'metro_m4_tinyusb'
22+
923
steps:
1024
- uses: actions/setup-python@v1
1125
with:
@@ -26,10 +40,30 @@ jobs:
2640
git clone --quiet https://github.com/adafruit/Adafruit_SPIFlash.git /home/runner/Arduino/libraries/Adafruit_SPIFlash
2741
2842
- name: test platforms
29-
run: python3 ci/build_platform.py main_platforms metro_m4_tinyusb cpb cpx
43+
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}
44+
45+
clang_and_doxy:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Setup Python
49+
uses: actions/setup-python@v1
50+
with:
51+
python-version: '3.x'
52+
53+
- name: Checkout code
54+
uses: actions/checkout@v2
55+
56+
- name: Checkout adafruit/ci-arduino
57+
uses: actions/checkout@v2
58+
with:
59+
repository: adafruit/ci-arduino
60+
path: ci
61+
62+
- name: pre-install
63+
run: bash ci/actions_install.sh
3064

3165
- name: clang
32-
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
66+
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
3367

3468
- name: doxygen
3569
env:

examples/EPDTest/EPDTest.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void loop() {
103103
}
104104

105105

106-
void testdrawtext(char *text, uint16_t color) {
106+
void testdrawtext(const char *text, uint16_t color) {
107107
display.setCursor(0, 0);
108108
display.setTextColor(color);
109109
display.setTextWrap(true);

examples/GizmoTest/GizmoTest.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void loop() {
8484
}
8585

8686

87-
void testdrawtext(char *text, uint16_t color) {
87+
void testdrawtext(const char *text, uint16_t color) {
8888
display.setCursor(0, 0);
8989
display.setTextColor(color);
9090
display.setTextWrap(true);

examples/ThinkInk_gray4/ThinkInk_gray4.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void loop() {
9191
}
9292

9393

94-
void testdrawtext(char *text, uint16_t color) {
94+
void testdrawtext(const char *text, uint16_t color) {
9595
display.setCursor(0, 0);
9696
display.setTextColor(color);
9797
display.setTextWrap(true);

examples/ThinkInk_mono/ThinkInk_mono.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void loop() {
101101
}
102102

103103

104-
void testdrawtext(char *text, uint16_t color) {
104+
void testdrawtext(const char *text, uint16_t color) {
105105
display.setCursor(0, 0);
106106
display.setTextColor(color);
107107
display.setTextWrap(true);

examples/ThinkInk_tricolor/ThinkInk_tricolor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void loop() {
9696
}
9797

9898

99-
void testdrawtext(char *text, uint16_t color) {
99+
void testdrawtext(const char *text, uint16_t color) {
100100
display.setCursor(0, 0);
101101
display.setTextColor(color);
102102
display.setTextWrap(true);

examples/acep_7ColorTest/acep_7ColorTest.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void loop() {
8181

8282
#define BUFFPIXEL 20
8383

84-
bool bmpDraw(char *filename, int16_t x, int16_t y) {
84+
bool bmpDraw(const char *filename, int16_t x, int16_t y) {
8585
File bmpFile;
8686
int bmpWidth, bmpHeight; // W+H in pixels
8787
uint8_t bmpDepth; // Bit depth (currently must be 24)
@@ -103,7 +103,7 @@ bool bmpDraw(char *filename, int16_t x, int16_t y) {
103103
Serial.println('\'');
104104

105105
// Open requested file on SD card
106-
if ((bmpFile = fatfs.open(filename, FILE_READ)) == NULL) {
106+
if ((bmpFile = fatfs.open(filename, FILE_READ)) == false) {
107107
Serial.print(F("File not found"));
108108
return false;
109109
}

examples/graphicstest/graphicstest.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void testlines(uint16_t color) {
158158
display.display();
159159
}
160160

161-
void testdrawtext(char *text, uint16_t color) {
161+
void testdrawtext(const char *text, uint16_t color) {
162162
display.clearBuffer();
163163
display.setCursor(5, 5);
164164
display.setTextColor(color);

src/Adafruit_EPD.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ void Adafruit_EPD::writeSRAMFramebufferToEPD(uint16_t SRAM_buffer_addr,
312312
uint32_t buffer_size,
313313
uint8_t EPDlocation,
314314
bool invertdata) {
315+
(void)invertdata;
315316
uint8_t c;
316317
// use SRAM
317318
sram.csLow();
@@ -350,8 +351,6 @@ void Adafruit_EPD::writeSRAMFramebufferToEPD(uint16_t SRAM_buffer_addr,
350351
*/
351352
/**************************************************************************/
352353
void Adafruit_EPD::display(bool sleep) {
353-
uint8_t c;
354-
355354
#ifdef EPD_DEBUG
356355
Serial.println(" Powering Up");
357356
#endif

src/Adafruit_MCPSRAM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void Adafruit_MCPSRAM::write(uint16_t addr, uint8_t *buf, uint16_t num,
146146
}
147147

148148
// write buffer of data
149-
for (int i = 0; i < num; i++) {
149+
for (uint16_t i = 0; i < num; i++) {
150150

151151
uint8_t d = buf[i];
152152

@@ -224,7 +224,7 @@ void Adafruit_MCPSRAM::read(uint16_t addr, uint8_t *buf, uint16_t num,
224224
}
225225

226226
// read data into buffer
227-
for (int i = 0; i < num; i++) {
227+
for (uint16_t i = 0; i < num; i++) {
228228

229229
if (hwSPI) {
230230
buf[i] = _spi->transfer(0x00);

0 commit comments

Comments
 (0)