Skip to content

Commit 7670e24

Browse files
formatting, refactoring, add more warnings
1 parent 33d0765 commit 7670e24

File tree

16 files changed

+51
-143
lines changed

16 files changed

+51
-143
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,18 @@ These were useful while refining the concept, check them out as well if you are
5858

5959
1. https://github.com/ModischFabrications/HUB75-DMA-Test \*
6060
1. https://github.com/ModischFabrications/Verdandi \*
61-
2. https://2dom.github.io/PixelTimes/
62-
2. https://github.com/rorosaurus/esp32-hub75-driver
63-
3. https://github.com/witnessmenow/ESP32-i2s-Matrix-Shield
64-
3. https://www.instructables.com/Morphing-Digital-Clock/
65-
4. https://github.com/bogd/esp32-morphing-clock
66-
5. https://github.com/marcmerlin/AnimatedGIFs
67-
6. https://github.com/LukPopp0/MatrixDisplay
68-
7. https://randomnerdtutorials.com/esp32-touch-pins-arduino-ide/
69-
8. https://github.com/witnessmenow/ESP8266-Led-Matrix-Web-Draw
61+
1. https://2dom.github.io/PixelTimes/
62+
1. https://github.com/rorosaurus/esp32-hub75-driver
63+
1. https://github.com/witnessmenow/ESP32-i2s-Matrix-Shield
64+
1. https://www.instructables.com/Morphing-Digital-Clock/
65+
1. https://github.com/bogd/esp32-morphing-clock
66+
1. https://github.com/marcmerlin/AnimatedGIFs
67+
1. https://github.com/LukPopp0/MatrixDisplay
68+
1. https://randomnerdtutorials.com/esp32-touch-pins-arduino-ide/
69+
1. https://github.com/witnessmenow/ESP8266-Led-Matrix-Web-Draw
70+
1. https://arduinojson.org/v6/assistant/
71+
1. All the examples of the libraries mentioned above
72+
1.
7073

7174
\* Great guy, love him like myself.
7275

include/README

Lines changed: 0 additions & 39 deletions
This file was deleted.

lib/README

Lines changed: 0 additions & 46 deletions
This file was deleted.

platformio.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ board = esp32doit-devkit-v1
1515
board_build.filesystem = littlefs
1616
board_build.partitions = no_ota.csv
1717

18+
build_flags = -Wall
19+
1820
upload_speed = 921600
1921

2022
monitor_speed = 115200

src/display.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include <ESP32-HUB75-MatrixPanel-I2S-DMA.h> // https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-I2S-DMA
99
#include <FastLED.h>
1010

11+
// manages screen initialization and some utility methods. Bypassable by more complex interactions.
12+
1113
namespace Display {
1214
using namespace Pinout;
1315

@@ -85,8 +87,6 @@ void flashScreen() {
8587
screen->clearScreen();
8688
}
8789

88-
// TODO copy from Tests\animations.h
89-
9090
void setup() {
9191
println(F("Starting matrix..."));
9292

src/inputs/touch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void loop() {
6161
}
6262
logAllTouches();
6363
touched = NONE;
64-
RebootManager::setActive();
64+
RebootManager::reset();
6565
}
6666

6767
} // namespace Input_Touch

src/inputs/website.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55
#include <Arduino.h>
66
#include <ESPAsyncWebServer.h> // https://github.com/me-no-dev/ESPAsyncWebServer
77

8-
/**
9-
* /cmd?state=1
10-
*
11-
*/
12-
138
namespace Website {
149

10+
namespace {
1511
AsyncWebServer server(80);
1612

1713
void notFound(AsyncWebServerRequest* request) {
@@ -26,7 +22,7 @@ void GetRoot(AsyncWebServerRequest* request) {
2622
}
2723

2824
void GetAPI(AsyncWebServerRequest* request) {
29-
RebootManager::setActive();
25+
RebootManager::reset();
3026

3127
String message = F("Possible Commands, chain with \"&\":\n");
3228
message.reserve(200);
@@ -73,8 +69,8 @@ void GetAPI(AsyncWebServerRequest* request) {
7369
request->send(200, "text/plain", message);
7470
Display::flashDot();
7571
}
72+
} // namespace
7673

77-
bool ready = false;
7874
// contract: WiFi must be enabled already
7975
void setup() {
8076
println(F("Preparing website"));
@@ -85,4 +81,6 @@ void setup() {
8581
server.begin();
8682
}
8783

84+
void loop() {}
85+
8886
} // namespace Website

src/modes/dashboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "shared/weatherService.h"
77
#include <Arduino.h>
88

9-
// maybe morph using https://github.com/hwiguna/HariFun_166_Morphing_Clock/blob/master/Latest/MorphingClock/Digit.cpp
9+
// TODO: this mode really needs some love from an artist
1010

1111
namespace Modes_Dashboard {
1212
namespace {

src/shared/humanHash.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22
#include <stdint.h>
33

4+
// currently unused, but it might be useful for pairing later
45
// this class will make a hash without similar looking or sounding chars
56

67
const char* safeChars = "23456789ABCDEFGHKLMNPQRSTUVWXYZ";
@@ -25,14 +26,12 @@ uint16_t reverse16(uint16_t in) {
2526
}
2627

2728
// CRC POLYNOME = x15 + 1 = 1000 0000 0000 0001 = 0x8001
28-
uint16_t crc16(const uint8_t* array, uint8_t length, uint16_t polynome = 0x8001,
29-
uint16_t startmask = 0x0000, uint16_t endmask = 0x0000, bool reverseIn = false,
30-
bool reverseOut = false) {
29+
uint16_t crc16(const uint8_t* array, uint8_t length, uint16_t polynome = 0x8001, uint16_t startmask = 0x0000,
30+
uint16_t endmask = 0x0000, bool reverseIn = false, bool reverseOut = false) {
3131
uint16_t crc = startmask;
3232
while (length--) {
3333
uint8_t data = *array++;
34-
if (reverseIn)
35-
data = reverse8(data);
34+
if (reverseIn) data = reverse8(data);
3635
crc ^= ((uint16_t)data) << 8;
3736
for (uint8_t i = 8; i; i--) {
3837
if (crc & (1 << 15)) {
@@ -43,8 +42,7 @@ uint16_t crc16(const uint8_t* array, uint8_t length, uint16_t polynome = 0x8001,
4342
}
4443
}
4544
}
46-
if (reverseOut)
47-
crc = reverse16(crc);
45+
if (reverseOut) crc = reverse16(crc);
4846
crc ^= endmask;
4947
return crc;
5048
}

src/shared/network/WiFiLoginManager.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
namespace WiFiLoginManager {
1111

1212
namespace {
13-
// IPAddress testHost(8, 8, 8, 8);
14-
IPAddress testHost(1, 1, 1, 1);
13+
// IPAddress testHost(8, 8, 8, 8); // google
14+
IPAddress testHost(1, 1, 1, 1); // cloudflare
15+
1516
WiFiManager wifiManager;
1617
String _hostname;
1718
} // namespace

0 commit comments

Comments
 (0)