feat: Fatfish F16 support (main) (#4485)

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
richardclli
2024-06-30 11:55:35 +10:00
committed by GitHub
co-authored by Peter Feerick
parent d8d6f671c2
commit 961c75784e
73 changed files with 628 additions and 46 deletions
+21
View File
@@ -27,6 +27,13 @@
void setRequestedMainView(uint8_t view);
#endif
#if defined(VIDEO_SWITCH)
#include "videoswitch_driver.h"
#if defined(SIMU)
void switchToRadio() {};
void switchToVideo() {};
#endif
#endif
CustomFunctionsContext modelFunctionsContext = { 0 };
CustomFunctionsContext globalFunctionsContext = { 0 };
@@ -150,6 +157,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
}
#endif
bool videoEnabled = false;
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
const CustomFunctionData * cfn = &functions[i];
swsrc_t swtch = CFN_SWITCH(cfn);
@@ -436,6 +444,12 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
}
break;
#endif
#if defined(VIDEO_SWITCH)
case FUNC_LCD_TO_VIDEO:
switchToVideo();
videoEnabled = true;
break;
#endif
#if defined(DEBUG)
case FUNC_TEST:
testFunc();
@@ -465,6 +479,11 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
}
}
#if defined(VIDEO_SWITCH)
if (!videoEnabled)
switchToRadio();
#endif
functionsContext.activeSwitches = newActiveSwitches;
functionsContext.activeFunctions = newActiveFunctions;
}
@@ -544,6 +563,8 @@ const char* funcGetLabel(uint8_t func)
#endif
case FUNC_RGB_LED:
return STR_SF_RGBLEDS;
case FUNC_LCD_TO_VIDEO:
return STR_SF_LCD_TO_VIDEO;
#if defined(DEBUG)
case FUNC_TEST:
return STR_SF_TEST;