add FSM3.0 src code not impl yet, add header guards and format main
This commit is contained in:
parent
f57e875a17
commit
5986beb10c
@ -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
|
@ -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
|
@ -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
|
||||||
|
17
src/main.cpp
17
src/main.cpp
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user