Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling yield and delay outside of tasks #33

Closed
Laxilef opened this issue Jun 21, 2022 · 1 comment
Closed

Calling yield and delay outside of tasks #33

Laxilef opened this issue Jun 21, 2022 · 1 comment

Comments

@Laxilef
Copy link
Contributor

Laxilef commented Jun 21, 2022

Hello.
Please add yield and delay methods to SchedulerClass
This will allow you to make changes to other classes that are used inside tasks.
I tested this on one of my projects and it doesn't affect how groups work.

Little changes are needed:

void SchedulerClass::begin() {
  current = current->next = first;
  while (1) {
    updateCurrentTask();

    if (current->shouldRun())
      cont_run(&current->context, task_tramponline);

    updateRunGroups();

    ::yield();

    current = current->next;
  }
}

void SchedulerClass::delay(unsigned long ms) { current->delay(ms); }
void SchedulerClass::yield() { current->yield(); }
@nrwiersma
Copy link
Owner

This should be in the pull request section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants