Skip to content

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

Closed
@hreintke

Description

@hreintke

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(":");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions