Loading
Loading
IoT Lab content is currently available in Arabic only. We're working on an English version.
عرض بالعربية →How to run two different functions at exactly the same time.
TaskHandle_t Task1;
void setup() {
xTaskCreatePinnedToCore(
Task1code, "Task1", 10000, NULL, 1, &Task1, 0);
// Task 1 runs on Core 0
}
void Task1code( void * pvParameters ){
for(;;) {
// هذا الكود سيعمل بالتوازي مع دالة loop() العادية
}
}
void loop() {}Using the same variables from both cores simultaneously without using locks (Mutex), causing data conflicts (Race Condition) and system crashes.