format change

This commit is contained in:
Simon Schmidt 2021-07-11 01:45:00 +02:00
parent 2820869e14
commit 9518c06fd9

View File

@ -9,9 +9,9 @@ extern "C" {
#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
@ -32,12 +32,12 @@ HTTPServer httpServer(80, "/", &stairs);
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();
} }
@ -92,12 +92,15 @@ void setup() {
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");