[stock] Flash saving
This commit is contained in:
+10
-6
@@ -560,7 +560,7 @@ void menuModelSelect(uint8_t event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, bool active)
|
void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uint8_t active)
|
||||||
{
|
{
|
||||||
#if defined(CPUM64)
|
#if defined(CPUM64)
|
||||||
// in order to save flash
|
// in order to save flash
|
||||||
@@ -655,7 +655,7 @@ void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, boo
|
|||||||
#if defined(CPUM64)
|
#if defined(CPUM64)
|
||||||
#define editSingleName(x, y, label, name, size, event, active) editName(x, y, name, size, event, active)
|
#define editSingleName(x, y, label, name, size, event, active) editName(x, y, name, size, event, active)
|
||||||
#else
|
#else
|
||||||
void editSingleName(uint8_t x, uint8_t y, const pm_char *label, char *name, uint8_t size, uint8_t event, bool active)
|
void editSingleName(uint8_t x, uint8_t y, const pm_char *label, char *name, uint8_t size, uint8_t event, uint8_t active)
|
||||||
{
|
{
|
||||||
lcd_putsLeft(y, label);
|
lcd_putsLeft(y, label);
|
||||||
editName(x, y, name, size, event, active);
|
editName(x, y, name, size, event, active);
|
||||||
@@ -2488,21 +2488,25 @@ void menuModelLimits(uint8_t event)
|
|||||||
if (active) ld->max = -100 + checkIncDecModel(event, ld->max+100, -25, limit);
|
if (active) ld->max = -100 + checkIncDecModel(event, ld->max+100, -25, limit);
|
||||||
break;
|
break;
|
||||||
case ITEM_LIMITS_DIRECTION:
|
case ITEM_LIMITS_DIRECTION:
|
||||||
|
{
|
||||||
|
uint8_t revert = ld->revert;
|
||||||
#if defined(PPM_CENTER_ADJUSTABLE) && LCD < 212
|
#if defined(PPM_CENTER_ADJUSTABLE) && LCD < 212
|
||||||
lcd_putcAtt(LIMITS_REVERT_POS, y, ld->revert ? 127 : 126, attr);
|
lcd_putcAtt(LIMITS_REVERT_POS, y, revert ? 127 : 126, attr);
|
||||||
#else
|
#else
|
||||||
lcd_putsiAtt(LIMITS_REVERT_POS, y, STR_MMMINV, ld->revert, attr);
|
lcd_putsiAtt(LIMITS_REVERT_POS, y, STR_MMMINV, revert, attr);
|
||||||
#endif
|
#endif
|
||||||
if (active) {
|
if (active) {
|
||||||
bool revert_new = checkIncDecModel(event, ld->revert, 0, 1);
|
uint8_t revert_new = checkIncDecModel(event, revert, 0, 1);
|
||||||
if (checkIncDec_Ret && thrOutput(k)) {
|
if (checkIncDec_Ret && thrOutput(k)) {
|
||||||
s_warning = STR_INVERT_THR;
|
s_warning = STR_INVERT_THR;
|
||||||
s_warning_type = WARNING_TYPE_CONFIRM;
|
s_warning_type = WARNING_TYPE_CONFIRM;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
ld->revert = revert_new;
|
ld->revert = revert_new;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
#if defined(PPM_CENTER_ADJUSTABLE)
|
#if defined(PPM_CENTER_ADJUSTABLE)
|
||||||
case ITEM_LIMITS_PPM_CENTER:
|
case ITEM_LIMITS_PPM_CENTER:
|
||||||
lcd_outdezAtt(LIMITS_PPM_CENTER_POS, y, PPM_CENTER+ld->ppmCenter, attr);
|
lcd_outdezAtt(LIMITS_PPM_CENTER_POS, y, PPM_CENTER+ld->ppmCenter, attr);
|
||||||
|
|||||||
+1
-1
@@ -471,7 +471,7 @@ int16_t expo(int16_t x, int16_t k)
|
|||||||
{
|
{
|
||||||
if (k == 0) return x;
|
if (k == 0) return x;
|
||||||
int16_t y;
|
int16_t y;
|
||||||
bool neg = x < 0;
|
bool neg = x < 0;
|
||||||
if (neg) x = -x;
|
if (neg) x = -x;
|
||||||
if (k<0) {
|
if (k<0) {
|
||||||
y = RESXu-expou(RESXu-x, -k);
|
y = RESXu-expou(RESXu-x, -k);
|
||||||
|
|||||||
Reference in New Issue
Block a user