mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Provision OSDMenuFuncPtr to return long
This commit is contained in:
parent
e8a22fa60e
commit
b42de4f2a4
3 changed files with 15 additions and 14 deletions
|
@ -444,7 +444,7 @@ OSD_Entry menuRateExpo[];
|
|||
void cmsx_RateExpoRead(void);
|
||||
void cmsx_RateExpoWriteback(void);
|
||||
|
||||
void cmsMenuChange(displayPort_t *pDisplay, void *ptr)
|
||||
long cmsMenuChange(displayPort_t *pDisplay, void *ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
// XXX (jflyper): This can be avoided by adding pre- and post-
|
||||
|
@ -466,9 +466,11 @@ void cmsMenuChange(displayPort_t *pDisplay, void *ptr)
|
|||
cmsScreenClear(pDisplay);
|
||||
cmsUpdateMaxRows(pDisplay);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cmsMenuBack(displayPort_t *pDisplay)
|
||||
long cmsMenuBack(displayPort_t *pDisplay)
|
||||
{
|
||||
// becasue pids and rates may be stored in profiles we need some thicks to manipulate it
|
||||
// hack to save pid profile
|
||||
|
@ -488,6 +490,8 @@ void cmsMenuBack(displayPort_t *pDisplay)
|
|||
|
||||
cmsUpdateMaxRows(pDisplay);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// XXX This should go to device
|
||||
|
@ -529,7 +533,7 @@ void cmsMenuOpen(void)
|
|||
cmsMenuChange(¤tDisplay, currentMenu);
|
||||
}
|
||||
|
||||
void cmsMenuExit(displayPort_t *pDisplay, void *ptr)
|
||||
long cmsMenuExit(displayPort_t *pDisplay, void *ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
cmsScreenClear(pDisplay);
|
||||
|
@ -554,6 +558,8 @@ void cmsMenuExit(displayPort_t *pDisplay, void *ptr)
|
|||
systemReset();
|
||||
|
||||
ENABLE_ARMING_FLAG(OK_TO_ARM);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t cmsHandleKey(displayPort_t *pDisplay, uint8_t key)
|
||||
|
@ -1125,7 +1131,7 @@ static void getLedColor(void)
|
|||
}
|
||||
|
||||
//udate all leds with flag color
|
||||
static void applyLedColor(displayPort_t *pDisplay, void *ptr)
|
||||
static long applyLedColor(displayPort_t *pDisplay, void *ptr)
|
||||
{
|
||||
UNUSED(ptr);
|
||||
UNUSED(pDisplay); // Arrgh
|
||||
|
@ -1135,6 +1141,8 @@ static void applyLedColor(displayPort_t *pDisplay, void *ptr)
|
|||
if (ledGetFunction(ledConfig) == LED_FUNCTION_COLOR)
|
||||
*ledConfig = DEFINE_LED(ledGetX(ledConfig), ledGetY(ledConfig), ledColor, ledGetDirection(ledConfig), ledGetFunction(ledConfig), ledGetOverlay(ledConfig), 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t featureLedstrip;
|
||||
|
|
|
@ -29,17 +29,10 @@ bool cmsDeviceRegister(cmsDeviceInitFuncPtr);
|
|||
void cmsInit(void);
|
||||
void cmsHandler(uint32_t);
|
||||
|
||||
|
||||
#if 0
|
||||
void cmsOpenMenu();
|
||||
void cmsUpdate(uint32_t);
|
||||
void cmsScreenResync(displayPort_t *);
|
||||
#endif
|
||||
|
||||
// Required for external CMS tables
|
||||
|
||||
void cmsChangeScreen(displayPort_t *, void *);
|
||||
void cmsExitMenu(displayPort_t *, void *);
|
||||
long cmsChangeScreen(displayPort_t *, void *);
|
||||
long cmsExitMenu(displayPort_t *, void *);
|
||||
|
||||
#define STARTUP_HELP_TEXT1 "MENU: THR MID"
|
||||
#define STARTUP_HELP_TEXT2 "+ YAW LEFT"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
typedef void (*OSDMenuFuncPtr)(displayPort_t *, void *);
|
||||
typedef long (*OSDMenuFuncPtr)(displayPort_t *, void *);
|
||||
|
||||
//type of elements
|
||||
typedef enum
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue