Add support for pwr-on and power-off speed
This commit is contained in:
@@ -87,6 +87,8 @@ enum {
|
||||
CASE_PWM_BACKLIGHT(ITEM_RADIO_SETUP_BACKLIGHT_BRIGHTNESS_ON)
|
||||
ITEM_RADIO_SETUP_FLASH_BEEP,
|
||||
CASE_SPLASH_PARAM(ITEM_RADIO_SETUP_DISABLE_SPLASH)
|
||||
CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_ON_SPEED)
|
||||
CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_OFF_SPEED)
|
||||
CASE_PXX2(ITEM_RADIO_SETUP_OWNER_ID)
|
||||
CASE_GPS(ITEM_RADIO_SETUP_TIMEZONE)
|
||||
ITEM_RADIO_SETUP_ADJUST_RTC,
|
||||
@@ -155,7 +157,8 @@ void menuRadioSetup(event_t event)
|
||||
CASE_PWM_BACKLIGHT(0)
|
||||
0,
|
||||
CASE_SPLASH_PARAM(0)
|
||||
|
||||
CASE_PWR_BUTTON_PRESS(0)
|
||||
CASE_PWR_BUTTON_PRESS(0)
|
||||
CASE_PXX2(0) /* owner registration ID */
|
||||
|
||||
CASE_GPS(0)
|
||||
@@ -506,6 +509,20 @@ void menuRadioSetup(event_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PWR_BUTTON_PRESS)
|
||||
case ITEM_RADIO_SETUP_PWR_ON_SPEED:
|
||||
lcdDrawTextAlignedLeft(y, STR_PWR_ON_SPEED);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.pwrOnSpeed, attr|LEFT);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.pwrOnSpeed, 0, 3);
|
||||
break;
|
||||
|
||||
case ITEM_RADIO_SETUP_PWR_OFF_SPEED:
|
||||
lcdDrawTextAlignedLeft(y, STR_PWR_OFF_SPEED);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.pwrOffSpeed, attr|LEFT);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.pwrOffSpeed, 0, 3);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
case ITEM_RADIO_SETUP_OWNER_ID:
|
||||
editSingleName(RADIO_SETUP_2ND_COLUMN, y, STR_OWNER_ID, g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID, event, attr);
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
#define PWR_PRESS_DURATION_MIN 100 // 1s
|
||||
#define PWR_PRESS_DURATION_MAX 500 // 5s
|
||||
|
||||
#define SLEEP_BITMAP_WIDTH 60
|
||||
#define SLEEP_BITMAP_HEIGHT 60
|
||||
@@ -30,9 +28,11 @@ const unsigned char bmp_sleep[] = {
|
||||
#include "sleep.lbm"
|
||||
};
|
||||
|
||||
void drawStartupAnimation(uint32_t duration)
|
||||
void drawStartupAnimation(uint32_t duration, uint32_t total_duration)
|
||||
{
|
||||
uint8_t index = limit<uint8_t>(0, duration / (PWR_PRESS_DURATION_MIN / 5), 4);
|
||||
if (total_duration == 0) return;
|
||||
|
||||
uint8_t index = limit<uint8_t>(0, duration / (total_duration / 5), 4);
|
||||
|
||||
lcdRefreshWait();
|
||||
lcdClear();
|
||||
@@ -47,9 +47,11 @@ void drawStartupAnimation(uint32_t duration)
|
||||
lcdRefreshWait();
|
||||
}
|
||||
|
||||
void drawShutdownAnimation(uint32_t duration, const char * message)
|
||||
void drawShutdownAnimation(uint32_t duration, uint32_t total_duration, const char * message)
|
||||
{
|
||||
uint8_t index = limit<uint8_t>(0, duration / (PWR_PRESS_SHUTDOWN_DELAY / 5), 4);
|
||||
if (total_duration == 0) return;
|
||||
|
||||
uint8_t index = limit<uint8_t>(0, duration / (total_duration / 5), 4);
|
||||
|
||||
lcdRefreshWait();
|
||||
lcdClear();
|
||||
|
||||
Reference in New Issue
Block a user