diff options
author | Ancyker <[email protected]> | 2024-03-02 11:26:35 -0500 |
---|---|---|
committer | Ancyker <[email protected]> | 2024-03-02 11:26:35 -0500 |
commit | e61ac414d89556c941f0b8ca76e5d7d6684037f0 (patch) | |
tree | e8afd45cf20a11d54ecc85e40b25f842a78509eb /Cart_Reader/NGP.ino | |
parent | 3468703a51846cbb668f1efc020728d85fd9b76b (diff) | |
download | cartreader-e61ac414d89556c941f0b8ca76e5d7d6684037f0.tar.gz cartreader-e61ac414d89556c941f0b8ca76e5d7d6684037f0.zip |
Code optimization, cleanup, and stylization
* Reduced PROGMEM / DRAM usage slightly (Using defaults w/HW5: Before -> 214,668 bytes / 5,757 bytes; After -> 213,414 bytes / 5,751 bytes)
* Optimized some menu options and calls
* Added more string constants and implemented them where found.
* Fixed some stylization
* Constants should always be uppercase.
* Features should use the `ENABLE_<feature name>` format.
* Options for features should use the `OPTION_<feature name>_<option name>` format.
* Added ENUMs for more clarity and better type checking.
* Moved some defines over to `constexpr` and `const` types. These are preferred over preprocessor constants when not intended for use with `#if` and other preprocessor language.
Diffstat (limited to 'Cart_Reader/NGP.ino')
-rw-r--r-- | Cart_Reader/NGP.ino | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Cart_Reader/NGP.ino b/Cart_Reader/NGP.ino index 2c552a9..0a9c323 100644 --- a/Cart_Reader/NGP.ino +++ b/Cart_Reader/NGP.ino @@ -1,13 +1,10 @@ //****************************************** // NGP MODULE //****************************************** -#ifdef enable_NGP +#ifdef ENABLE_NGP -static const char ngpMenuItem1[] PROGMEM = "Read ROM"; static const char ngpMenuItem2[] PROGMEM = "Read chip info"; -static const char ngpMenuItem3[] PROGMEM = "Change ROM size"; -//static const char ngpMenuItemReset[] PROGMEM = "Reset"; (stored in common strings array) -static const char* const menuOptionsNGP[] PROGMEM = { ngpMenuItem1, ngpMenuItem2, ngpMenuItem3, string_reset2 }; +static const char* const menuOptionsNGP[] PROGMEM = { FSTRING_READ_ROM, ngpMenuItem2, FSTRING_SET_SIZE, FSTRING_RESET }; static const char ngpRomItem1[] PROGMEM = "4 Mbits / 512 KB"; static const char ngpRomItem2[] PROGMEM = "8 Mbits / 1 MB"; @@ -80,7 +77,7 @@ void ngpMenu() { break; } - println_Msg(F("")); + println_Msg(FS(FSTRING_EMPTY)); // Prints string out of the common strings array either with or without newline print_STR(press_button_STR, 1); display_Update(); |