mirror of
https://github.com/opentx/opentx.git
synced 2025-07-21 23:35:17 +03:00
Cosmetics
This commit is contained in:
parent
8bdce4e213
commit
00100c0c86
21 changed files with 66 additions and 51 deletions
|
@ -172,8 +172,7 @@ bool Er9xSimulator::timer10ms()
|
|||
|
||||
uint8_t * Er9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool Er9xSimulator::lcdChanged(bool & lightEnable)
|
||||
|
|
|
@ -194,8 +194,7 @@ bool Ersky9xSimulator::timer10ms()
|
|||
|
||||
uint8_t * Ersky9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
|
||||
|
|
|
@ -485,8 +485,7 @@ bool OpenTxSimulator::timer10ms()
|
|||
|
||||
::uint8_t * OpenTxSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool OpenTxSimulator::lcdChanged(bool & lightEnable)
|
||||
|
|
|
@ -175,8 +175,7 @@ bool Th9xSimulator::timer10ms()
|
|||
|
||||
uint8_t * Th9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool Th9xSimulator::lcdChanged(bool & lightEnable)
|
||||
|
|
|
@ -96,11 +96,6 @@ per10ms();
|
|||
return true;
|
||||
#endif
|
||||
|
||||
#ifdef GETLCD_IMPORT
|
||||
#undef GETLCD_IMPORT
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
#endif
|
||||
|
||||
#ifdef GETERROR_IMPORT
|
||||
#undef GETERROR_IMPORT
|
||||
return main_thread_error;
|
||||
|
|
|
@ -1090,7 +1090,7 @@ ifeq ($(PCB), FLAMENCO)
|
|||
TRGT = arm-none-eabi-
|
||||
MCU = cortex-m4
|
||||
OPT = 2
|
||||
CPPDEFS += -DHSE_VALUE=12000000 -DCOLORLCD -DSTM32F40_41xxx
|
||||
CPPDEFS += -DHSE_VALUE=12000000 -DCOLORLCD -DSTM32F40_41xxx -DPPM_PIN_HW_SERIAL
|
||||
BITMAPS += $(patsubst %.png,%.lbm,$(wildcard bitmaps/Flamenco/*.png))
|
||||
FONTS = fonts/Flamenco/font_stdsize.lbm fonts/Flamenco/font_tinsize.lbm fonts/Flamenco/font_smlsize.lbm fonts/Flamenco/font_midsize.lbm fonts/Flamenco/font_dblsize.lbm fonts/Flamenco/font_xxlsize.lbm
|
||||
SDCARD = YES
|
||||
|
@ -1887,7 +1887,7 @@ else
|
|||
FONTNAME = Roboto
|
||||
TINSIZE = 5
|
||||
SMLSIZE = 7
|
||||
STDSIZE = 8
|
||||
STDSIZE = 11
|
||||
MIDSIZE = 11
|
||||
DBLSIZE = 14
|
||||
DBLBOLD = False
|
||||
|
|
|
@ -226,6 +226,27 @@ const MemArea memAreas[] = {
|
|||
{ NULL, NULL, 0 },
|
||||
};
|
||||
|
||||
int cliSet(const char ** argv)
|
||||
{
|
||||
if (!strcmp(argv[1], "rtc")) {
|
||||
struct gtm t;
|
||||
int year, month, day, hour, minute, second;
|
||||
if (toInt(argv, 2, &year) > 0 && toInt(argv, 3, &month) > 0 && toInt(argv, 4, &day) > 0 && toInt(argv, 5, &hour) > 0 && toInt(argv, 6, &minute) > 0 && toInt(argv, 7, &second) > 0) {
|
||||
t.tm_year = year-1900;
|
||||
t.tm_mon = month-1;
|
||||
t.tm_mday = day;
|
||||
t.tm_hour = hour;
|
||||
t.tm_min = minute;
|
||||
t.tm_sec = second;
|
||||
rtcSetTime(&t);
|
||||
}
|
||||
else {
|
||||
serialPrint("%s: Invalid arguments \"%s\" \"%s\"", argv[0], argv[1], argv[2]);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cliDisplay(const char ** argv)
|
||||
{
|
||||
long long int address = 0;
|
||||
|
@ -268,10 +289,10 @@ int cliDisplay(const char ** argv)
|
|||
serialPrint("outputs[%d] = %04X", i, channelOutputs[i]);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(argv[1], "time")) {
|
||||
else if (!strcmp(argv[1], "rtc")) {
|
||||
struct gtm utm;
|
||||
gettime(&utm);
|
||||
serialPrint("time = %4d-%02d-%02d %02d:%02d:%02d.%02d0", utm.tm_year+1900, utm.tm_mon+1, utm.tm_mday, utm.tm_hour, utm.tm_min, utm.tm_sec, g_ms100);
|
||||
serialPrint("rtc = %4d-%02d-%02d %02d:%02d:%02d.%02d0", utm.tm_year+1900, utm.tm_mon+1, utm.tm_mday, utm.tm_hour, utm.tm_min, utm.tm_sec, g_ms100);
|
||||
}
|
||||
#if defined(PCBFLAMENCO)
|
||||
else if (!strcmp(argv[1], "bq24195")) {
|
||||
|
@ -358,6 +379,7 @@ const CliCommand cliCommands[] = {
|
|||
{ "ls", cliLs, "<directory>" },
|
||||
{ "play", cliPlay, "<filename>" },
|
||||
{ "print", cliDisplay, "<address> [<size>] | <what>" },
|
||||
{ "set", cliSet, "<what> <value>" },
|
||||
{ "stackinfo", cliStackInfo, "" },
|
||||
{ "trace", cliTrace, "on | off" },
|
||||
{ "volume", cliVolume, "<level>" },
|
||||
|
|
|
@ -155,7 +155,7 @@ bool menuModelLimits(evt_t event)
|
|||
// last line available - add the "copy trim menu" line
|
||||
uint8_t attr = (sub==NUM_CHNOUT) ? INVERS : 0;
|
||||
// TODO CENTER attribute
|
||||
lcdDrawText(100, y, STR_TRIMS2OFFSETS, noHighlightCounter ? 0 : attr);
|
||||
lcdDrawText(100, y, STR_TRIMS2OFFSETS, NO_HIGHLIGHT() ? 0 : attr);
|
||||
if (attr) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
|
|
@ -323,7 +323,7 @@ bool menuModelSetup(evt_t event)
|
|||
case ITEM_MODEL_EXTENDED_TRIMS:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_ETRIMS);
|
||||
g_model.extendedTrims = onoffMenuItem(g_model.extendedTrims, MODEL_SETUP_2ND_COLUMN, y, menuHorizontalPosition<=0 ? attr : 0, event==EVT_KEY_BREAK(KEY_ENTER) ? event : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+18, y, STR_RESET_BTN, menuHorizontalPosition>0 && !noHighlightCounter ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+18, y, STR_RESET_BTN, menuHorizontalPosition>0 && !NO_HIGHLIGHT() ? attr : 0);
|
||||
if (attr && menuHorizontalPosition>0) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
@ -746,7 +746,7 @@ bool menuModelFailsafe(evt_t event)
|
|||
|
||||
// Value
|
||||
LcdFlags flags = TINSIZE;
|
||||
if (menuVerticalPosition == ch && !noHighlightCounter) {
|
||||
if (menuVerticalPosition == ch && !NO_HIGHLIGHT()) {
|
||||
flags |= INVERS;
|
||||
if (s_editMode)
|
||||
flags |= BLINK;
|
||||
|
|
|
@ -46,7 +46,14 @@ enum EnumKeys {
|
|||
KEY_DOWN,
|
||||
KEY_RIGHT,
|
||||
KEY_LEFT,
|
||||
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO)
|
||||
#elif defined(PCBFLAMENCO)
|
||||
KEY_MENU,
|
||||
KEY_EXIT,
|
||||
KEY_ENTER,
|
||||
KEY_PAGE,
|
||||
KEY_PLUS, // TODO remove
|
||||
KEY_MINUS, // TODO remove
|
||||
#elif defined(PCBTARANIS)
|
||||
KEY_MENU,
|
||||
KEY_EXIT,
|
||||
KEY_ENTER,
|
||||
|
@ -259,7 +266,7 @@ class Key
|
|||
|
||||
extern Key keys[NUM_KEYS];
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#if defined(COLORLCD)
|
||||
typedef uint16_t evt_t;
|
||||
#else
|
||||
typedef uint8_t evt_t;
|
||||
|
|
|
@ -165,7 +165,7 @@ void guiMain(evt_t evt)
|
|||
TIME_MEASURE_STOP(storebackup);
|
||||
}
|
||||
if (popupDisplayed == false || evt) {
|
||||
lcdRestoreBackupBuffer();
|
||||
popupDisplayed = lcdRestoreBackupBuffer();
|
||||
if (warn) DISPLAY_WARNING(evt);
|
||||
if (menu) {
|
||||
const char * result = displayPopupMenu(evt);
|
||||
|
@ -176,7 +176,6 @@ void guiMain(evt_t evt)
|
|||
}
|
||||
}
|
||||
refreshNeeded = true;
|
||||
popupDisplayed = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -2015,6 +2015,7 @@ enum MixSources {
|
|||
MIXSRC_SC, LUA_EXPORT("sc", "Switch C")
|
||||
MIXSRC_SE, LUA_EXPORT("se", "Switch E")
|
||||
MIXSRC_SF, LUA_EXPORT("sf", "Switch F")
|
||||
MIXSRC_LAST_SWITCH = MIXSRC_SF,
|
||||
#elif defined(PCBTARANIS) || defined(PCBHORUS)
|
||||
MIXSRC_SA = MIXSRC_FIRST_SWITCH, LUA_EXPORT("sa", "Switch A")
|
||||
MIXSRC_SB, LUA_EXPORT("sb", "Switch B")
|
||||
|
|
|
@ -470,17 +470,7 @@
|
|||
#define MAX_TRAINER_CHANNELS() (8)
|
||||
#endif
|
||||
|
||||
#if defined(PCBFLAMENCO)
|
||||
#define IS_MODULE_PPM(idx) (idx==TRAINER_MODULE || (idx==EXTERNAL_MODULE && g_model.moduleData[EXTERNAL_MODULE].type==MODULE_TYPE_PPM))
|
||||
#define IS_MODULE_XJT(idx) ((g_model.moduleData[EXTERNAL_MODULE].type==MODULE_TYPE_XJT) && (g_model.moduleData[idx].rfProtocol != RF_PROTO_OFF))
|
||||
#if defined(DSM2)
|
||||
#define IS_MODULE_DSM2(idx) (idx==EXTERNAL_MODULE && g_model.moduleData[EXTERNAL_MODULE].type==MODULE_TYPE_DSM2)
|
||||
#else
|
||||
#define IS_MODULE_DSM2(idx) (false)
|
||||
#endif
|
||||
#define MAX_EXTERNAL_MODULE_CHANNELS() ((g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_XJT) ? maxChannelsXJT[1+g_model.moduleData[1].rfProtocol] : maxChannelsModules[g_model.externalModule])
|
||||
#define MAX_CHANNELS(idx) (idx==EXTERNAL_MODULE ? MAX_EXTERNAL_MODULE_CHANNELS() : MAX_TRAINER_CHANNELS())
|
||||
#elif defined(PCBTARANIS)
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(TARANIS_INTERNAL_PPM)
|
||||
#define IS_MODULE_PPM(idx) (idx==TRAINER_MODULE || (idx==INTERNAL_MODULE && g_model.moduleData[INTERNAL_MODULE].type==MODULE_TYPE_PPM)|| (idx==EXTERNAL_MODULE && g_model.moduleData[EXTERNAL_MODULE].type==MODULE_TYPE_PPM))
|
||||
#define IS_MODULE_XJT(idx) (((idx==INTERNAL_MODULE && g_model.moduleData[INTERNAL_MODULE].type==MODULE_TYPE_XJT)|| (idx==EXTERNAL_MODULE && g_model.moduleData[EXTERNAL_MODULE].type==MODULE_TYPE_XJT)) && (g_model.moduleData[idx].rfProtocol != RF_PROTO_OFF))
|
||||
|
|
|
@ -162,6 +162,7 @@ void setupPulsesDSM2(unsigned int port)
|
|||
else if (moduleFlag[port] == MODULE_RANGECHECK)
|
||||
dsmDat[0] |= DSM2_SEND_RANGECHECK;
|
||||
#else
|
||||
#if defined(PCBSKY9X) // TODO needed?
|
||||
if (dsm2BindTimer > 0) {
|
||||
dsm2BindTimer--;
|
||||
if (switchState(SW_DSM2_BIND)) {
|
||||
|
@ -169,7 +170,9 @@ void setupPulsesDSM2(unsigned int port)
|
|||
dsmDat[0] |= DSM2_SEND_BIND;
|
||||
}
|
||||
}
|
||||
else if (moduleFlag[port] == MODULE_RANGECHECK) {
|
||||
else
|
||||
#endif
|
||||
if (moduleFlag[port] == MODULE_RANGECHECK) {
|
||||
dsmDat[0] |= DSM2_SEND_RANGECHECK;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -61,11 +61,7 @@ void setupPulsesPPM(unsigned int port) // Don't enable interru
|
|||
PpmPulsesData * ppmPulsesData = (port == TRAINER_MODULE ? &trainerPulsesData.ppm : &modulePulsesData[port].ppm);
|
||||
uint16_t * ptr = ppmPulsesData->pulses;
|
||||
|
||||
#if defined(PPM_PIN_HW_SERIAL)
|
||||
ppmPulsesData->index = 0;
|
||||
#else
|
||||
ppmPulsesData->ptr = ptr;
|
||||
#endif
|
||||
|
||||
int32_t rest = 22500u * 2;
|
||||
rest += (int32_t(g_model.moduleData[port].ppmFrameLength)) * 1000;
|
||||
|
|
|
@ -47,11 +47,12 @@ extern uint8_t s_current_protocol[NUM_MODULES];
|
|||
extern uint8_t s_pulses_paused;
|
||||
extern uint16_t failsafeCounter[NUM_MODULES];
|
||||
|
||||
#if defined(PPM_PIN_HW_SERIAL)
|
||||
PACK(struct PpmPulsesData {
|
||||
uint16_t pulses[20];
|
||||
uint32_t index;
|
||||
uint16_t * ptr;
|
||||
});
|
||||
|
||||
#if defined(PPM_PIN_HW_SERIAL)
|
||||
PACK(struct PxxPulsesData {
|
||||
uint8_t pulses[64];
|
||||
uint8_t *ptr;
|
||||
|
@ -68,10 +69,6 @@ PACK(struct Dsm2PulsesData {
|
|||
uint8_t serialBitCount;
|
||||
});
|
||||
#else
|
||||
PACK(struct PpmPulsesData {
|
||||
uint16_t pulses[20];
|
||||
uint16_t *ptr;
|
||||
});
|
||||
PACK(struct PxxPulsesData {
|
||||
uint16_t pulses[400];
|
||||
uint16_t *ptr;
|
||||
|
|
|
@ -250,7 +250,7 @@ void lcdRefresh(void);
|
|||
void lcdDrawSolidFilledRectDMA(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color);
|
||||
void lcdDrawBitmapDMA(uint16_t x, uint16_t y, uint16_t w, uint16_t h, const uint8_t * bitmap);
|
||||
void lcdStoreBackupBuffer(void);
|
||||
void lcdRestoreBackupBuffer(void);
|
||||
bool lcdRestoreBackupBuffer(void);
|
||||
|
||||
// Backlight driver
|
||||
#define setBacklight(xx)
|
||||
|
|
|
@ -519,10 +519,11 @@ void lcdStoreBackupBuffer()
|
|||
DMAcopy(src, dest, DISPLAY_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
void lcdRestoreBackupBuffer()
|
||||
bool lcdRestoreBackupBuffer()
|
||||
{
|
||||
uint16_t * dest = (uint16_t *)CurrentFrameBuffer, * src = (uint16_t *)LCD_BACKUP_FRAME_BUFFER;
|
||||
DMAcopy(src, dest, DISPLAY_BUFFER_SIZE);
|
||||
return true;
|
||||
}
|
||||
|
||||
void lcdRefresh()
|
||||
|
|
|
@ -1277,16 +1277,19 @@ void lcdRefresh()
|
|||
simuLcdRefresh = true;
|
||||
}
|
||||
|
||||
#if !defined(PCBFLAMENCO)
|
||||
display_t simuLcdBackupBuf[DISPLAY_BUFFER_SIZE];
|
||||
void lcdStoreBackupBuffer()
|
||||
{
|
||||
memcpy(simuLcdBackupBuf, displayBuf, sizeof(simuLcdBackupBuf));
|
||||
}
|
||||
|
||||
void lcdRestoreBackupBuffer()
|
||||
bool lcdRestoreBackupBuffer()
|
||||
{
|
||||
memcpy(displayBuf, simuLcdBackupBuf, sizeof(displayBuf));
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBFLAMENCO) || defined(PCBHORUS)
|
||||
void pwrInit() { }
|
||||
|
|
|
@ -448,6 +448,9 @@
|
|||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\006"
|
||||
#define TR_VKEYS "Menu\0 ""Exit\0 ""Enter\0""Up\0 ""Down\0 ""Right\0""Left"
|
||||
#elif defined(PCBFLAMENCO)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Menu\0""Exit\0""Enter""Page\0""Plus\0""Minus"
|
||||
#elif defined(PCBTARANIS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Menu\0""Exit\0""Enter""Page\0""Plus\0""Minus"
|
||||
|
|
|
@ -49,8 +49,10 @@ def createFontBitmap(filename, fontname, fontsize, fontbold, foreground, backgro
|
|||
|
||||
width = getFontWidth(fontsize, metrics)
|
||||
top, bottom = getFontTopBottom(fontsize, metrics)
|
||||
extraImage = QtGui.QImage("fonts/extra_%dpx.png" % fontsize)
|
||||
extraFilename = "fonts/extra_%dpx.png" % fontsize
|
||||
extraImage = QtGui.QImage(extraFilename)
|
||||
if extraImage.isNull():
|
||||
print "No extra font file", extraFilename
|
||||
extraWidth = 0
|
||||
else:
|
||||
extraWidth = extraImage.size().width()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue