mirror of
https://github.com/opentx/opentx.git
synced 2025-07-19 14:25:11 +03:00
Bsongis/horus flash external device (#4446)
* CMake options changed to UNEXPECTED_SHUTDOWN=YES/NO and PWR_BUTTON=PRESS/SWITCH * [X12S / X10] Flash an external device is now OK
This commit is contained in:
parent
808d7749c7
commit
b9bb831b7f
25 changed files with 107 additions and 158 deletions
|
@ -446,8 +446,7 @@ void drawStick(coord_t centrex, int16_t xval, int16_t yval);
|
||||||
void drawPotsBars();
|
void drawPotsBars();
|
||||||
void doMainScreenGraphics();
|
void doMainScreenGraphics();
|
||||||
|
|
||||||
void drawProgressBar(const char * label);
|
void drawProgressBar(const char * label, int num, int den);
|
||||||
void updateProgressBar(int num, int den);
|
|
||||||
void drawSleepBitmap();
|
void drawSleepBitmap();
|
||||||
|
|
||||||
#if !defined(CPUM64)
|
#if !defined(CPUM64)
|
||||||
|
|
|
@ -1583,7 +1583,7 @@ void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlag
|
||||||
void drawShutdownAnimation(uint32_t index)
|
void drawShutdownAnimation(uint32_t index)
|
||||||
{
|
{
|
||||||
lcdClear();
|
lcdClear();
|
||||||
int quarter = index / (PWR_PRESS_SHUTDOWN / 5);
|
int quarter = index / (PWR_PRESS_SHUTDOWN_DELAY / 5);
|
||||||
for (int i=1; i<=4; i++) {
|
for (int i=1; i<=4; i++) {
|
||||||
if (quarter >= i) {
|
if (quarter >= i) {
|
||||||
lcdDrawFilledRect(LCD_W / 2 - 28 + 10 * i, LCD_H / 2 - 3, 6, 6, SOLID, 0);
|
lcdDrawFilledRect(LCD_W / 2 - 28 + 10 * i, LCD_H / 2 - 3, 6, 6, SOLID, 0);
|
||||||
|
|
|
@ -232,22 +232,20 @@ void drawStatusLine()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void drawProgressBar(const char * label)
|
void drawProgressBar(const char * label, int num, int den)
|
||||||
{
|
{
|
||||||
lcdDrawTextAlignedLeft(4*FH, label);
|
lcdClear();
|
||||||
|
if (label) {
|
||||||
|
lcdDrawTextAlignedLeft(4*FH, label);
|
||||||
|
}
|
||||||
lcdDrawRect(4, 6*FH+4, LCD_W-8, 7);
|
lcdDrawRect(4, 6*FH+4, LCD_W-8, 7);
|
||||||
lcdRefresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateProgressBar(int num, int den)
|
|
||||||
{
|
|
||||||
if (num > 0 && den > 0) {
|
if (num > 0 && den > 0) {
|
||||||
int width = ((LCD_W-12)*num)/den;
|
int width = ((LCD_W-12)*num)/den;
|
||||||
lcdDrawSolidHorizontalLine(6, 6*FH+6, width, FORCE);
|
lcdDrawSolidHorizontalLine(6, 6*FH+6, width, FORCE);
|
||||||
lcdDrawSolidHorizontalLine(6, 6*FH+7, width, FORCE);
|
lcdDrawSolidHorizontalLine(6, 6*FH+7, width, FORCE);
|
||||||
lcdDrawSolidHorizontalLine(6, 6*FH+8, width, FORCE);
|
lcdDrawSolidHorizontalLine(6, 6*FH+8, width, FORCE);
|
||||||
lcdRefresh();
|
|
||||||
}
|
}
|
||||||
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CPUARM) || defined(CPUM2560)
|
#if defined(CPUARM) || defined(CPUM2560)
|
||||||
|
|
|
@ -73,8 +73,7 @@ void drawSecondSplash();
|
||||||
void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
||||||
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||||
void displayMenuBar(const MenuItem * menu, int index);
|
void displayMenuBar(const MenuItem * menu, int index);
|
||||||
void drawProgressBar(const char * label);
|
void drawProgressBar(const char * label, int num, int den);
|
||||||
void updateProgressBar(int num, int den);
|
|
||||||
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max);
|
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max);
|
||||||
void drawColumnHeader(const char * const * headers, uint8_t index);
|
void drawColumnHeader(const char * const * headers, uint8_t index);
|
||||||
void drawStick(coord_t centrex, int16_t xval, int16_t yval);
|
void drawStick(coord_t centrex, int16_t xval, int16_t yval);
|
||||||
|
|
|
@ -33,7 +33,7 @@ void drawSleepBitmap()
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PWR_BUTTON_DELAY)
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
const pm_uchar bmp_shutdown[] PROGMEM = {
|
const pm_uchar bmp_shutdown[] PROGMEM = {
|
||||||
#include "../../bitmaps/212x64/shutdown.lbm"
|
#include "../../bitmaps/212x64/shutdown.lbm"
|
||||||
};
|
};
|
||||||
|
@ -42,7 +42,7 @@ const pm_uchar bmp_shutdown[] PROGMEM = {
|
||||||
#define SHUTDOWN_BITMAP_HEIGHT 60
|
#define SHUTDOWN_BITMAP_HEIGHT 60
|
||||||
void drawShutdownAnimation(uint32_t index)
|
void drawShutdownAnimation(uint32_t index)
|
||||||
{
|
{
|
||||||
index /= (PWR_PRESS_SHUTDOWN / 4);
|
index /= (PWR_PRESS_SHUTDOWN_DELAY / 4);
|
||||||
lcdRefreshWait();
|
lcdRefreshWait();
|
||||||
lcdClear();
|
lcdClear();
|
||||||
lcdDrawBitmap((LCD_W-SHUTDOWN_BITMAP_WIDTH)/2, (LCD_H-SHUTDOWN_BITMAP_HEIGHT)/2, bmp_shutdown, index * SHUTDOWN_BITMAP_WIDTH, SHUTDOWN_BITMAP_WIDTH);
|
lcdDrawBitmap((LCD_W-SHUTDOWN_BITMAP_WIDTH)/2, (LCD_H-SHUTDOWN_BITMAP_HEIGHT)/2, bmp_shutdown, index * SHUTDOWN_BITMAP_WIDTH, SHUTDOWN_BITMAP_WIDTH);
|
||||||
|
@ -95,22 +95,20 @@ void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uin
|
||||||
lcdDrawVerticalLine(x, y + yofs, yhgt, SOLID, FORCE);
|
lcdDrawVerticalLine(x, y + yofs, yhgt, SOLID, FORCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawProgressBar(const char *label)
|
void drawProgressBar(const char * label, int num, int den)
|
||||||
{
|
{
|
||||||
lcdDrawTextAlignedLeft(4*FH, label);
|
lcdClear();
|
||||||
|
if (label) {
|
||||||
|
lcdDrawTextAlignedLeft(4*FH, label);
|
||||||
|
}
|
||||||
lcdDrawRect(4, 6*FH+4, LCD_W-8, 7);
|
lcdDrawRect(4, 6*FH+4, LCD_W-8, 7);
|
||||||
lcdRefresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateProgressBar(int num, int den)
|
|
||||||
{
|
|
||||||
if (num > 0 && den > 0) {
|
if (num > 0 && den > 0) {
|
||||||
int width = ((LCD_W-12)*num)/den;
|
int width = ((LCD_W-12)*num)/den;
|
||||||
lcdDrawSolidHorizontalLine(6, 6*FH+6, width, FORCE);
|
lcdDrawSolidHorizontalLine(6, 6*FH+6, width, FORCE);
|
||||||
lcdDrawSolidHorizontalLine(6, 6*FH+7, width, FORCE);
|
lcdDrawSolidHorizontalLine(6, 6*FH+7, width, FORCE);
|
||||||
lcdDrawSolidHorizontalLine(6, 6*FH+8, width, FORCE);
|
lcdDrawSolidHorizontalLine(6, 6*FH+8, width, FORCE);
|
||||||
lcdRefresh();
|
|
||||||
}
|
}
|
||||||
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max)
|
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max)
|
||||||
|
|
|
@ -132,10 +132,6 @@ void onSdManagerMenu(const char * result)
|
||||||
getSelectionFullPath(lfn);
|
getSelectionFullPath(lfn);
|
||||||
pushMenuTextView(lfn);
|
pushMenuTextView(lfn);
|
||||||
}
|
}
|
||||||
else if (result == STR_FLASH_INTERNAL_MODULE) {
|
|
||||||
getSelectionFullPath(lfn);
|
|
||||||
sportFlashDevice(INTERNAL_MODULE, lfn);
|
|
||||||
}
|
|
||||||
else if (result == STR_FLASH_EXTERNAL_DEVICE) {
|
else if (result == STR_FLASH_EXTERNAL_DEVICE) {
|
||||||
getSelectionFullPath(lfn);
|
getSelectionFullPath(lfn);
|
||||||
sportFlashDevice(EXTERNAL_MODULE, lfn);
|
sportFlashDevice(EXTERNAL_MODULE, lfn);
|
||||||
|
@ -233,7 +229,6 @@ bool menuRadioSdManager(event_t _event)
|
||||||
}
|
}
|
||||||
else if (!READ_ONLY() && !strcasecmp(ext, SPORT_FIRMWARE_EXT)) {
|
else if (!READ_ONLY() && !strcasecmp(ext, SPORT_FIRMWARE_EXT)) {
|
||||||
POPUP_MENU_ADD_ITEM(STR_FLASH_EXTERNAL_DEVICE);
|
POPUP_MENU_ADD_ITEM(STR_FLASH_EXTERNAL_DEVICE);
|
||||||
POPUP_MENU_ADD_ITEM(STR_FLASH_INTERNAL_MODULE);
|
|
||||||
}
|
}
|
||||||
else if (isExtensionMatching(ext, SCRIPTS_EXT)) {
|
else if (isExtensionMatching(ext, SCRIPTS_EXT)) {
|
||||||
POPUP_MENU_ADD_ITEM(STR_EXECUTE_FILE);
|
POPUP_MENU_ADD_ITEM(STR_EXECUTE_FILE);
|
||||||
|
|
|
@ -102,20 +102,20 @@ void drawHorizontalScrollbar(coord_t x, coord_t y, coord_t w, uint16_t offset, u
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawProgressBar(const char *label)
|
void drawProgressBar(const char * label, int num, int den)
|
||||||
{
|
{
|
||||||
lcdDrawText(MENUS_MARGIN_LEFT, 4*FH, label);
|
lcdClear();
|
||||||
lcdDrawRect(3, 6*FH+4, 204, 7);
|
lcdSetColor(WHITE);
|
||||||
lcdRefresh();
|
if (label) {
|
||||||
}
|
lcdDrawText(MENUS_MARGIN_LEFT, LCD_H-42, label, CUSTOM_COLOR);
|
||||||
|
|
||||||
void updateProgressBar(int num, int den)
|
|
||||||
{
|
|
||||||
if (num > 0 && den > 0) {
|
|
||||||
int width = (200*num)/den;
|
|
||||||
lcdDrawSolidFilledRect(5, 6*FH+6, width, 3, LINE_COLOR);
|
|
||||||
lcdRefresh();
|
|
||||||
}
|
}
|
||||||
|
lcdDrawRect(MENUS_MARGIN_LEFT, LCD_H-22, LCD_W-2*MENUS_MARGIN_LEFT, 15, 1, SOLID, CUSTOM_COLOR);
|
||||||
|
lcdSetColor(RED);
|
||||||
|
if (num > 0 && den > 0) {
|
||||||
|
int width = ((LCD_W-2*MENUS_MARGIN_LEFT-4) * num) / den;
|
||||||
|
lcdDrawSolidFilledRect(MENUS_MARGIN_LEFT+2, LCD_H-20, width, 11, CUSTOM_COLOR);
|
||||||
|
}
|
||||||
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawShadow(coord_t x, coord_t y, coord_t w, coord_t h)
|
void drawShadow(coord_t x, coord_t y, coord_t w, coord_t h)
|
||||||
|
@ -388,7 +388,7 @@ void drawShutdownAnimation(uint32_t index)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdRestoreBackupBuffer();
|
lcdRestoreBackupBuffer();
|
||||||
int quarter = index / (PWR_PRESS_SHUTDOWN / 5);
|
int quarter = index / (PWR_PRESS_SHUTDOWN_DELAY / 5);
|
||||||
if (quarter >= 1) lcdDrawBitmapPattern(LCD_W/2, (LCD_H-SHUTDOWN_CIRCLE_DIAMETER)/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, 0, SHUTDOWN_CIRCLE_DIAMETER/2);
|
if (quarter >= 1) lcdDrawBitmapPattern(LCD_W/2, (LCD_H-SHUTDOWN_CIRCLE_DIAMETER)/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, 0, SHUTDOWN_CIRCLE_DIAMETER/2);
|
||||||
if (quarter >= 2) lcdDrawBitmapPattern(LCD_W/2, LCD_H/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER/2, SHUTDOWN_CIRCLE_DIAMETER/2);
|
if (quarter >= 2) lcdDrawBitmapPattern(LCD_W/2, LCD_H/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER/2, SHUTDOWN_CIRCLE_DIAMETER/2);
|
||||||
if (quarter >= 3) lcdDrawBitmapPattern((LCD_W-SHUTDOWN_CIRCLE_DIAMETER)/2, LCD_H/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER, SHUTDOWN_CIRCLE_DIAMETER/2);
|
if (quarter >= 3) lcdDrawBitmapPattern((LCD_W-SHUTDOWN_CIRCLE_DIAMETER)/2, LCD_H/2, LBM_SHUTDOWN_CIRCLE, TEXT_COLOR, SHUTDOWN_CIRCLE_DIAMETER, SHUTDOWN_CIRCLE_DIAMETER/2);
|
||||||
|
@ -397,7 +397,7 @@ void drawShutdownAnimation(uint32_t index)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcd->clear();
|
lcd->clear();
|
||||||
int quarter = index / (PWR_PRESS_SHUTDOWN / 5);
|
int quarter = index / (PWR_PRESS_SHUTDOWN_DELAY / 5);
|
||||||
for (int i=1; i<=4; i++) {
|
for (int i=1; i<=4; i++) {
|
||||||
if (quarter >= i) {
|
if (quarter >= i) {
|
||||||
lcd->drawSolidFilledRect(LCD_W / 2 - 70 + 24 * i, LCD_H / 2 - 10, 20, 20, TEXT_BGCOLOR);
|
lcd->drawSolidFilledRect(LCD_W / 2 - 70 + 24 * i, LCD_H / 2 - 10, 20, 20, TEXT_BGCOLOR);
|
||||||
|
|
|
@ -49,8 +49,7 @@ void drawButton(coord_t x, coord_t y, const char * label, LcdFlags attr);
|
||||||
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
||||||
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||||
void drawHorizontalScrollbar(coord_t x, coord_t y, coord_t w, uint16_t offset, uint16_t count, uint8_t visible);
|
void drawHorizontalScrollbar(coord_t x, coord_t y, coord_t w, uint16_t offset, uint16_t count, uint8_t visible);
|
||||||
void drawProgressBar(const char * label);
|
void drawProgressBar(const char * label, int num, int den);
|
||||||
void updateProgressBar(int num, int den);
|
|
||||||
void drawShadow(coord_t x, coord_t y, coord_t w, coord_t h);
|
void drawShadow(coord_t x, coord_t y, coord_t w, coord_t h);
|
||||||
void drawTrimSquare(coord_t x, coord_t y);
|
void drawTrimSquare(coord_t x, coord_t y);
|
||||||
void drawHorizontalTrimPosition(coord_t x, coord_t y, int16_t dir);
|
void drawHorizontalTrimPosition(coord_t x, coord_t y, int16_t dir);
|
||||||
|
|
|
@ -41,9 +41,6 @@ void bootloaderFlash(const char * filename)
|
||||||
uint8_t buffer[1024];
|
uint8_t buffer[1024];
|
||||||
UINT count;
|
UINT count;
|
||||||
|
|
||||||
lcdClear();
|
|
||||||
drawProgressBar(STR_WRITING);
|
|
||||||
|
|
||||||
static uint8_t unlocked = 0;
|
static uint8_t unlocked = 0;
|
||||||
if (!unlocked) {
|
if (!unlocked) {
|
||||||
unlocked = 1;
|
unlocked = 1;
|
||||||
|
@ -63,7 +60,7 @@ void bootloaderFlash(const char * filename)
|
||||||
for (int j=0; j<1024; j+=FLASH_PAGESIZE) {
|
for (int j=0; j<1024; j+=FLASH_PAGESIZE) {
|
||||||
flashWrite(CONVERT_UINT_PTR(FIRMWARE_ADDRESS+i+j), (uint32_t *)(buffer+j));
|
flashWrite(CONVERT_UINT_PTR(FIRMWARE_ADDRESS+i+j), (uint32_t *)(buffer+j));
|
||||||
}
|
}
|
||||||
updateProgressBar(i, BOOTLOADER_SIZE);
|
drawProgressBar(STR_WRITING, i, BOOTLOADER_SIZE);
|
||||||
SIMU_SLEEP(30/*ms*/);
|
SIMU_SLEEP(30/*ms*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,7 @@ const char * sportUpdateUploadFile(const char *filename)
|
||||||
sportUpdateState = SPORT_DATA_TRANSFER,
|
sportUpdateState = SPORT_DATA_TRANSFER,
|
||||||
sportWritePacket(packet);
|
sportWritePacket(packet);
|
||||||
if (i==0) {
|
if (i==0) {
|
||||||
updateProgressBar(file.fptr, file.obj.objsize);
|
drawProgressBar(STR_WRITING, file.fptr, file.obj.objsize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,9 +286,6 @@ void sportFlashDevice(ModuleIndex module, const char * filename)
|
||||||
{
|
{
|
||||||
pausePulses();
|
pausePulses();
|
||||||
|
|
||||||
lcdClear();
|
|
||||||
drawProgressBar(STR_WRITING);
|
|
||||||
|
|
||||||
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
||||||
uint8_t intPwr = IS_INTERNAL_MODULE_ON();
|
uint8_t intPwr = IS_INTERNAL_MODULE_ON();
|
||||||
uint8_t extPwr = IS_EXTERNAL_MODULE_ON();
|
uint8_t extPwr = IS_EXTERNAL_MODULE_ON();
|
||||||
|
|
|
@ -903,7 +903,7 @@ bool readonlyUnlocked()
|
||||||
#if defined(SPLASH)
|
#if defined(SPLASH)
|
||||||
void doSplash()
|
void doSplash()
|
||||||
{
|
{
|
||||||
#if defined(PWR_BUTTON_DELAY)
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -948,7 +948,7 @@ void doSplash()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PWR_BUTTON_DELAY)
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
uint32_t pwr_check = pwrCheck();
|
uint32_t pwr_check = pwrCheck();
|
||||||
if (pwr_check == e_power_off) {
|
if (pwr_check == e_power_off) {
|
||||||
break;
|
break;
|
||||||
|
@ -1147,7 +1147,7 @@ void checkTHR()
|
||||||
LED_ERROR_BEGIN();
|
LED_ERROR_BEGIN();
|
||||||
RAISE_ALERT(STR_THROTTLEWARN, STR_THROTTLENOTIDLE, STR_PRESSANYKEYTOSKIP, AU_THROTTLE_ALERT);
|
RAISE_ALERT(STR_THROTTLEWARN, STR_THROTTLENOTIDLE, STR_PRESSANYKEYTOSKIP, AU_THROTTLE_ALERT);
|
||||||
|
|
||||||
#if defined(PWR_BUTTON_DELAY)
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1159,7 +1159,7 @@ void checkTHR()
|
||||||
|
|
||||||
v = calibratedAnalogs[thrchn];
|
v = calibratedAnalogs[thrchn];
|
||||||
|
|
||||||
#if defined(PWR_BUTTON_DELAY)
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
uint32_t pwr_check = pwrCheck();
|
uint32_t pwr_check = pwrCheck();
|
||||||
if (pwr_check == e_power_off) {
|
if (pwr_check == e_power_off) {
|
||||||
break;
|
break;
|
||||||
|
@ -1207,13 +1207,15 @@ void checkAlarm() // added by Gohst
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void alert(const pm_char * t, const pm_char * s ALERT_SOUND_ARG)
|
void alert(const pm_char * title, const pm_char * msg ALERT_SOUND_ARG)
|
||||||
{
|
{
|
||||||
LED_ERROR_BEGIN();
|
LED_ERROR_BEGIN();
|
||||||
|
|
||||||
RAISE_ALERT(t, s, STR_PRESSANYKEY, sound);
|
TRACE("ALERT %s: %s", title, msg);
|
||||||
|
|
||||||
#if defined(PWR_BUTTON_DELAY)
|
RAISE_ALERT(title, msg, STR_PRESSANYKEY, sound);
|
||||||
|
|
||||||
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1229,7 +1231,7 @@ void alert(const pm_char * t, const pm_char * s ALERT_SOUND_ARG)
|
||||||
|
|
||||||
wdt_reset();
|
wdt_reset();
|
||||||
|
|
||||||
#if defined(PWR_BUTTON_DELAY)
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
uint32_t pwr_check = pwrCheck();
|
uint32_t pwr_check = pwrCheck();
|
||||||
if (pwr_check == e_power_off) {
|
if (pwr_check == e_power_off) {
|
||||||
boardOff();
|
boardOff();
|
||||||
|
@ -1238,7 +1240,7 @@ void alert(const pm_char * t, const pm_char * s ALERT_SOUND_ARG)
|
||||||
refresh = true;
|
refresh = true;
|
||||||
}
|
}
|
||||||
else if (pwr_check == e_power_on && refresh) {
|
else if (pwr_check == e_power_on && refresh) {
|
||||||
RAISE_ALERT(t, s, STR_PRESSANYKEY, AU_NONE);
|
RAISE_ALERT(title, msg, STR_PRESSANYKEY, AU_NONE);
|
||||||
refresh = false;
|
refresh = false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -2698,8 +2700,7 @@ int main()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PWR_BUTTON_DELAY)
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
|
|
||||||
uint32_t pwr_press_time = 0;
|
uint32_t pwr_press_time = 0;
|
||||||
|
|
||||||
uint32_t pwrPressedDuration()
|
uint32_t pwrPressedDuration()
|
||||||
|
@ -2737,7 +2738,7 @@ uint32_t pwrCheck()
|
||||||
if (g_eeGeneral.backlightMode != e_backlight_mode_off) {
|
if (g_eeGeneral.backlightMode != e_backlight_mode_off) {
|
||||||
BACKLIGHT_ENABLE();
|
BACKLIGHT_ENABLE();
|
||||||
}
|
}
|
||||||
if (get_tmr10ms() - pwr_press_time > PWR_PRESS_SHUTDOWN) {
|
if (get_tmr10ms() - pwr_press_time > PWR_PRESS_SHUTDOWN_DELAY) {
|
||||||
#if defined(SHUTDOWN_CONFIRMATION)
|
#if defined(SHUTDOWN_CONFIRMATION)
|
||||||
while (1) {
|
while (1) {
|
||||||
lcdRefreshWait();
|
lcdRefreshWait();
|
||||||
|
@ -2775,4 +2776,22 @@ uint32_t pwrCheck()
|
||||||
|
|
||||||
return e_power_on;
|
return e_power_on;
|
||||||
}
|
}
|
||||||
|
#elif defined(CPUARM)
|
||||||
|
uint32_t pwrCheck()
|
||||||
|
{
|
||||||
|
#if defined(SOFT_PWR_CTRL)
|
||||||
|
if (pwrPressed())
|
||||||
|
return e_power_on;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (usbPlugged())
|
||||||
|
return e_power_usb;
|
||||||
|
|
||||||
|
#if defined(TRAINER_PWR)
|
||||||
|
if (TRAINER_CONNECTED())
|
||||||
|
return e_power_trainer;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return e_power_off;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -324,11 +324,14 @@ void memswap(void * a, void * b, uint8_t size);
|
||||||
#define IS_MULTIPOS_CALIBRATED(cal) (false)
|
#define IS_MULTIPOS_CALIBRATED(cal) (false)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBFLAMENCO) || defined(PCBHORUS) || defined(PCBX9E) || defined(PCBX7)
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
#define PWR_BUTTON_DELAY
|
#define pwrOffPressed() pwrPressed()
|
||||||
#define PWR_PRESS_SHUTDOWN 300 // 3s
|
#else
|
||||||
|
#define pwrOffPressed() (!pwrPressed())
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define PWR_PRESS_SHUTDOWN_DELAY 300 // 3s
|
||||||
|
|
||||||
#define GET_LOWRES_POT_POSITION(i) (getValue(MIXSRC_FIRST_POT+(i)) >> 4)
|
#define GET_LOWRES_POT_POSITION(i) (getValue(MIXSRC_FIRST_POT+(i)) >> 4)
|
||||||
#define SAVE_POT_POSITION(i) g_model.potsWarnPosition[i] = GET_LOWRES_POT_POSITION(i)
|
#define SAVE_POT_POSITION(i) g_model.potsWarnPosition[i] = GET_LOWRES_POT_POSITION(i)
|
||||||
|
|
||||||
|
|
|
@ -932,9 +932,6 @@ void eepromBackup()
|
||||||
uint8_t buffer[1024];
|
uint8_t buffer[1024];
|
||||||
FIL file;
|
FIL file;
|
||||||
|
|
||||||
lcdClear();
|
|
||||||
drawProgressBar(STR_WRITING);
|
|
||||||
|
|
||||||
// reset unexpectedShutdown to prevent warning when user restores EEPROM backup
|
// reset unexpectedShutdown to prevent warning when user restores EEPROM backup
|
||||||
g_eeGeneral.unexpectedShutdown = 0;
|
g_eeGeneral.unexpectedShutdown = 0;
|
||||||
storageDirty(EE_GENERAL);
|
storageDirty(EE_GENERAL);
|
||||||
|
@ -961,7 +958,7 @@ void eepromBackup()
|
||||||
UINT count;
|
UINT count;
|
||||||
eepromReadBlock(buffer, i, 1024);
|
eepromReadBlock(buffer, i, 1024);
|
||||||
f_write(&file, buffer, 1024, &count);
|
f_write(&file, buffer, 1024, &count);
|
||||||
updateProgressBar(i, EEPROM_SIZE);
|
drawProgressBar(STR_WRITING, i, EEPROM_SIZE);
|
||||||
SIMU_SLEEP(100/*ms*/);
|
SIMU_SLEEP(100/*ms*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
option(DISK_CACHE "Enable SD card disk cache" YES)
|
option(DISK_CACHE "Enable SD card disk cache" YES)
|
||||||
option(BLUETOOTH_CLI_PASSTHROUGH "Enable direct communicaton with Bluetooth module from CLI" NO)
|
option(BLUETOOTH_CLI_PASSTHROUGH "Enable direct communicaton with Bluetooth module from CLI" NO)
|
||||||
option(PWR_BUTTON_DISABLED "Disable the Power Button (for debugging with JTAG)" NO)
|
option(UNEXPECTED_SHUTDOWN "Enable the Unexpected Shutdown screen" YES)
|
||||||
option(NO_UNEXPECTED_SHUTDOWN "Disable the Unexpected Shutdown screen (for debugging with JTAG)" NO)
|
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||||
|
|
||||||
set(CPU_TYPE STM32F4)
|
set(CPU_TYPE STM32F4)
|
||||||
set(HSE_VALUE 12000000)
|
set(HSE_VALUE 12000000)
|
||||||
|
@ -22,14 +22,6 @@ if(SPLASH STREQUAL OFF)
|
||||||
message(FATAL_ERROR "Option SPLASH=OFF not supported on Horus")
|
message(FATAL_ERROR "Option SPLASH=OFF not supported on Horus")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(PWR_BUTTON_DISABLED)
|
|
||||||
add_definitions(-DPWR_BUTTON_DISABLED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NO_UNEXPECTED_SHUTDOWN)
|
|
||||||
add_definitions(-DNO_UNEXPECTED_SHUTDOWN)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (PCB STREQUAL X10)
|
if (PCB STREQUAL X10)
|
||||||
set(FLAVOUR x10)
|
set(FLAVOUR x10)
|
||||||
add_definitions(-DPCBX10)
|
add_definitions(-DPCBX10)
|
||||||
|
@ -68,6 +60,11 @@ endif()
|
||||||
add_definitions(-DPCBHORUS -DSTM32F429_439xx -DSDRAM -DCOLORLCD -DPPM_PIN_UART -DPPM_PIN_TIMER)
|
add_definitions(-DPCBHORUS -DSTM32F429_439xx -DSDRAM -DCOLORLCD -DPPM_PIN_UART -DPPM_PIN_TIMER)
|
||||||
add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
|
add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
|
||||||
add_definitions(-DGPS_USART_BAUDRATE=${INTERNAL_GPS_BAUDRATE})
|
add_definitions(-DGPS_USART_BAUDRATE=${INTERNAL_GPS_BAUDRATE})
|
||||||
|
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||||
|
|
||||||
|
if(NOT UNEXPECTED_SHUTDOWN)
|
||||||
|
add_definitions(-DNO_UNEXPECTED_SHUTDOWN)
|
||||||
|
endif()
|
||||||
|
|
||||||
include_directories(${RADIO_SRC_DIRECTORY}/fonts/480x272 gui/${GUI_DIR} gui/${GUI_DIR}/layouts)
|
include_directories(${RADIO_SRC_DIRECTORY}/fonts/480x272 gui/${GUI_DIR} gui/${GUI_DIR}/layouts)
|
||||||
|
|
||||||
|
|
|
@ -391,6 +391,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Power driver
|
// Power driver
|
||||||
|
#define SOFT_PWR_CTRL
|
||||||
void pwrInit(void);
|
void pwrInit(void);
|
||||||
uint32_t pwrCheck(void);
|
uint32_t pwrCheck(void);
|
||||||
void pwrOn(void);
|
void pwrOn(void);
|
||||||
|
@ -398,7 +399,6 @@ void pwrOff(void);
|
||||||
void pwrResetHandler(void);
|
void pwrResetHandler(void);
|
||||||
uint32_t pwrPressed(void);
|
uint32_t pwrPressed(void);
|
||||||
uint32_t pwrPressedDuration(void);
|
uint32_t pwrPressedDuration(void);
|
||||||
#define pwroffPressed() pwrPressed()
|
|
||||||
#if defined(SIMU) || defined(NO_UNEXPECTED_SHUTDOWN)
|
#if defined(SIMU) || defined(NO_UNEXPECTED_SHUTDOWN)
|
||||||
#define UNEXPECTED_SHUTDOWN() (false)
|
#define UNEXPECTED_SHUTDOWN() (false)
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -46,11 +46,9 @@ void pwrInit()
|
||||||
|
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||||
|
|
||||||
#if !defined(PWR_BUTTON_DISABLED)
|
|
||||||
// Init PWR SWITCH PIN
|
// Init PWR SWITCH PIN
|
||||||
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
||||||
GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
|
GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Init PCBREV PIN
|
// Init PCBREV PIN
|
||||||
// TODO to be removed on X10?
|
// TODO to be removed on X10?
|
||||||
|
@ -101,11 +99,7 @@ void pwrOff()
|
||||||
|
|
||||||
uint32_t pwrPressed()
|
uint32_t pwrPressed()
|
||||||
{
|
{
|
||||||
#if defined(PWR_BUTTON_DISABLED)
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
return GPIO_ReadInputDataBit(PWR_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
|
return GPIO_ReadInputDataBit(PWR_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pwrResetHandler()
|
void pwrResetHandler()
|
||||||
|
|
|
@ -576,14 +576,14 @@ int lcdRestoreBackupBuffer()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t pwroffPressed() { return false; }
|
|
||||||
|
|
||||||
#if defined(CPUARM) && !defined(PWR_BUTTON_DELAY)
|
|
||||||
uint32_t pwrCheck() { return true; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
void pwrOff() { }
|
void pwrOff()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
uint32_t pwrPressed()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(STM32)
|
#if defined(STM32)
|
||||||
|
|
|
@ -234,6 +234,7 @@ void calcConsumption();
|
||||||
|
|
||||||
// Trainer driver
|
// Trainer driver
|
||||||
#define SLAVE_MODE() (pwrCheck() == e_power_trainer)
|
#define SLAVE_MODE() (pwrCheck() == e_power_trainer)
|
||||||
|
#define TRAINER_CONNECTED() (PIOA->PIO_PDSR & PIO_PA8)
|
||||||
void checkTrainerSettings();
|
void checkTrainerSettings();
|
||||||
void init_trainer_capture();
|
void init_trainer_capture();
|
||||||
|
|
||||||
|
@ -368,10 +369,14 @@ void btPushByte(uint8_t data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Power driver
|
// Power driver
|
||||||
|
#define TRAINER_PWR
|
||||||
|
#if !defined(REVA)
|
||||||
|
#define SOFT_PWR_CTRL
|
||||||
|
#endif
|
||||||
void pwrInit();
|
void pwrInit();
|
||||||
void pwrOff();
|
void pwrOff();
|
||||||
uint32_t pwrCheck();
|
uint32_t pwrCheck();
|
||||||
uint32_t pwroffPressed();
|
uint32_t pwrPressed();
|
||||||
#define UNEXPECTED_SHUTDOWN() (g_eeGeneral.unexpectedShutdown)
|
#define UNEXPECTED_SHUTDOWN() (g_eeGeneral.unexpectedShutdown)
|
||||||
|
|
||||||
// EEPROM driver
|
// EEPROM driver
|
||||||
|
|
|
@ -20,42 +20,12 @@
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
uint32_t pwroffPressed()
|
uint32_t pwrPressed()
|
||||||
{
|
{
|
||||||
#if defined(SIMU) || defined(REVA)
|
#if defined(SIMU) || defined(REVA)
|
||||||
return false;
|
return true;
|
||||||
#else
|
#else
|
||||||
return !(PIOC->PIO_PDSR & PIO_PC17);
|
return PIOC->PIO_PDSR & PIO_PC17;
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t pwrCheck()
|
|
||||||
{
|
|
||||||
#if defined(SIMU)
|
|
||||||
return e_power_on;
|
|
||||||
#elif defined(REVA)
|
|
||||||
if (PIOC->PIO_PDSR & PIO_PC25)
|
|
||||||
return e_power_usb;
|
|
||||||
else if (PIOA->PIO_PDSR & PIO_PA8)
|
|
||||||
return e_power_trainer;
|
|
||||||
else
|
|
||||||
return e_power_on;
|
|
||||||
#elif defined(REVB)
|
|
||||||
if (!pwroffPressed())
|
|
||||||
return e_power_on;
|
|
||||||
else if (usbPlugged())
|
|
||||||
return e_power_usb;
|
|
||||||
else if ( PIOA->PIO_PDSR & PIO_PA8 )
|
|
||||||
return e_power_trainer;
|
|
||||||
else
|
|
||||||
return e_power_off;
|
|
||||||
#else
|
|
||||||
if (!pwroffPressed())
|
|
||||||
return e_power_on;
|
|
||||||
else if (PIOA->PIO_PDSR & PIO_PA8)
|
|
||||||
return e_power_trainer;
|
|
||||||
else
|
|
||||||
return e_power_off;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ option(TARANIS_INTERNAL_PPM "Taranis internal module hack to output PPM" OFF)
|
||||||
option(MIXERS_MONITOR "Enable Mixers Monitor screen (not available on X7 yet)" OFF)
|
option(MIXERS_MONITOR "Enable Mixers Monitor screen (not available on X7 yet)" OFF)
|
||||||
|
|
||||||
if(PCB STREQUAL X9E)
|
if(PCB STREQUAL X9E)
|
||||||
|
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||||
set(STICKS "STANDARD" CACHE STRING "Sticks type (STANDARD/HORUS)")
|
set(STICKS "STANDARD" CACHE STRING "Sticks type (STANDARD/HORUS)")
|
||||||
set(CPU_TYPE STM32F4)
|
set(CPU_TYPE STM32F4)
|
||||||
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
set(CPU_TYPE_FULL STM32F407xE) # for size report
|
||||||
|
@ -14,6 +15,7 @@ if(PCB STREQUAL X9E)
|
||||||
add_definitions(-DSTM32F40_41xxx -DPCBX9E)
|
add_definitions(-DSTM32F40_41xxx -DPCBX9E)
|
||||||
add_definitions(-DEEPROM_VARIANT=0x8000)
|
add_definitions(-DEEPROM_VARIANT=0x8000)
|
||||||
add_definitions(-DBLUETOOTH)
|
add_definitions(-DBLUETOOTH)
|
||||||
|
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||||
set(FIRMWARE_TARGET_SRC
|
set(FIRMWARE_TARGET_SRC
|
||||||
${FIRMWARE_TARGET_SRC}
|
${FIRMWARE_TARGET_SRC}
|
||||||
top_lcd_driver.cpp
|
top_lcd_driver.cpp
|
||||||
|
@ -60,6 +62,7 @@ elseif(PCB STREQUAL X9D)
|
||||||
set(SERIAL2_DRIVER ../common/arm/stm32/serial2_driver.cpp)
|
set(SERIAL2_DRIVER ../common/arm/stm32/serial2_driver.cpp)
|
||||||
set(GVAR_SCREEN model_gvars.cpp)
|
set(GVAR_SCREEN model_gvars.cpp)
|
||||||
elseif(PCB STREQUAL X7)
|
elseif(PCB STREQUAL X7)
|
||||||
|
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||||
set(CPU_TYPE STM32F2)
|
set(CPU_TYPE STM32F2)
|
||||||
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
set(CPU_TYPE_FULL STM32F205xE) # for size report
|
||||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||||
|
@ -68,6 +71,7 @@ elseif(PCB STREQUAL X7)
|
||||||
set(FLAVOUR x7)
|
set(FLAVOUR x7)
|
||||||
add_definitions(-DPCBX7 -DSOFTWARE_VOLUME)
|
add_definitions(-DPCBX7 -DSOFTWARE_VOLUME)
|
||||||
add_definitions(-DEEPROM_VARIANT=0x4000)
|
add_definitions(-DEEPROM_VARIANT=0x4000)
|
||||||
|
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||||
set(FIRMWARE_TARGET_SRC
|
set(FIRMWARE_TARGET_SRC
|
||||||
${FIRMWARE_TARGET_SRC}
|
${FIRMWARE_TARGET_SRC}
|
||||||
bluetooth_driver.cpp
|
bluetooth_driver.cpp
|
||||||
|
|
|
@ -417,16 +417,14 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Power driver
|
// Power driver
|
||||||
|
#define SOFT_PWR_CTRL
|
||||||
void pwrInit(void);
|
void pwrInit(void);
|
||||||
uint32_t pwrCheck(void);
|
uint32_t pwrCheck(void);
|
||||||
void pwrOn(void);
|
void pwrOn(void);
|
||||||
void pwrOff(void);
|
void pwrOff(void);
|
||||||
#if defined(PWR_PRESS_BUTTON)
|
|
||||||
uint32_t pwrPressed(void);
|
uint32_t pwrPressed(void);
|
||||||
|
#if defined(PWR_PRESS_BUTTON)
|
||||||
uint32_t pwrPressedDuration(void);
|
uint32_t pwrPressedDuration(void);
|
||||||
#define pwroffPressed() pwrPressed()
|
|
||||||
#else
|
|
||||||
uint32_t pwroffPressed(void);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SIMU)
|
#if defined(SIMU)
|
||||||
|
|
|
@ -619,11 +619,7 @@ int main()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state != ST_FLASHING && state != ST_USB) {
|
if (state != ST_FLASHING && state != ST_USB) {
|
||||||
#if defined(PCBX9E) || defined(PCBX7)
|
if (pwrOffPressed()) {
|
||||||
if (pwrPressed()) {
|
|
||||||
#else
|
|
||||||
if (pwrCheck() == e_power_off) {
|
|
||||||
#endif
|
|
||||||
lcdOff(); // this drains LCD caps
|
lcdOff(); // this drains LCD caps
|
||||||
pwrOff();
|
pwrOff();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
|
@ -85,23 +85,7 @@ void pwrOff()
|
||||||
// this function must not return!
|
// this function must not return!
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PWR_PRESS_BUTTON)
|
|
||||||
uint32_t pwrPressed()
|
uint32_t pwrPressed()
|
||||||
{
|
{
|
||||||
return GPIO_ReadInputDataBit(PWR_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
|
return GPIO_ReadInputDataBit(PWR_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
uint32_t pwroffPressed()
|
|
||||||
{
|
|
||||||
return GPIO_ReadInputDataBit(PWR_GPIO, PWR_SWITCH_GPIO_PIN) != Bit_RESET;
|
|
||||||
}
|
|
||||||
uint32_t pwrCheck()
|
|
||||||
{
|
|
||||||
if (!pwroffPressed())
|
|
||||||
return e_power_on;
|
|
||||||
else if (usbPlugged())
|
|
||||||
return e_power_usb;
|
|
||||||
else
|
|
||||||
return e_power_off;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ void resetForcePowerOffRequest()
|
||||||
|
|
||||||
bool isForcePowerOffRequested()
|
bool isForcePowerOffRequested()
|
||||||
{
|
{
|
||||||
if (pwroffPressed()) {
|
if (pwrOffPressed()) {
|
||||||
if (timeForcePowerOffPressed == 0) {
|
if (timeForcePowerOffPressed == 0) {
|
||||||
timeForcePowerOffPressed = get_tmr10ms();
|
timeForcePowerOffPressed = get_tmr10ms();
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ void menusTask(void * pdata)
|
||||||
{
|
{
|
||||||
opentxInit();
|
opentxInit();
|
||||||
|
|
||||||
#if defined(PWR_BUTTON_DELAY)
|
#if defined(PWR_BUTTON_PRESS)
|
||||||
while (1) {
|
while (1) {
|
||||||
uint32_t pwr_check = pwrCheck();
|
uint32_t pwr_check = pwrCheck();
|
||||||
if (pwr_check == e_power_off) {
|
if (pwr_check == e_power_off) {
|
||||||
|
|
|
@ -905,7 +905,7 @@
|
||||||
#define TR_DISABLE_INTERNAL TR("Disable int.", "Disable internal RF")
|
#define TR_DISABLE_INTERNAL TR("Disable int.", "Disable internal RF")
|
||||||
#define TR_MODULE_NO_SERIAL_MODE TR("!serial mode", "Not in serial mode")
|
#define TR_MODULE_NO_SERIAL_MODE TR("!serial mode", "Not in serial mode")
|
||||||
#define TR_MODULE_NO_INPUT TR("No input", "No serial input")
|
#define TR_MODULE_NO_INPUT TR("No input", "No serial input")
|
||||||
#define TR_MODULE_NO_TELEMETRY TR3( "No telemetry", "No MULTI_TELEMETRY", "No MULTI_TELEMETRY detected")
|
#define TR_MODULE_NO_TELEMETRY TR3("No telemetry", "No MULTI_TELEMETRY", "No MULTI_TELEMETRY detected")
|
||||||
#define TR_MODULE_BINDING TR("Bind...","Binding")
|
#define TR_MODULE_BINDING TR("Bind...","Binding")
|
||||||
#define TR_PROTOCOL_INVALID TR("Prot. invalid", "Protocol invalid")
|
#define TR_PROTOCOL_INVALID TR("Prot. invalid", "Protocol invalid")
|
||||||
#define TR_MODULE_STATUS TR(INDENT "Status", INDENT "Module Status")
|
#define TR_MODULE_STATUS TR(INDENT "Status", INDENT "Module Status")
|
||||||
|
@ -1021,7 +1021,7 @@
|
||||||
#define TR_FLASH_EXTERNAL_DEVICE TR("Flash ext. device", "Flash external device")
|
#define TR_FLASH_EXTERNAL_DEVICE TR("Flash ext. device", "Flash external device")
|
||||||
#define TR_FLASH_INTERNAL_MODULE TR("Flash int. module", "Flash internal module")
|
#define TR_FLASH_INTERNAL_MODULE TR("Flash int. module", "Flash internal module")
|
||||||
#define TR_FIRMWARE_UPDATE_ERROR TR("FW update error", "Firmware update error")
|
#define TR_FIRMWARE_UPDATE_ERROR TR("FW update error", "Firmware update error")
|
||||||
#define TR_WRITING TR("\14Writing...", "\032Writing...")
|
#define TR_WRITING TR3("\14Writing...", "\032Writing...", "Writing...")
|
||||||
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
#define TR_CONFIRM_FORMAT "Confirm Format?"
|
||||||
#define TR_INTERNALRF "Internal RF"
|
#define TR_INTERNALRF "Internal RF"
|
||||||
#define TR_EXTERNALRF "External RF"
|
#define TR_EXTERNALRF "External RF"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue