feat(colorlcd): Special Function to set main screen (#2160)

* Special Function to set main screen (#2135)

* chore: Add new SF to LUA constants list

* Companion support

* Formatting

* get rid of magic number

* Add function to get the number of custom screens

* Change screen numbering from 0-based to 1-based.

* Allow SetScreen custom function for Color LCD only

* add range protection

* cleanup

* yet, range protection once again

* fix: paintSpecialFunctionLine can't alter SF param data

* Fix screen initialization in companion

* move screen switching to the UI

* Trigger view change from guiMain()

* chore: Change "SET" to "Set" for consistency

* fix: Somehow missed extra comma in `TW`

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: elecpower <neilh713@tpg.com.au>
Co-authored-by: Raphael Coeffic <raphael.coeffic@frafos.com>
This commit is contained in:
eshifri
2022-09-07 21:40:34 +10:00
committed by GitHub
co-authored by Peter Feerick elecpower Raphael Coeffic
parent b0c1315f61
commit 4e49ac68be
34 changed files with 215 additions and 74 deletions
@@ -1298,6 +1298,9 @@ static void r_customFn(void* user, uint8_t* data, uint32_t bitoffs,
}
break;
#if defined(COLORLCD)
case FUNC_SET_SCREEN:
#endif
case FUNC_HAPTIC:
case FUNC_LOGS: // 10th of seconds
CFN_PARAM(cfn) = yaml_str2uint(val, l_sep);
@@ -1472,6 +1475,9 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
if (!wf(opaque, str, strlen(str))) return false;
break;
#if defined(COLORLCD)
case FUNC_SET_SCREEN:
#endif
case FUNC_HAPTIC:
case FUNC_LOGS: // 10th of seconds
str = yaml_unsigned2str(CFN_PARAM(cfn));