PaulStoffregen / DmxSimple

99 stars 21 forks source link

RAMEND not defined for some Teensy's, limits DMXSimple to 128 channels #28

Open gwideman opened 2 years ago

gwideman commented 2 years ago

Description

RAMEND defined constant is not defined for at least some Teensy models (for example 3.2) yet the DMXSimple depends on it. When it's undefined, DMXSimple is limited to 128 DMX channels.

Describe your problem.

DMXSimple.h:

#if RAMEND <= 0x4FF
#define DMX_SIZE 128
#else
#define DMX_SIZE 512
#endif

When RAMEND is undefined, the C preprocessor treats it as zero. So for MCUs that don't define RAMEND, DMXSimple limits output to 128 channels.

Steps To Reproduce Problem

  1. Compile the SerialToDMX example for Teensy 3.2
  2. Run the code
  3. Attempt to set values for and send to DMX addresses above 128. The recipients above 128 don't receive data, don't update their brightness.

Hardware & Software

Board Teensy 3 Shields / modules used: Some level translator for RS485 in order to communicate with a lighting fixture. Arduino IDE version 1.8.19 Teensyduino version (if using Teensy): 2022-06-18 Version info & package name (from Tools > Boards > Board Manager) ??? Operating system & version Windows 10 recent Any other software or hardware?

Arduino Sketch

SerialToDMX example.

Errors or Incorrect Output

DMX output doesn't work above channel 128