Skip to content

using schedule_function() within scheduled function prevents loop from running #6764

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

Closed
hreintke opened this issue Nov 13, 2019 · 1 comment · Fixed by #6770
Closed

using schedule_function() within scheduled function prevents loop from running #6764

hreintke opened this issue Nov 13, 2019 · 1 comment · Fixed by #6770
Milestone

Comments

@hreintke
Copy link
Contributor

Platform

  • Hardware: Wemos D1
  • Core Version: Latest git
  • Development Env: Sloeber ide
  • Operating System: Windows

Problem Description

When using schedule_function() within a scheduled function, the run_scheduled_functions() will never return,
This has been working before, I do not know yet which of the scheduled functions PR removed the functionality.

MCVE Sketch

#include "Arduino.h"
#include "Schedule.h"

void cp()
{
	static int c = 0;
	if ((c++ % 10000) == 0 ) Serial.printf(".");
	schedule_function(cp);
}

void setup()
{
	Serial.begin(115200);
	schedule_function(cp);
}

void loop()
{
	static int l = 0;
	if ((l++ % 10000) == 0 ) Serial.printf(":");
}
@d-a-v d-a-v added this to the 2.6.1 milestone Nov 13, 2019
@d-a-v
Copy link
Collaborator

d-a-v commented Nov 13, 2019

@dok-net I haven't checked yet, maybe you already have an idea.

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