Bug: Toggling a Single Boolean Constant from true/false takes 892 Bytes

Hi,

In the supplied code, when using an Arduino Nano, if you change the joystick_enable constant from true to false, the memory footprint changes by 892 bytes, when compiling.

25818 - 26710 = 892 bytes or 3% of an Arduino nano, for a single constant change?

Please consider fixing this.

Thanks,
Brenda

RDL_170.ino.ino (58.9 KB)

Please take the time to look at what setting joystick_enable to true actually does. There is a huge block of code following the if statement at line 1452 that will never be run if joystick_enable is false so the compiler optimizes that all away. If you comment all that code you'll see those 892 bytes go away. This isn't a bug.

Please consider marking this thread "[SOLVED]"

Groove: Please consider marking this thread "[SOLVED]"

Or "User error".