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

Bug: Integer value passed to a byte parameter #4

Open
allthepies opened this issue Dec 9, 2015 · 2 comments
Open

Bug: Integer value passed to a byte parameter #4

allthepies opened this issue Dec 9, 2015 · 2 comments

Comments

@allthepies
Copy link

Hi Guys,

I believe I've found a bug in the Open-ArdBir.ino file.

Line 1280: Set((stageTime), 1440, 15, 15, Timer, Verso);

This invokes the following overloaded function from Funzioni.h:

byte Set(byte& Set, byte Up, byte Low, byte Step, long Timer, byte Verso)

Parameter 2 (byte Up) is being passed an integer value 1440 which causes a compilation warning (if warnings are enabled at compile time) and runtime truncation of the value passed.

I don't know how/if this manifests itself while running, it's just something I noticed while compiling the code with warnings enabled.

@kenmcc
Copy link

kenmcc commented Jan 22, 2016

I noticed something similar when playing with the settings - the delayed start can only be set to circa 2 hours 15 or something, as it is truncated to byte. I changed the type of this to an int and it can then do 12 hours delay correctly.

But as you point out there is discrepancy in the overloading, which needs to be lined up.

@tico-tico
Copy link

They have changed many things in v2.8.3rc8 and int for stageTime is among them. I have no idea why they didn't update the rep.

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