Add support for pwr-on and power-off speed
This commit is contained in:
@@ -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