Skip to content

Commit

Permalink
Strings finally in Flash! (crankyoldgit#1623)
Browse files Browse the repository at this point in the history
Finally convince the compiler to store the text strings into flash.

Saves approx 2k of Global ram, for a trade-off of between ~0-0.5k of extra flash space used.

e.g. _(updated)_
* IRMQTTServer example code:
  - Before:
RAM:   [=====     ]  54.1% (used 44344 bytes from 81920 bytes)
Flash: [=====     ]  54.2% (used 566209 bytes from 1044464 bytes)
Bin file size = 570368
  - After:
RAM:   [=====     ]  51.3% (used 41992 bytes from 81920 bytes)
Flash: [=====     ]  54.2% (used 566201 bytes from 1044464 bytes)
Bin file size = 570352

* IRrecvDumpV2 example code:
  - Before:
RAM:   [====      ]  37.9% (used 31044 bytes from 81920 bytes)
Flash: [====      ]  35.6% (used 372025 bytes from 1044464 bytes)
Bin file size = 376176
  - After:
RAM:   [====      ]  35.5% (used 29072 bytes from 81920 bytes)
Flash: [====      ]  35.7% (used 372525 bytes from 1044464 bytes)
Bin file size = 376672

Fixes crankyoldgit#1614
Fixes crankyoldgit#1493

Co-authored with @mcspr
  • Loading branch information
crankyoldgit authored Oct 8, 2021
1 parent 18179fc commit 1beea0c
Show file tree
Hide file tree
Showing 10 changed files with 605 additions and 457 deletions.
47 changes: 45 additions & 2 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ sharp_ac_remote_model_t KEYWORD1
state_t KEYWORD1
swingh_t KEYWORD1
swingv_t KEYWORD1
tcl_ac_remote_model_t KEYWORD1
voltas_ac_remote_model_t KEYWORD1
whirlpool_ac_remote_model_t KEYWORD1

Expand Down Expand Up @@ -193,6 +194,7 @@ decodeAirwell KEYWORD2
decodeAiwaRCT501 KEYWORD2
decodeAmcor KEYWORD2
decodeArgo KEYWORD2
decodeArris KEYWORD2
decodeBose KEYWORD2
decodeCOOLIX KEYWORD2
decodeCarrierAC KEYWORD2
Expand Down Expand Up @@ -298,6 +300,7 @@ enableIROut KEYWORD2
enableOffTimer KEYWORD2
enableOnTimer KEYWORD2
enableSleepTimer KEYWORD2
encodeArris KEYWORD2
encodeDoshisha KEYWORD2
encodeJVC KEYWORD2
encodeLG KEYWORD2
Expand Down Expand Up @@ -481,6 +484,7 @@ isSwingH KEYWORD2
isSwingV KEYWORD2
isSwingVStep KEYWORD2
isSwingVToggle KEYWORD2
isTcl KEYWORD2
isTimeCommand KEYWORD2
isTimerActive KEYWORD2
isTurboToggle KEYWORD2
Expand Down Expand Up @@ -541,6 +545,7 @@ sendAirwell KEYWORD2
sendAiwaRCT501 KEYWORD2
sendAmcor KEYWORD2
sendArgo KEYWORD2
sendArris KEYWORD2
sendBose KEYWORD2
sendCOOLIX KEYWORD2
sendCarrierAC KEYWORD2
Expand Down Expand Up @@ -791,6 +796,7 @@ teco KEYWORD2
ticksHigh KEYWORD2
ticksLow KEYWORD2
toString KEYWORD2
toggleArrisRelease KEYWORD2
toggleRC5 KEYWORD2
toggleRC6 KEYWORD2
toggleSwingHoriz KEYWORD2
Expand Down Expand Up @@ -857,6 +863,7 @@ ARJW2 LITERAL1
ARRAH2E LITERAL1
ARREB1E LITERAL1
ARREW4E LITERAL1
ARRIS LITERAL1
ARRY4 LITERAL1
BOSE LITERAL1
CARRIER_AC LITERAL1
Expand Down Expand Up @@ -891,6 +898,7 @@ DECODE_AIRWELL LITERAL1
DECODE_AIWA_RC_T501 LITERAL1
DECODE_AMCOR LITERAL1
DECODE_ARGO LITERAL1
DECODE_ARRIS LITERAL1
DECODE_BOSE LITERAL1
DECODE_CARRIER_AC LITERAL1
DECODE_CARRIER_AC40 LITERAL1
Expand Down Expand Up @@ -1054,6 +1062,7 @@ GREE_SWING_MIDDLE_DOWN LITERAL1
GREE_SWING_MIDDLE_UP LITERAL1
GREE_SWING_UP LITERAL1
GREE_SWING_UP_AUTO LITERAL1
GZ055BE1 LITERAL1
HAIER_AC LITERAL1
HAIER_AC176 LITERAL1
HAIER_AC_AUTO LITERAL1
Expand Down Expand Up @@ -1213,6 +1222,7 @@ PANASONIC_BITS LITERAL1
PIONEER LITERAL1
PROGMEM LITERAL1
PRONTO LITERAL1
PSTR LITERAL1
RAW LITERAL1
RAWTICK LITERAL1
RC5 LITERAL1
Expand Down Expand Up @@ -1240,6 +1250,7 @@ SEND_AIRWELL LITERAL1
SEND_AIWA_RC_T501 LITERAL1
SEND_AMCOR LITERAL1
SEND_ARGO LITERAL1
SEND_ARRIS LITERAL1
SEND_BOSE LITERAL1
SEND_CARRIER_AC LITERAL1
SEND_CARRIER_AC40 LITERAL1
Expand Down Expand Up @@ -1347,6 +1358,7 @@ SONY_15_BITS LITERAL1
SONY_20_BITS LITERAL1
SONY_38K LITERAL1
SYMPHONY LITERAL1
TAC09CHSD LITERAL1
TCL112AC LITERAL1
TECHNIBEL_AC LITERAL1
TECO LITERAL1
Expand Down Expand Up @@ -1497,6 +1509,16 @@ kArgoOneSpace LITERAL1
kArgoStateLength LITERAL1
kArgoTempDelta LITERAL1
kArgoZeroSpace LITERAL1
kArrisBits LITERAL1
kArrisChecksumSize LITERAL1
kArrisCommandSize LITERAL1
kArrisGapSpace LITERAL1
kArrisHalfClockPeriod LITERAL1
kArrisHdrMark LITERAL1
kArrisHdrSpace LITERAL1
kArrisOverhead LITERAL1
kArrisReleaseBit LITERAL1
kArrisReleaseToggle LITERAL1
kAuto LITERAL1
kAutoStr LITERAL1
kAutomaticStr LITERAL1
Expand Down Expand Up @@ -2008,8 +2030,11 @@ kEyeAutoStr LITERAL1
kEyeStr LITERAL1
kFalseStr LITERAL1
kFan LITERAL1
kFanOnlyNoSpaceStr LITERAL1
kFanOnlyStr LITERAL1
kFanOnlyWithSpaceStr LITERAL1
kFanStr LITERAL1
kFan_OnlyStr LITERAL1
kFastStr LITERAL1
kFilterStr LITERAL1
kFixedStr LITERAL1
Expand Down Expand Up @@ -3326,8 +3351,15 @@ kSharpAcSpecialTimer LITERAL1
kSharpAcSpecialTimerHalfHour LITERAL1
kSharpAcSpecialTurbo LITERAL1
kSharpAcStateLength LITERAL1
kSharpAcSwingNoToggle LITERAL1
kSharpAcSwingToggle LITERAL1
kSharpAcSwingVCoanda LITERAL1
kSharpAcSwingVHigh LITERAL1
kSharpAcSwingVIgnore LITERAL1
kSharpAcSwingVLast LITERAL1
kSharpAcSwingVLow LITERAL1
kSharpAcSwingVLowest LITERAL1
kSharpAcSwingVMid LITERAL1
kSharpAcSwingVOff LITERAL1
kSharpAcSwingVToggle LITERAL1
kSharpAcTimerHoursMax LITERAL1
kSharpAcTimerHoursOff LITERAL1
kSharpAcTimerIncrement LITERAL1
Expand Down Expand Up @@ -3408,6 +3440,9 @@ kTcl112AcFanAuto LITERAL1
kTcl112AcFanHigh LITERAL1
kTcl112AcFanLow LITERAL1
kTcl112AcFanMed LITERAL1
kTcl112AcFanMin LITERAL1
kTcl112AcFanNight LITERAL1
kTcl112AcFanQuiet LITERAL1
kTcl112AcGap LITERAL1
kTcl112AcHdrMark LITERAL1
kTcl112AcHdrMarkTolerance LITERAL1
Expand All @@ -3417,10 +3452,17 @@ kTcl112AcNormal LITERAL1
kTcl112AcOneSpace LITERAL1
kTcl112AcSpecial LITERAL1
kTcl112AcStateLength LITERAL1
kTcl112AcSwingVHigh LITERAL1
kTcl112AcSwingVHighest LITERAL1
kTcl112AcSwingVLow LITERAL1
kTcl112AcSwingVLowest LITERAL1
kTcl112AcSwingVMiddle LITERAL1
kTcl112AcSwingVOff LITERAL1
kTcl112AcSwingVOn LITERAL1
kTcl112AcTempMax LITERAL1
kTcl112AcTempMin LITERAL1
kTcl112AcTimerMax LITERAL1
kTcl112AcTimerResolution LITERAL1
kTcl112AcTolerance LITERAL1
kTcl112AcZeroSpace LITERAL1
kTechnibelAcBitMark LITERAL1
Expand Down Expand Up @@ -3482,6 +3524,7 @@ kTempDownStr LITERAL1
kTempStr LITERAL1
kTempUpStr LITERAL1
kThreeLetterDayOfWeekStr LITERAL1
kTimeSep LITERAL1
kTimeoutMs LITERAL1
kTimerModeStr LITERAL1
kTimerStr LITERAL1
Expand Down
Loading

0 comments on commit 1beea0c

Please sign in to comment.