removed definees 'ENABLE_...'
This commit is contained in:
parent
e47bc86299
commit
09cc27cdec
@ -13,8 +13,8 @@ platform = espressif32
|
|||||||
board = esp32dev
|
board = esp32dev
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps = https://github.com/adafruit/Adafruit_NeoPixel
|
lib_deps = https://github.com/adafruit/Adafruit_NeoPixel
|
||||||
build_flags = -D ENABLE_ALL=true -D ENABLE_OTA=false
|
build_flags =
|
||||||
;upload_port = 10.0.0.120
|
;upload_port = 10.0.0.153
|
||||||
;upload_protocol = espota
|
;upload_protocol = espota
|
||||||
upload_port = /dev/ttyUSB0
|
upload_port = /dev/ttyUSB0
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
|
|||||||
14
src/main.cpp
14
src/main.cpp
@ -1,28 +1,21 @@
|
|||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
|
||||||
#if ENABLE_OTA
|
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mode/Mode.h"
|
#include "mode/Mode.h"
|
||||||
#include "display/Display.h"
|
#include "display/Display.h"
|
||||||
#include <WebServer.h>
|
#include <WebServer.h>
|
||||||
|
|
||||||
#if ENABLE_ALL
|
|
||||||
|
|
||||||
#include "mode/GameOfLife/GameOfLife.h"
|
#include "mode/GameOfLife/GameOfLife.h"
|
||||||
#include "mode/Pong/Pong.h"
|
#include "mode/Pong/Pong.h"
|
||||||
#include "mode/Test/Border.h"
|
#include "mode/Test/Border.h"
|
||||||
#include "mode/Clock/Clock.h"
|
#include "mode/Clock/Clock.h"
|
||||||
#include "mode/SpaceInvaders/SpaceInvaders.h"
|
#include "mode/SpaceInvaders/SpaceInvaders.h"
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mode/NewYear/NewYear.h"
|
#include "mode/NewYear/NewYear.h"
|
||||||
|
|
||||||
enum ModeId {
|
enum ModeId {
|
||||||
NONE,
|
NONE,
|
||||||
#if ENABLE_ALL
|
|
||||||
BORDER,
|
BORDER,
|
||||||
CLOCK,
|
CLOCK,
|
||||||
GAME_OF_LIFE_BLACK_WHITE,
|
GAME_OF_LIFE_BLACK_WHITE,
|
||||||
@ -31,7 +24,6 @@ enum ModeId {
|
|||||||
GAME_OF_LIFE_RANDOM_COLOR,
|
GAME_OF_LIFE_RANDOM_COLOR,
|
||||||
PONG,
|
PONG,
|
||||||
SPACE_INVADERS,
|
SPACE_INVADERS,
|
||||||
#endif
|
|
||||||
NEW_YEAR,
|
NEW_YEAR,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -112,7 +104,6 @@ void setup() {
|
|||||||
|
|
||||||
WiFi.begin("HappyNet", "1Grausame!Sackratte7");
|
WiFi.begin("HappyNet", "1Grausame!Sackratte7");
|
||||||
|
|
||||||
#if ENABLE_OTA
|
|
||||||
ArduinoOTA.onStart([]() {
|
ArduinoOTA.onStart([]() {
|
||||||
display.clear();
|
display.clear();
|
||||||
display.loop();
|
display.loop();
|
||||||
@ -133,7 +124,6 @@ void setup() {
|
|||||||
display.loop();
|
display.loop();
|
||||||
});
|
});
|
||||||
ArduinoOTA.begin();
|
ArduinoOTA.begin();
|
||||||
#endif
|
|
||||||
|
|
||||||
server.on("", web_index);
|
server.on("", web_index);
|
||||||
server.on("/", web_index);
|
server.on("/", web_index);
|
||||||
@ -151,9 +141,7 @@ void setup() {
|
|||||||
void setSpeed(double value);
|
void setSpeed(double value);
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
#if ENABLE_OTA
|
|
||||||
ArduinoOTA.handle();
|
ArduinoOTA.handle();
|
||||||
#endif
|
|
||||||
server.handleClient();
|
server.handleClient();
|
||||||
bool hasIp = (uint32_t) WiFi.localIP() != 0;
|
bool hasIp = (uint32_t) WiFi.localIP() != 0;
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
@ -234,7 +222,6 @@ void loadNewMode() {
|
|||||||
switch (currentModeId) {
|
switch (currentModeId) {
|
||||||
case NONE:
|
case NONE:
|
||||||
break;
|
break;
|
||||||
#if ENABLE_ALL
|
|
||||||
case BORDER:
|
case BORDER:
|
||||||
mode = new Border(&display);
|
mode = new Border(&display);
|
||||||
break;
|
break;
|
||||||
@ -259,7 +246,6 @@ void loadNewMode() {
|
|||||||
case SPACE_INVADERS:
|
case SPACE_INVADERS:
|
||||||
mode = new SpaceInvaders(&display);
|
mode = new SpaceInvaders(&display);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case NEW_YEAR:
|
case NEW_YEAR:
|
||||||
mode = new NewYear(&display);
|
mode = new NewYear(&display);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user