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

esp_yield() and esp_schedule() #11

Open
adynis opened this issue Mar 14, 2020 · 4 comments
Open

esp_yield() and esp_schedule() #11

adynis opened this issue Mar 14, 2020 · 4 comments

Comments

@adynis
Copy link

adynis commented Mar 14, 2020

Until now, these functions existed in the code but were not used, because:

// Let's go!
if (ping_start(&_options)) {
    return true;
    // Suspend till the process end
    esp_yield();
}
return (_success > 0);

ping_start(....) is immediately returning, so if true, then it returns before running esp_yield() and if false, then esp_yield() is not triggered.

and

esp_schedule() was in the callback function which (as mentioned in issue #6 ) was never called.

Since we have issues: #6, #8 , #9 , how should : esp_yield() and esp_schedule() be treated ?

PS. I have no proposal here, since I am not familiar with these 2. I'm not sure about their functionality.

@adynis
Copy link
Author

adynis commented Apr 19, 2020

Now I've just seen that the 2 functions are actually empty .... I thought that they are something official ... 🙄
Was there any intention with these ?
Should these be removed/commented out ?

@marian-craciunescu
Copy link
Owner

marian-craciunescu commented Apr 20, 2020

esp_yield should help returning immeditally from the current function/ISR
in order to continue the execution of the other task ion the processors.it's wront I think with the order. Should be yield and then return

@marian-craciunescu
Copy link
Owner

esp_yield() is "switch from sketch context to scheduler context".
esp_schedule() is "make scheduler resume the sketch at next opportunity"

@adynis
Copy link
Author

adynis commented Apr 20, 2020

I'm not familiar with these functions.
But I observed also this in the code:

ESP32Ping/ESP32Ping.cpp

Lines 22 to 23 in 8aab829

extern "C" void esp_schedule(void) {};
extern "C" void esp_yield(void) {};

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