Skip to content

MAXPULSESTREAMLENGTH limited to 255 #66

@toi-go

Description

@toi-go

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions