Skip to content

Commit

Permalink
fix displayTest preference and add loop for testing display
Browse files Browse the repository at this point in the history
  • Loading branch information
kennygarreau committed Jun 4, 2024
1 parent e113668 commit be29b86
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/v1server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct v1Settings {
String wifiMode;
bool isPortraitMode;
bool disableBLE;
bool storeMode;
bool displayTest;
};
v1Settings settings;
bool isPortraitMode;
Expand Down Expand Up @@ -275,7 +275,7 @@ void loadSettings() {
settings.ssid = preferences.getString("ssid", "v1display");
settings.password = preferences.getString("password", "password123");
settings.disableBLE = preferences.getBool("disableBLE", false);
settings.storeMode = preferences.getBool("storeMode", false);
settings.displayTest = preferences.getBool("displayTest", false);
}

void saveSelectedConstants(const DisplayConstants& constants) {
Expand Down Expand Up @@ -311,6 +311,10 @@ void setup()
Serial.println("Reading initial settings...");
preferences.begin("settings", false);
settings.isPortraitMode = preferences.getBool("isPortraitMode", true);
settings.displayTest = preferences.putBool("displayTest", false);
// Uncomment below for testing display
//settings.displayTest = preferences.putBool("displayTest", true);

Serial.print("settings.isPortraitMode is set to: ");
Serial.println(settings.isPortraitMode ? "true" : "false");
// Serial.print("MAX_X: ");
Expand Down Expand Up @@ -401,6 +405,19 @@ void loop() {
//do something if button is pressed
}

if (settings.displayTest == true) {
Serial.println(settings.displayTest);

std::string packets[] = {"AAD6EA430713291D21858800E8AB", "AAD6EA4307235E569283240000AB", "AAD6EA430733878CB681228030AB"};

for (const std::string& packet : packets) {
PacketDecoder decoder(packet);
std::string decoded = decoder.decode();
}

sleep(30);
}

if (settings.disableBLE == false) {
if (pClient->isConnected()) {
connected = true;
Expand Down

0 comments on commit be29b86

Please sign in to comment.