30 lines
601 B
C++
30 lines
601 B
C++
#include <Arduino.h>
|
|
#include "config.h"
|
|
#include "motor.h"
|
|
#include "mqtt_handler.h"
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
|
|
// Инициализация мотора (Core 1 context initially)
|
|
motorInit();
|
|
|
|
// Запуск задачи MQTT на Core 0
|
|
xTaskCreatePinnedToCore(
|
|
mqttTask,
|
|
"MQTT_Task",
|
|
8192,
|
|
NULL,
|
|
3,
|
|
NULL,
|
|
0 // CORE 0
|
|
);
|
|
|
|
Serial.println("System Initialized. Multi-core ready.");
|
|
}
|
|
|
|
void loop() {
|
|
// Loop выполняется на Core 1
|
|
motorLoop();
|
|
vTaskDelay(pdMS_TO_TICKS(5));
|
|
} |