1
0
Fork 0
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:
jflyper 2016-11-01 01:31:09 +09:00
parent e8a22fa60e
commit b42de4f2a4
3 changed files with 15 additions and 14 deletions

View file

@ -444,7 +444,7 @@ OSD_Entry menuRateExpo[];
void cmsx_RateExpoRead(void); void cmsx_RateExpoRead(void);
void cmsx_RateExpoWriteback(void); void cmsx_RateExpoWriteback(void);
void cmsMenuChange(displayPort_t *pDisplay, void *ptr) long cmsMenuChange(displayPort_t *pDisplay, void *ptr)
{ {
if (ptr) { if (ptr) {
// XXX (jflyper): This can be avoided by adding pre- and post- // XXX (jflyper): This can be avoided by adding pre- and post-
@ -466,9 +466,11 @@ void cmsMenuChange(displayPort_t *pDisplay, void *ptr)
cmsScreenClear(pDisplay); cmsScreenClear(pDisplay);
cmsUpdateMaxRows(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 // becasue pids and rates may be stored in profiles we need some thicks to manipulate it
// hack to save pid profile // hack to save pid profile
@ -488,6 +490,8 @@ void cmsMenuBack(displayPort_t *pDisplay)
cmsUpdateMaxRows(pDisplay); cmsUpdateMaxRows(pDisplay);
} }
return 0;
} }
// XXX This should go to device // XXX This should go to device
@ -529,7 +533,7 @@ void cmsMenuOpen(void)
cmsMenuChange(&currentDisplay, currentMenu); cmsMenuChange(&currentDisplay, currentMenu);
} }
void cmsMenuExit(displayPort_t *pDisplay, void *ptr) long cmsMenuExit(displayPort_t *pDisplay, void *ptr)
{ {
if (ptr) { if (ptr) {
cmsScreenClear(pDisplay); cmsScreenClear(pDisplay);
@ -554,6 +558,8 @@ void cmsMenuExit(displayPort_t *pDisplay, void *ptr)
systemReset(); systemReset();
ENABLE_ARMING_FLAG(OK_TO_ARM); ENABLE_ARMING_FLAG(OK_TO_ARM);
return 0;
} }
uint16_t cmsHandleKey(displayPort_t *pDisplay, uint8_t key) uint16_t cmsHandleKey(displayPort_t *pDisplay, uint8_t key)
@ -1125,7 +1131,7 @@ static void getLedColor(void)
} }
//udate all leds with flag color //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(ptr);
UNUSED(pDisplay); // Arrgh UNUSED(pDisplay); // Arrgh
@ -1135,6 +1141,8 @@ static void applyLedColor(displayPort_t *pDisplay, void *ptr)
if (ledGetFunction(ledConfig) == LED_FUNCTION_COLOR) if (ledGetFunction(ledConfig) == LED_FUNCTION_COLOR)
*ledConfig = DEFINE_LED(ledGetX(ledConfig), ledGetY(ledConfig), ledColor, ledGetDirection(ledConfig), ledGetFunction(ledConfig), ledGetOverlay(ledConfig), 0); *ledConfig = DEFINE_LED(ledGetX(ledConfig), ledGetY(ledConfig), ledColor, ledGetDirection(ledConfig), ledGetFunction(ledConfig), ledGetOverlay(ledConfig), 0);
} }
return 0;
} }
static uint8_t featureLedstrip; static uint8_t featureLedstrip;

View file

@ -29,17 +29,10 @@ bool cmsDeviceRegister(cmsDeviceInitFuncPtr);
void cmsInit(void); void cmsInit(void);
void cmsHandler(uint32_t); void cmsHandler(uint32_t);
#if 0
void cmsOpenMenu();
void cmsUpdate(uint32_t);
void cmsScreenResync(displayPort_t *);
#endif
// Required for external CMS tables // Required for external CMS tables
void cmsChangeScreen(displayPort_t *, void *); long cmsChangeScreen(displayPort_t *, void *);
void cmsExitMenu(displayPort_t *, void *); long cmsExitMenu(displayPort_t *, void *);
#define STARTUP_HELP_TEXT1 "MENU: THR MID" #define STARTUP_HELP_TEXT1 "MENU: THR MID"
#define STARTUP_HELP_TEXT2 "+ YAW LEFT" #define STARTUP_HELP_TEXT2 "+ YAW LEFT"

View file

@ -5,7 +5,7 @@
#pragma once #pragma once
typedef void (*OSDMenuFuncPtr)(displayPort_t *, void *); typedef long (*OSDMenuFuncPtr)(displayPort_t *, void *);
//type of elements //type of elements
typedef enum typedef enum