Hall Effect Sensitivities
This commit is contained in:
@@ -54,8 +54,7 @@ typedef struct {
|
|||||||
uint8_t ReverseButtonTempChangeEnabled; // Change the plus and minus button assigment
|
uint8_t ReverseButtonTempChangeEnabled; // Change the plus and minus button assigment
|
||||||
uint16_t TempChangeLongStep; // Change the plus and minus button assigment
|
uint16_t TempChangeLongStep; // Change the plus and minus button assigment
|
||||||
uint16_t TempChangeShortStep; // Change the plus and minus button assigment
|
uint16_t TempChangeShortStep; // Change the plus and minus button assigment
|
||||||
uint8_t hallEffectMode; //Operating mode of the hall effect sensor
|
uint8_t hallEffectSensitivity; //Operating mode of the hall effect sensor
|
||||||
int16_t hallEffectThreshold; //Threshold of the halleffect sensor
|
|
||||||
uint32_t padding; // This is here for in case we are not an even divisor so
|
uint32_t padding; // This is here for in case we are not an even divisor so
|
||||||
// that nothing gets cut off
|
// that nothing gets cut off
|
||||||
//MUST BE LAST
|
//MUST BE LAST
|
||||||
@@ -67,6 +66,7 @@ extern volatile systemSettingsType systemSettings;
|
|||||||
void saveSettings();
|
void saveSettings();
|
||||||
bool restoreSettings();
|
bool restoreSettings();
|
||||||
uint8_t lookupVoltageLevel(uint8_t level);
|
uint8_t lookupVoltageLevel(uint8_t level);
|
||||||
|
uint16_t lookupHallEffectThreshold();
|
||||||
void resetSettings();
|
void resetSettings();
|
||||||
|
|
||||||
#endif /* SETTINGS_H_ */
|
#endif /* SETTINGS_H_ */
|
||||||
|
|||||||
@@ -77,5 +77,22 @@ void resetSettings() {
|
|||||||
systemSettings.TempChangeLongStep = TEMP_CHANGE_LONG_STEP; //
|
systemSettings.TempChangeLongStep = TEMP_CHANGE_LONG_STEP; //
|
||||||
systemSettings.KeepAwakePulse = POWER_PULSE_DEFAULT;
|
systemSettings.KeepAwakePulse = POWER_PULSE_DEFAULT;
|
||||||
systemSettings.TipGain = TIP_GAIN;
|
systemSettings.TipGain = TIP_GAIN;
|
||||||
|
systemSettings.hallEffectSensitivity=1;
|
||||||
saveSettings(); // Save defaults
|
saveSettings(); // Save defaults
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t lookupHallEffectThreshold() {
|
||||||
|
// Return the threshold above which the hall effect sensor is "activated"
|
||||||
|
switch (systemSettings.hallEffectSensitivity) {
|
||||||
|
case 0:
|
||||||
|
return 0;
|
||||||
|
case 1: //Low
|
||||||
|
return 1000;
|
||||||
|
case 2: //Medium
|
||||||
|
return 500;
|
||||||
|
case 3: //High
|
||||||
|
return 100;
|
||||||
|
default:
|
||||||
|
return 0; //Off
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user