From 5986beb10c923dedfae82c52d10e55f585d6ae29 Mon Sep 17 00:00:00 2001 From: Simon Schmidt Date: Wed, 7 Jul 2021 18:28:05 +0200 Subject: [PATCH] add FSM3.0 src code not impl yet, add header guards and format main --- data/index.html | 16 ++++++++-------- lib/httpserver/httpserver.h | 6 ++++-- lib/treppe/treppe.h | 7 +++++-- scripts/gdboptions | 2 +- src/main.cpp | 17 ++++++----------- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/data/index.html b/data/index.html index cdbf572..4911733 100644 --- a/data/index.html +++ b/data/index.html @@ -27,7 +27,7 @@
Time per stair: 50 % - +
@@ -38,20 +38,20 @@
- +
-
- - - - +
+ + + +
- + \ No newline at end of file diff --git a/lib/httpserver/httpserver.h b/lib/httpserver/httpserver.h index 9eb3ca1..0db5feb 100644 --- a/lib/httpserver/httpserver.h +++ b/lib/httpserver/httpserver.h @@ -1,7 +1,7 @@ +#ifndef __HTTPSERVER_H +#define __HTTPSERVER_H // Wrapper for ESP8266WebServer with Filesystem as HTTP source -#pragma once - #include #include #include "filesys.h" @@ -42,3 +42,5 @@ public: void logf(const char *format, ...); void logt(const char *format, ...); }; + +#endif // __HTTPSERVER_H \ No newline at end of file diff --git a/lib/treppe/treppe.h b/lib/treppe/treppe.h index b5a1093..777a08d 100644 --- a/lib/treppe/treppe.h +++ b/lib/treppe/treppe.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef __TREPPE_H +#define __TREPPE_H #include "FSMTreppe2/FSMTreppe2.h" #include "PCA9685.h" @@ -87,4 +88,6 @@ public: void activate_idle_pwm(bool active); void set_active_pwm(uint16_t _active_pwm); void set_time_per_stair(uint16_t _time_per_stair); -}; \ No newline at end of file +}; + +#endif // __TREPPE_H \ No newline at end of file diff --git a/scripts/gdboptions b/scripts/gdboptions index 33d4bd7..0e02f1c 100644 --- a/scripts/gdboptions +++ b/scripts/gdboptions @@ -13,5 +13,5 @@ mem 0x60000000 0x60001fff rw set serial baud 460800 file .pio/build/debug/firmware.elf -target remote /dev/ttyUSB0 +target remote \\.\COM23 thb loop diff --git a/src/main.cpp b/src/main.cpp index fc5bf63..bc76232 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,7 +15,7 @@ extern "C" { // BOARD #define ESP12_LED 2 -#define NODEMCU_LED 16 +// #define NODEMCU_LED 16 // PWM #include "treppe.h" @@ -54,14 +54,15 @@ void setup() { #else Serial.begin(76800); #endif - - Serial.println(F("Booting ....")); - - //pinMode(NODEMCU_LED, OUTPUT); + Serial.println("Booting ...."); pinMode(ESP12_LED, OUTPUT); Wire.begin(); // Wire must be started first Wire.setClock(1000000); // Supported baud rates are 100kHz, 400kHz, and 1000kHz + stairs.setup(); + Serial.println("PCA9685 connected !"); + //attachInterrupt(digitalPinToInterrupt(2), int_test, RISING); + //attachInterrupt(digitalPinToInterrupt(12), int_test, RISING); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); @@ -82,14 +83,8 @@ void setup() { httpServer.start(); httpServer.start_apps(); - Serial.println("HTTP server started !"); - stairs.setup(); - Serial.println("PCA9685 connected !"); - //attachInterrupt(digitalPinToInterrupt(2), int_test, RISING); - //attachInterrupt(digitalPinToInterrupt(12), int_test, RISING); - os_timer_setfn(&timer1, timerCallback, &timer_flag); os_timer_arm(&timer1, 20, true); }