2016-10-06 13:21:30 +02:00
|
|
|
#include "freertos/FreeRTOS.h"
|
|
|
|
#include "freertos/task.h"
|
|
|
|
|
|
|
|
void initVariant() __attribute__((weak));
|
|
|
|
void initVariant() {}
|
|
|
|
|
|
|
|
void init() __attribute__((weak));
|
|
|
|
void init() {}
|
|
|
|
|
2016-10-06 17:16:00 +02:00
|
|
|
void startWiFi() __attribute__((weak));
|
|
|
|
void startWiFi() {}
|
|
|
|
|
|
|
|
void initWiFi() __attribute__((weak));
|
|
|
|
void initWiFi() {}
|
2016-10-06 13:21:30 +02:00
|
|
|
|
|
|
|
extern void loop();
|
|
|
|
extern void setup();
|
|
|
|
|
|
|
|
void loopTask(void *pvParameters)
|
|
|
|
{
|
|
|
|
bool setup_done = false;
|
|
|
|
for(;;) {
|
|
|
|
if(!setup_done) {
|
2016-10-06 17:16:00 +02:00
|
|
|
startWiFi();
|
2016-10-06 13:21:30 +02:00
|
|
|
setup();
|
|
|
|
setup_done = true;
|
|
|
|
}
|
|
|
|
loop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void app_main()
|
|
|
|
{
|
|
|
|
init();
|
|
|
|
initVariant();
|
2016-10-06 17:16:00 +02:00
|
|
|
initWiFi();
|
|
|
|
xTaskCreatePinnedToCore(loopTask, "loopTask", 4096, NULL, 1, NULL, 1);
|
2016-10-06 13:21:30 +02:00
|
|
|
}
|
|
|
|
|