Fixes #1551
This commit is contained in:
@@ -106,7 +106,7 @@
|
|||||||
These will be relevant for all models in the same EEPROM.</string>
|
These will be relevant for all models in the same EEPROM.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabSetup">
|
<widget class="QWidget" name="tabSetup">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -275,7 +275,10 @@ These will be relevant for all models in the same EEPROM.</string>
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QSlider" name="backlightColor_SL">
|
<widget class="QSlider" name="backlightColor_SL">
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>100</number>
|
<number>17</number>
|
||||||
|
</property>
|
||||||
|
<property name="pageStep">
|
||||||
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ const MenuFuncP_PROGMEM menuTabDiag[] PROGMEM = {
|
|||||||
#define RADIO_SETUP_DATE_COLUMN RADIO_SETUP_2ND_COLUMN + 4*FWNUM
|
#define RADIO_SETUP_DATE_COLUMN RADIO_SETUP_2ND_COLUMN + 4*FWNUM
|
||||||
#define RADIO_SETUP_TIME_COLUMN RADIO_SETUP_2ND_COLUMN + 2*FWNUM
|
#define RADIO_SETUP_TIME_COLUMN RADIO_SETUP_2ND_COLUMN + 2*FWNUM
|
||||||
#else
|
#else
|
||||||
#define RADIO_SETUP_2ND_COLUMN (LCD_W-6*FW-3-MENUS_SCROLLBAR_WIDTH)
|
#define RADIO_SETUP_2ND_COLUMN (LCD_W-6*FW-1-MENUS_SCROLLBAR_WIDTH)
|
||||||
#define RADIO_SETUP_TIME_COLUMN (FW*15+9)
|
#define RADIO_SETUP_TIME_COLUMN (FW*15+9)
|
||||||
#define RADIO_SETUP_DATE_COLUMN (FW*15+5)
|
#define RADIO_SETUP_DATE_COLUMN (FW*15+5)
|
||||||
#endif
|
#endif
|
||||||
@@ -229,16 +229,16 @@ void menuGeneralSetup(uint8_t event)
|
|||||||
#if defined(RTCLOCK)
|
#if defined(RTCLOCK)
|
||||||
case ITEM_SETUP_DATE:
|
case ITEM_SETUP_DATE:
|
||||||
lcd_putsLeft(y, STR_DATE);
|
lcd_putsLeft(y, STR_DATE);
|
||||||
lcd_putc(RADIO_SETUP_DATE_COLUMN+2, y, '-'); lcd_putc(RADIO_SETUP_DATE_COLUMN+3*FW, y, '-');
|
lcd_putc(RADIO_SETUP_DATE_COLUMN, y, '-'); lcd_putc(RADIO_SETUP_DATE_COLUMN+3*FW-2, y, '-');
|
||||||
for (uint8_t j=0; j<3; j++) {
|
for (uint8_t j=0; j<3; j++) {
|
||||||
uint8_t rowattr = (m_posHorz==j ? attr : 0);
|
uint8_t rowattr = (m_posHorz==j ? attr : 0);
|
||||||
switch (j) {
|
switch (j) {
|
||||||
case 0:
|
case 0:
|
||||||
lcd_outdezAtt(RADIO_SETUP_DATE_COLUMN+2, y, t.tm_year+1900, rowattr);
|
lcd_outdezAtt(RADIO_SETUP_DATE_COLUMN, y, t.tm_year+1900, rowattr);
|
||||||
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_year = checkIncDec(event, t.tm_year, 112, 200, 0);
|
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_year = checkIncDec(event, t.tm_year, 112, 200, 0);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
lcd_outdezNAtt(RADIO_SETUP_DATE_COLUMN+3*FW, y, t.tm_mon+1, rowattr|LEADING0, 2);
|
lcd_outdezNAtt(RADIO_SETUP_DATE_COLUMN+3*FW-2, y, t.tm_mon+1, rowattr|LEADING0, 2);
|
||||||
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mon = checkIncDec(event, t.tm_mon, 0, 11, 0);
|
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mon = checkIncDec(event, t.tm_mon, 0, 11, 0);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@@ -247,7 +247,7 @@ void menuGeneralSetup(uint8_t event)
|
|||||||
int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0);
|
int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0);
|
||||||
static const pm_uint8_t dmon[] PROGMEM = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
static const pm_uint8_t dmon[] PROGMEM = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||||
dlim += pgm_read_byte(&dmon[t.tm_mon]);
|
dlim += pgm_read_byte(&dmon[t.tm_mon]);
|
||||||
lcd_outdezNAtt(RADIO_SETUP_DATE_COLUMN+6*FW-2, y, t.tm_mday, rowattr|LEADING0, 2);
|
lcd_outdezNAtt(RADIO_SETUP_DATE_COLUMN+6*FW-4, y, t.tm_mday, rowattr|LEADING0, 2);
|
||||||
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0);
|
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -531,8 +531,8 @@ void menuGeneralSetup(uint8_t event)
|
|||||||
#if defined(PCBTARANIS) && defined(REVPLUS)
|
#if defined(PCBTARANIS) && defined(REVPLUS)
|
||||||
case ITEM_SETUP_BACKLIGHT_COLOR:
|
case ITEM_SETUP_BACKLIGHT_COLOR:
|
||||||
lcd_putsLeft(y, STR_BLCOLOR);
|
lcd_putsLeft(y, STR_BLCOLOR);
|
||||||
displaySlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 100, attr);
|
displaySlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 17, attr);
|
||||||
if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 100, EE_GENERAL | NO_INCDEC_MARKS);
|
if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 17, EE_GENERAL | NO_INCDEC_MARKS);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -338,6 +338,9 @@ void lcdSetRefVolt(uint8_t val)
|
|||||||
#if defined(REVPLUS)
|
#if defined(REVPLUS)
|
||||||
void turnBacklightOn(uint8_t level, uint8_t color)
|
void turnBacklightOn(uint8_t level, uint8_t color)
|
||||||
{
|
{
|
||||||
|
if (color >= 9 && color <= 17) {
|
||||||
|
color += 83;
|
||||||
|
}
|
||||||
TIM4->CCR4 = (100-level)*color;
|
TIM4->CCR4 = (100-level)*color;
|
||||||
TIM4->CCR2 = (100-level)*(100-color);
|
TIM4->CCR2 = (100-level)*(100-color);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user