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

MAXPULSESTREAMLENGTH limited to 255 #66

Open
toi-go opened this issue Dec 28, 2022 · 0 comments
Open

MAXPULSESTREAMLENGTH limited to 255 #66

toi-go opened this issue Dec 28, 2022 · 0 comments

Comments

@toi-go
Copy link

toi-go commented Dec 28, 2022

There are protocols which require a MAXPULSESTREAMLENGTH bigger than 255 - for example: Tfa2017:
#define MIN_RAW_LENGTH 200 #define MAX_RAW_LENGTH 400

Unfortunately, it is not as easy as simply changing the define in ESPiLight.h:
#define MAXPULSESTREAMLENGTH 512

Because there are several variables/members which have type uint8_t - they overflow if a value bigger than 255 is assigned to them, for example:
ESPiLight::minrawlen
ESPiLight::maxrawlen

protocol_t::minrawlen
protocol_t::maxrawlen

Effectively, prorocols requiring pulsestreams longer than 255 won't ever get pulsestreams longer than 255. They might even never get pulsestreams shorter than 255 as ESPiLight::maxrawlen's calculated value is wrong due to the overflow.

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

1 participant