Haptic strength will be selectable with a slider, with a default

position at center
This commit is contained in:
bsongis
2014-05-14 11:15:07 +02:00
parent cd42a7749e
commit 8f10bed8c1
12 changed files with 97 additions and 94 deletions
+2
View File
@@ -328,6 +328,8 @@ void ConvertGeneralSettings_215_to_216(EEGeneral &settings)
settings.chkSum = evalChkSum();
memcpy(&settings.currModel, &oldSettings.currModel, sizeof(GeneralSettings_v215)-offsetof(GeneralSettings_v215, currModel));
settings.hapticStrength = 0; // Haptic strength reset
}
int ConvertTelemetrySource_215_to_216(int source)
+1 -5
View File
@@ -418,11 +418,7 @@ void menuGeneralSetup(uint8_t event)
break;
case ITEM_SETUP_HAPTIC_STRENGTH:
lcd_putsLeft( y, STR_HAPTICSTRENGTH);
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.hapticStrength, attr|LEFT);
if (attr) {
CHECK_INCDEC_GENVAR(event, g_eeGeneral.hapticStrength, 0, 5);
}
SLIDER_5POS(y, g_eeGeneral.hapticStrength, STR_HAPTICSTRENGTH, event, attr);
break;
#endif
+2 -2
View File
@@ -55,14 +55,14 @@ void hapticQueue::heartbeat()
if (buzzTimeLeft > 0) {
buzzTimeLeft--; // time gets counted down
#if defined(PCBSKY9X) || (defined(PCBTARANIS) && defined(REVPLUS))
hapticOn(g_eeGeneral.hapticStrength * 20);
hapticOn(HAPTIC_STRENGTH() * 20);
#else
if (hapticTick-- > 0) {
HAPTIC_ON();
}
else {
HAPTIC_OFF();
hapticTick = g_eeGeneral.hapticStrength;
hapticTick = HAPTIC_STRENGTH();
}
#endif
}
+3 -1
View File
@@ -411,7 +411,7 @@ PACK(typedef struct t_EEGeneral {
N_PCBSTD_FIELD( uint8_t reNavigation)
N_TARANIS_FIELD(uint8_t stickReverse)
int8_t beepLength:3;
uint8_t hapticStrength:3;
int8_t hapticStrength:3;
uint8_t gpsFormat:1;
uint8_t unexpectedShutdown:1;
uint8_t speakerPitch;
@@ -425,6 +425,8 @@ PACK(typedef struct t_EEGeneral {
}) EEGeneral;
#define HAPTIC_STRENGTH() (3+g_eeGeneral.hapticStrength)
#if defined(PCBTARANIS)
#define LEN_MODEL_NAME 12
#define LEN_BITMAP_NAME 10