Browse Source

format change

tags/v1.0.0
Simon Schmidt 3 years ago
parent
commit
9518c06fd9
1 changed files with 9 additions and 6 deletions
  1. 9
    6
      src/main.cpp

+ 9
- 6
src/main.cpp View File

@@ -9,9 +9,9 @@ extern "C" {
#include "user_interface.h"
}
// OTA & WEB
#include "wifi_credentials.h"
#include "ota.h"
#include "httpserver.h"
#include "ota.h"
#include "wifi_credentials.h"

// BOARD
#define ESP12_LED 2
@@ -32,12 +32,12 @@ HTTPServer httpServer(80, "/", &stairs);

uint32_t _t=0;
#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)
{
*((int *) pArg) += 1;
*(static_cast<int *>(pArg)) += 1;
stairs.task();
}

@@ -92,12 +92,15 @@ void setup() {
uint32_t c = 0;

void loop() {
if(inter){
if(inter != 0u){
Serial.printf("interrupt\n");
inter = 0;
}
if(c++%1000000 == 0)
if(c++%1000000 == 0) { { {
httpServer.logt("[%d] starting :)\n", c);
}
}
}
TIMEIF_US(ArduinoOTA.handle(), 10000, "OTA");
TIMEIF_US(httpServer.handleClient(), 10000, "HTTP");

Loading…
Cancel
Save