New UI merged
This commit is contained in:
@@ -557,10 +557,10 @@ void lcdDrawVerticalLine(coord_t x, coord_t y, coord_t h, uint8_t pat, LcdFlags
|
||||
y = (y & 0x07);
|
||||
if (y) {
|
||||
ASSERT_IN_DISPLAY(p);
|
||||
uint8_t msk = ~(BITMASK(y)-1);
|
||||
uint8_t msk = ~(bfBitmask<uint8_t>(y));
|
||||
h -= 8-y;
|
||||
if (h < 0)
|
||||
msk -= ~(BITMASK(8+h)-1);
|
||||
msk -= ~(bfBitmask<uint8_t>(8 + h));
|
||||
lcdMaskPoint(p, msk & pat, att);
|
||||
p += LCD_W;
|
||||
}
|
||||
@@ -572,7 +572,7 @@ void lcdDrawVerticalLine(coord_t x, coord_t y, coord_t h, uint8_t pat, LcdFlags
|
||||
}
|
||||
if (h > 0) {
|
||||
ASSERT_IN_DISPLAY(p);
|
||||
lcdMaskPoint(p, (BITMASK(h)-1) & pat, att);
|
||||
lcdMaskPoint(p, (bfBitmask<uint8_t>(h)) & pat, att);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -953,7 +953,7 @@ void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att)
|
||||
{
|
||||
uint8_t * p = &displayBuf[ y / 8 * LCD_W + x ];
|
||||
if (p < DISPLAY_END) {
|
||||
lcdMaskPoint(p, BITMASK(y % 8), att);
|
||||
lcdMaskPoint(p, bfBit<uint8_t>(y % 8), att);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -975,7 +975,7 @@ void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlag
|
||||
if (x+w > LCD_W) { w = LCD_W - x; }
|
||||
|
||||
uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ];
|
||||
uint8_t msk = BITMASK(y%8);
|
||||
uint8_t msk = bfBit<uint8_t>(y % 8);
|
||||
while (w--) {
|
||||
if(pat&1) {
|
||||
lcdMaskPoint(p, msk, att);
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
typedef int coord_t;
|
||||
struct point_t
|
||||
{
|
||||
coord_t x;
|
||||
coord_t y;
|
||||
};
|
||||
typedef uint32_t LcdFlags;
|
||||
typedef uint8_t display_t;
|
||||
|
||||
|
||||
@@ -46,16 +46,19 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_NAME,
|
||||
ITEM_MODEL_SETUP_TIMER1,
|
||||
ITEM_MODEL_SETUP_TIMER1_NAME,
|
||||
ITEM_MODEL_SETUP_TIMER1_START,
|
||||
ITEM_MODEL_SETUP_TIMER1_PERSISTENT,
|
||||
ITEM_MODEL_SETUP_TIMER1_MINUTE_BEEP,
|
||||
ITEM_MODEL_SETUP_TIMER1_COUNTDOWN_BEEP,
|
||||
ITEM_MODEL_SETUP_TIMER2,
|
||||
ITEM_MODEL_SETUP_TIMER2_NAME,
|
||||
ITEM_MODEL_SETUP_TIMER2_START,
|
||||
ITEM_MODEL_SETUP_TIMER2_PERSISTENT,
|
||||
ITEM_MODEL_SETUP_TIMER2_MINUTE_BEEP,
|
||||
ITEM_MODEL_SETUP_TIMER2_COUNTDOWN_BEEP,
|
||||
ITEM_MODEL_SETUP_TIMER3,
|
||||
ITEM_MODEL_SETUP_TIMER3_NAME,
|
||||
ITEM_MODEL_SETUP_TIMER3_START,
|
||||
ITEM_MODEL_SETUP_TIMER3_PERSISTENT,
|
||||
ITEM_MODEL_SETUP_TIMER3_MINUTE_BEEP,
|
||||
ITEM_MODEL_SETUP_TIMER3_COUNTDOWN_BEEP,
|
||||
@@ -207,7 +210,7 @@ inline uint8_t EXTERNAL_MODULE_TYPE_ROW()
|
||||
}
|
||||
|
||||
#define POT_WARN_ROWS ((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0)
|
||||
#define TIMER_ROWS 2, 0, 0, 0, 0
|
||||
#define TIMER_ROWS 1, 0, 1, 0, 0, 0
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
#define EXTRA_MODULE_ROWS LABEL(ExtraModule), 1, 2,
|
||||
@@ -409,41 +412,42 @@ void menuModelSetup(event_t event)
|
||||
unsigned int timerIdx = (k>=ITEM_MODEL_SETUP_TIMER3 ? 2 : (k>=ITEM_MODEL_SETUP_TIMER2 ? 1 : 0));
|
||||
TimerData * timer = &g_model.timers[timerIdx];
|
||||
drawStringWithIndex(0*FW, y, STR_TIMER, timerIdx+1);
|
||||
drawTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, menuHorizontalPosition==0 ? attr : 0);
|
||||
drawTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, RIGHT | (menuHorizontalPosition==1 ? attr : 0), menuHorizontalPosition==2 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VTMRMODES, timer->mode, menuHorizontalPosition==0 ? attr : 0);
|
||||
drawSwitch(MODEL_SETUP_2ND_COLUMN+5*FW, y, timer->swtch, menuHorizontalPosition==1 ? attr : 0);
|
||||
if (attr && s_editMode > 0) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, timer->mode, TMRMODE_MAX);
|
||||
break;
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELSWITCH(event, timer->swtch, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM_MODEL_SETUP_TIMER1_START:
|
||||
case ITEM_MODEL_SETUP_TIMER2_START:
|
||||
case ITEM_MODEL_SETUP_TIMER3_START:
|
||||
{
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_START);
|
||||
TimerData *timer = &g_model.timers[k >= ITEM_MODEL_SETUP_TIMER3 ? 2 : (k >= ITEM_MODEL_SETUP_TIMER2 ? 1 : 0)];
|
||||
drawTimer(MODEL_SETUP_2ND_COLUMN, y, timer->start, menuHorizontalPosition == 0 ? attr : 0, menuHorizontalPosition == 1 ? attr : 0);
|
||||
if (attr && s_editMode > 0) {
|
||||
div_t qr = div(timer->start, 60);
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
{
|
||||
swsrc_t timerMode = timer->mode;
|
||||
if (timerMode < 0)
|
||||
timerMode -= TMRMODE_COUNT-1;
|
||||
CHECK_INCDEC_MODELVAR_CHECK(event, timerMode, -TMRMODE_COUNT-SWSRC_LAST+1, TMRMODE_COUNT+SWSRC_LAST-1, isSwitchAvailableInTimers);
|
||||
if (timerMode < 0)
|
||||
timerMode += TMRMODE_COUNT-1;
|
||||
timer->mode = timerMode;
|
||||
#if defined(AUTOSWITCH)
|
||||
if (s_editMode>0) {
|
||||
int8_t val = timer->mode - (TMRMODE_COUNT-1);
|
||||
int8_t switchVal = checkIncDecMovedSwitch(val);
|
||||
if (val != switchVal) {
|
||||
timer->mode = switchVal + (TMRMODE_COUNT-1);
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 539); // 8:59
|
||||
timer->start = qr.rem + qr.quot*60;
|
||||
timer->start = qr.rem + qr.quot * 60;
|
||||
break;
|
||||
case 2:
|
||||
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
|
||||
timer->start -= qr.rem ;
|
||||
if ((int16_t)timer->start < 0) timer->start=0;
|
||||
if ((int16_t)timer->start > 5999) timer->start=32399; // 8:59:59
|
||||
case 1:
|
||||
qr.rem -= checkIncDecModel(event, qr.rem + 2, 1, 62) - 2;
|
||||
timer->start -= qr.rem;
|
||||
if ((int16_t) timer->start < 0)
|
||||
timer->start = 0;
|
||||
if ((int16_t) timer->start > 5999)
|
||||
timer->start = 32399; // 8:59:59
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ void menuRadioSetup(event_t event)
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.pwrOffSpeed, -1, 2);
|
||||
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);
|
||||
|
||||
@@ -179,12 +179,10 @@ void drawTimerWithMode(coord_t x, coord_t y, uint8_t index)
|
||||
drawTimer(x, y, timerState.val, att, att);
|
||||
uint8_t xLabel = (negative ? x-56 : x-49);
|
||||
uint8_t len = zlen(timer.name, LEN_TIMER_NAME);
|
||||
if (len > 0) {
|
||||
if (len > 0)
|
||||
lcdDrawSizedText(xLabel, y+FH, timer.name, len, RIGHT | ZCHAR);
|
||||
}
|
||||
else {
|
||||
drawTimerMode(xLabel, y+FH, timer.mode, RIGHT);
|
||||
}
|
||||
else
|
||||
lcdDrawTextAtIndex(xLabel, y+FH, STR_VTMRMODES, timer.mode, RIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user