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

[Feature Request] Allow E2END to be set as compile time option #776

Open
noisymime opened this issue Feb 5, 2025 · 0 comments
Open

[Feature Request] Allow E2END to be set as compile time option #776

noisymime opened this issue Feb 5, 2025 · 0 comments

Comments

@noisymime
Copy link

Currently the only way to adjust the available EEPROM size is to directly edit the core eeprom.h file directly. This makes sharing code that needs to adjust this difficult as it requires people manually changing their library files as well as needing to keep the modification when updated versions of Teensyduino are released.

Being able to adjust this as a compile option and make this configurable at a project level would make it MUCH easier to achieve this.

The change required to allow this is fairly trivial. Within the avr/eeprom.h file for any given core, the existing #defines for E2END simply need to be wrapped within an #ifndef block. Eg for Teensy 4:

#ifndef E2END
    #if defined(ARDUINO_TEENSY40)
        #define E2END 0x437
    #elif defined(ARDUINO_TEENSY41)
        #define E2END 0x10BB
    #elif defined(ARDUINO_TEENSY_MICROMOD)
        #define E2END 0x10BB
    #endif
#endif

The E2END value can then be set at compile time with something like -DE2END=0x2176 as a build flag.

I have tested the above on Teensy 4 and it works perfectly and is considerably simpler than having to get people to modify the core files directly.

Is this something that would ever be considered for inclusion?

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