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

MKR1000 compatibility issue #41

Closed
mlavrador opened this issue Feb 21, 2018 · 7 comments
Closed

MKR1000 compatibility issue #41

mlavrador opened this issue Feb 21, 2018 · 7 comments

Comments

@mlavrador
Copy link

mlavrador commented Feb 21, 2018

I think I found a compatibility issue between the PulseSensorPlayground library and the MKR1000. Different from the NANO, where the last version of PulseSensorPlayground (1.4.4) works perfectly with all provided examples, with MKR1000 I cannot compile examples whenever using PulseSensorPlayground versions above 1.2.3.
Please see the error below, when trying to compile "PullseSensor_BPM_Alternative" with 1.4.4:


C:\Users\marce\OneDrive\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp: In member function 'int PulseSensorPlayground::getPulseAmplitude(int)':

C:\Users\marce\OneDrive\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp:213:5: error: return-statement with no value, in function returning 'int' [-fpermissive]

 return; // out of range.

 ^

C:\Users\marce\OneDrive\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp: In member function 'long unsigned int PulseSensorPlayground::getLastBeatTime(int)':

C:\Users\marce\OneDrive\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp:220:5: error: return-statement with no value, in function returning 'long unsigned int' [-fpermissive]

 return; // out of range.

 ^

exit status 1
Error compiling for board Arduino/Genuino MKR1000.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@bneedhamia
Copy link
Member

Good catch! The two errors are because there are return; statements that instead must return something. One solution would be to change those two return statements to return(-1); and document that those functions return -1 for sensor numbers out of range.

@biomurph
Copy link
Contributor

@mlavrador @bneedhamia
Yep, I have a library update that will release and return a -1 in these cases.
Thanks for always making it better!!

@biomurph
Copy link
Contributor

Aaaaand done.
New release 1.4.5 fixes this bug.... methinks

@mlavrador
Copy link
Author

Almost there..
After updating to 1.4.5, I have an error with the "-1". Please see below.


:\Users\marce\OneDrive\Documents\Arduino\libraries\PulseSensorPlayground\src\PulseSensorPlayground.cpp: In member function 'void PulseSensorPlayground::setThreshold(int, int)':

C:\Users\marce\OneDrive\Documents\Arduino\libraries\PulseSensorPlayground\src\PulseSensorPlayground.cpp:194:13: error: return-statement with a value, in function returning 'void' [-fpermissive]

 return -1; // out of range.

         ^

exit status 1
Error compiling for board Arduino/Genuino MKR1000.

@biomurph
Copy link
Contributor

Oh, holy crow. I over corrected!

@biomurph
Copy link
Contributor

Ok re released the release of the release.

sigh

That's what happens when you get sculptors managing code bases!

@mlavrador
Copy link
Author

Now works great!!! Thank you very much!

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

3 participants