|
|
|
|
|
|
|
|
#include "user_interface.h" |
|
|
#include "user_interface.h" |
|
|
} |
|
|
} |
|
|
// OTA & WEB |
|
|
// OTA & WEB |
|
|
#include "wifi_credentials.h" |
|
|
|
|
|
#include "ota.h" |
|
|
|
|
|
#include "httpserver.h" |
|
|
#include "httpserver.h" |
|
|
|
|
|
#include "ota.h" |
|
|
|
|
|
#include "wifi_credentials.h" |
|
|
|
|
|
|
|
|
// BOARD |
|
|
// BOARD |
|
|
#define ESP12_LED 2 |
|
|
#define ESP12_LED 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t _t=0; |
|
|
uint32_t _t=0; |
|
|
#define SP_US(_str,_a) Serial.print(_str); Serial.print(" took: "); Serial.print(_a); Serial.println("us") |
|
|
#define SP_US(_str,_a) Serial.print(_str); Serial.print(" took: "); Serial.print(_a); Serial.println("us") |
|
|
#define TIMEIF_US(_f, _l, _str) _t=micros(); _f; _t=micros()-_t; if(_t > _l) { SP_US(_str, _t); } |
|
|
|
|
|
|
|
|
#define TIMEIF_US(_f, _l, _str) _t=micros(); _f; _t=micros()-_t; if(_t > (_l)) { SP_US(_str, _t); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void timerCallback(void *pArg) |
|
|
void timerCallback(void *pArg) |
|
|
{ |
|
|
{ |
|
|
*((int *) pArg) += 1; |
|
|
|
|
|
|
|
|
*(static_cast<int *>(pArg)) += 1; |
|
|
stairs.task(); |
|
|
stairs.task(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t c = 0; |
|
|
uint32_t c = 0; |
|
|
|
|
|
|
|
|
void loop() { |
|
|
void loop() { |
|
|
if(inter){ |
|
|
|
|
|
|
|
|
if(inter != 0u){ |
|
|
Serial.printf("interrupt\n"); |
|
|
Serial.printf("interrupt\n"); |
|
|
inter = 0; |
|
|
inter = 0; |
|
|
} |
|
|
} |
|
|
if(c++%1000000 == 0) |
|
|
|
|
|
|
|
|
if(c++%1000000 == 0) { { { |
|
|
httpServer.logt("[%d] starting :)\n", c); |
|
|
httpServer.logt("[%d] starting :)\n", c); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
TIMEIF_US(ArduinoOTA.handle(), 10000, "OTA"); |
|
|
TIMEIF_US(ArduinoOTA.handle(), 10000, "OTA"); |
|
|
TIMEIF_US(httpServer.handleClient(), 10000, "HTTP"); |
|
|
TIMEIF_US(httpServer.handleClient(), 10000, "HTTP"); |