add FSM3.0 src code not impl yet, add header guards and format main

This commit is contained in:
Simon Schmidt 2021-07-07 18:28:05 +02:00
parent f57e875a17
commit 5986beb10c
5 changed files with 24 additions and 24 deletions

View File

@ -43,15 +43,15 @@
<div class="terminal"> <div class="terminal">
<input type="button" id="clear_term" value="clear" onclick="clearTerminal();"> <input type="button" id="clear_term" value="clear" onclick="clearTerminal();">
<input type="checkbox" id="scroll" name="scroll" value="scroll" checked> <input type="checkbox" id="scroll" name="scroll" value="scroll" checked>
<label for="scroll"> autoscroll </label> <label for="scroll"> autoscroll </label>
<textarea id="term">waiting for log messages ...&#10;</textarea> <textarea id="term">waiting for log messages ...&#10;</textarea>
</div> </div>
</body> </body>
<script src="/input.js"></script> <script src="/input.js"></script>
</html> </html>

View File

@ -1,7 +1,7 @@
#ifndef __HTTPSERVER_H
#define __HTTPSERVER_H
// Wrapper for ESP8266WebServer with Filesystem as HTTP source // Wrapper for ESP8266WebServer with Filesystem as HTTP source
#pragma once
#include <ESP8266WebServer.h> #include <ESP8266WebServer.h>
#include <stdarg.h> #include <stdarg.h>
#include "filesys.h" #include "filesys.h"
@ -42,3 +42,5 @@ public:
void logf(const char *format, ...); void logf(const char *format, ...);
void logt(const char *format, ...); void logt(const char *format, ...);
}; };
#endif // __HTTPSERVER_H

View File

@ -1,4 +1,5 @@
#pragma once #ifndef __TREPPE_H
#define __TREPPE_H
#include "FSMTreppe2/FSMTreppe2.h" #include "FSMTreppe2/FSMTreppe2.h"
#include "PCA9685.h" #include "PCA9685.h"
@ -88,3 +89,5 @@ public:
void set_active_pwm(uint16_t _active_pwm); void set_active_pwm(uint16_t _active_pwm);
void set_time_per_stair(uint16_t _time_per_stair); void set_time_per_stair(uint16_t _time_per_stair);
}; };
#endif // __TREPPE_H

View File

@ -13,5 +13,5 @@ mem 0x60000000 0x60001fff rw
set serial baud 460800 set serial baud 460800
file .pio/build/debug/firmware.elf file .pio/build/debug/firmware.elf
target remote /dev/ttyUSB0 target remote \\.\COM23
thb loop thb loop

View File

@ -15,7 +15,7 @@ extern "C" {
// BOARD // BOARD
#define ESP12_LED 2 #define ESP12_LED 2
#define NODEMCU_LED 16 // #define NODEMCU_LED 16
// PWM // PWM
#include "treppe.h" #include "treppe.h"
@ -54,14 +54,15 @@ void setup() {
#else #else
Serial.begin(76800); Serial.begin(76800);
#endif #endif
Serial.println("Booting ....");
Serial.println(F("Booting ...."));
//pinMode(NODEMCU_LED, OUTPUT);
pinMode(ESP12_LED, OUTPUT); pinMode(ESP12_LED, OUTPUT);
Wire.begin(); // Wire must be started first Wire.begin(); // Wire must be started first
Wire.setClock(1000000); // Supported baud rates are 100kHz, 400kHz, and 1000kHz 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.mode(WIFI_STA);
WiFi.begin(ssid, password); WiFi.begin(ssid, password);
@ -82,14 +83,8 @@ void setup() {
httpServer.start(); httpServer.start();
httpServer.start_apps(); httpServer.start_apps();
Serial.println("HTTP server started !"); 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_setfn(&timer1, timerCallback, &timer_flag);
os_timer_arm(&timer1, 20, true); os_timer_arm(&timer1, 20, true);
} }