From 014aa028d78a1bd43962fcedc2b40525158da26f Mon Sep 17 00:00:00 2001 From: Simon Schmidt Date: Sat, 26 Jun 2021 07:33:12 +0200 Subject: [PATCH] move http and ota to lib/ for testing, add #pragma once include guards --- .vscode/settings.json | 3 ++- include/ota.h | 8 ++------ {src => lib/httpserver}/filesys.cpp | 0 {include => lib/httpserver}/filesys.h | 5 +---- {src => lib/httpserver}/httpserver.cpp | 0 {include => lib/httpserver}/httpserver.h | 6 +----- src/main.cpp | 2 +- 7 files changed, 7 insertions(+), 17 deletions(-) rename {src => lib/httpserver}/filesys.cpp (100%) rename {include => lib/httpserver}/filesys.h (84%) rename {src => lib/httpserver}/httpserver.cpp (100%) rename {include => lib/httpserver}/httpserver.h (93%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4eaa233..93ad4be 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -48,5 +48,6 @@ "streambuf": "cpp", "cinttypes": "cpp", "typeinfo": "cpp" - } + }, + "python.pythonPath": "C:\\Users\\simon\\AppData\\Local\\Programs\\Python\\Python37\\python.exe" } \ No newline at end of file diff --git a/include/ota.h b/include/ota.h index 55737d2..14dc4d2 100644 --- a/include/ota.h +++ b/include/ota.h @@ -1,5 +1,4 @@ -#ifndef __OTA_H -#define __OTA_H +#pragma once #include #include @@ -46,7 +45,4 @@ void ota_setup() { }); ArduinoOTA.begin(); -} - - -#endif // __OTA_H \ No newline at end of file +} \ No newline at end of file diff --git a/src/filesys.cpp b/lib/httpserver/filesys.cpp similarity index 100% rename from src/filesys.cpp rename to lib/httpserver/filesys.cpp diff --git a/include/filesys.h b/lib/httpserver/filesys.h similarity index 84% rename from include/filesys.h rename to lib/httpserver/filesys.h index 49b03ea..8f756ea 100644 --- a/include/filesys.h +++ b/lib/httpserver/filesys.h @@ -1,5 +1,4 @@ -#ifndef __FILESYS_H -#define __FILESYS_H +#pragma once #include @@ -12,5 +11,3 @@ void writeFile(const char * path, const char * message); void appendFile(const char * path, const char * message); void renameFile(const char * path1, const char * path2); void deleteFile(const char * path); - -#endif // __FILESYS_H \ No newline at end of file diff --git a/src/httpserver.cpp b/lib/httpserver/httpserver.cpp similarity index 100% rename from src/httpserver.cpp rename to lib/httpserver/httpserver.cpp diff --git a/include/httpserver.h b/lib/httpserver/httpserver.h similarity index 93% rename from include/httpserver.h rename to lib/httpserver/httpserver.h index 0862875..38c5370 100644 --- a/include/httpserver.h +++ b/lib/httpserver/httpserver.h @@ -1,10 +1,8 @@ -#ifndef __HTTPSERVER_H -#define __HTTPSERVER_H +#pragma once #include "filesys.h" #include - class HTTPServer : public ESP8266WebServer { private: const char* rootDir; @@ -44,5 +42,3 @@ public: return false; } }; - -#endif // __HTTPSERVER_H \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index ead5183..9079023 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,8 +9,8 @@ extern "C" { #include "user_interface.h" } // OTA & WEB -#include "ota.h" #include "wifi_credentials.h" +#include "ota.h" #include "httpserver.h" // BOARD