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

A possible way to reduce code size #931

Closed
jimmys01 opened this issue Sep 25, 2019 · 5 comments · Fixed by #946
Closed

A possible way to reduce code size #931

jimmys01 opened this issue Sep 25, 2019 · 5 comments · Fixed by #946
Assignees

Comments

@jimmys01
Copy link
Contributor

jimmys01 commented Sep 25, 2019

Through the code there are multiple uses of the words "Max" "Min" "Auto" "Toggle" "Off" etc.
Perhaps there is a way to make the 30 instances of "OFF" to just occupy 1 * sizeof("OFF") and not 30 * sizeof("OFF")?

@crankyoldgit
Copy link
Owner

There is, and I'll get to it, eventually.

@crankyoldgit
Copy link
Owner

Alas, I expect it won't save a heck of a lot of space, but I'm currently working on a major re-write of the A/C stuff just to save ~1K of space (and to produce safer/cleaner code).

I want to add Internationalisation support too, which will probably happen at the same time.

@crankyoldgit
Copy link
Owner

Just a FYI update. I've started work on this but it will have to wait till #934 is merged to reduce a "merge conflict hell". i.e. This isn't forgotten.

@crankyoldgit
Copy link
Owner

Progress update.

I've completed most of the work for it. I've got a few more cosmetic/practical stuff to do yet which shouldn't affect the resulting binary size etc. The changes save about 1.5k+. Which honestly was more than I was expecting. However, it breaks the use of F() macros on the base strings for some reason. That's probably a small price to pay honestly.

crankyoldgit added a commit that referenced this issue Oct 6, 2019
* Create a framework for doing internationalisation(i18n).
* Centralise strings to `IRtext`. Saves approximately 1.5k+ of prog space.
* Add linter coverage to src/locale.
* Clean up/standardise text in for some A/Cs
* Add `modelToStr()` & `addDayToString()` functions.
* Change `IRrecvDumpV2` behaviour
  o Remove displaying the legacy "Raw Data" dump. Just rely on the `uint16_t rawData[]` output.
  o i18n the text in the example code.
* More string consolidation.
* Remove F() around `IRtext` strings as it causes the compiler to berk whan built under the Arduino platform.
* Use a stardard default for i18n text. (locale/defaults.h)
* Change the language specific header files to be simple overrides of
`defaults.h`
* Enforce `en_AU` as the default in the Unit Test environment.

Fixes #931
crankyoldgit added a commit that referenced this issue Oct 6, 2019
* Create a framework for doing internationalisation(i18n).
* Centralise strings to `IRtext`. Saves approximately 1.5k+ of prog space.
* Add linter coverage to `src/locale`.
* Clean up/standardise text for A/Cs.
* Add `modelToStr()` & `addDayToString()` functions.
* Change `IRrecvDumpV2` behaviour
  * Remove displaying the legacy "Raw Data" dump. Just rely on the `uint16_t rawData[]` output.
  * i18n the text in the example code.
* More string consolidation.
* Remove `F()` around `IRtext` strings as it causes the compiler to berk when built under the Arduino platform.
* Use a standard default for i18n text. (`locale/defaults.h`)
* Change the language specific header files to be simple overrides of
`defaults.h`
* Enforce `en_AU` as the default in the Unit Test environment.

Fixes #931
@crankyoldgit
Copy link
Owner

@jimmys01 FYI, the changes mention above have been included in the v2.7.0 release of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants