![]() |
RUI3 (RAK Unified Interface 3) - RAK4631
|
Functions | |
bool | create (char *name, RAK_TASK_HANDLER handler) |
bool | destroy (char *name) |
bool create | ( | char * | name, |
RAK_TASK_HANDLER | handler | ||
) |
name | task name |
handler | the handler function for this task |
TRUE | for creating task successfully |
FALSE | for creating task failure |
void handler(void *data) { Serial.printf("[%lu]This is the handler\r\n", millis()); delay(60000); } void setup() { Serial.begin(115200); if (api.system.scheduler.task.create("task1", (RAK_TASK_HANDLER)handler) != true) { Serial.printf("Creating new task failed.\r\n"); } } void loop() { }
bool destroy | ( | char * | name | ) |
name | task name (if not specified, current thread is destroyed) |
TRUE | for destroying task successfully |
FALSE | for destroying task failure |
void handler(void *data) { Serial.printf("[%lu]This is the handler\r\n", millis()); delay(60000); } void setup() { Serial.begin(115200); if (api.system.scheduler.task.create("task1", (RAK_TASK_HANDLER)handler) != true) { Serial.printf("Creating new task failed.\r\n"); } } void loop() { if (millis() > 60000) { if (api.system.scheduler.task.destroy("task1") != true) { Serial.printf("Destroying existing task failed.\r\n"); } } }