unifying (#1657)
This commit is contained in:
@@ -20,7 +20,7 @@ void postRToSInit() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (getSettingValue(SettingsOptions::BLEEnabled)) {
|
||||
if (getSettingValue(SettingsOptions::BluetoothLE)) {
|
||||
ble_stack_start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (((lastCapabilities[i] & PD_APDO_TYPE) == PD_APDO_TYPE_PPS)) && getSettingValue(SettingsOptions::PDVpdoEnabled)) {
|
||||
} else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (((lastCapabilities[i] & PD_APDO_TYPE) == PD_APDO_TYPE_PPS)) && getSettingValue(SettingsOptions::PDVpdo)) {
|
||||
// If this is a PPS slot, calculate the max voltage in the PPS range that can we be used and maintain
|
||||
uint16_t max_voltage = PD_PAV2MV(PD_APDO_PPS_MAX_VOLTAGE_GET(lastCapabilities[i]));
|
||||
// uint16_t min_voltage = PD_PAV2MV(PD_APDO_PPS_MIN_VOLTAGE_GET(lastCapabilities[i]));
|
||||
@@ -179,7 +179,7 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
|
||||
}
|
||||
}
|
||||
#ifdef POW_EPR
|
||||
else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (((lastCapabilities[i] & PD_APDO_TYPE) == PD_APDO_TYPE_AVS)) && getSettingValue(SettingsOptions::PDVpdoEnabled)) {
|
||||
else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (((lastCapabilities[i] & PD_APDO_TYPE) == PD_APDO_TYPE_AVS)) && getSettingValue(SettingsOptions::PDVpdo)) {
|
||||
uint16_t max_voltage = PD_PAV2MV(PD_APDO_AVS_MAX_VOLTAGE_GET(lastCapabilities[i]));
|
||||
uint8_t max_wattage = PD_APDO_AVS_MAX_POWER_GET(lastCapabilities[i]);
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ enum SettingsOptions {
|
||||
OLEDBrightness = 34, // Brightness for the OLED display
|
||||
LOGOTime = 35, // Duration the logo will be displayed for
|
||||
CalibrateCJC = 36, // Toggle calibrate CJC at next boot
|
||||
BLEEnabled = 37, // Should BLE hardware be enabled if present
|
||||
PDVpdoEnabled = 38, // Should PPS/EPR be enabled
|
||||
BluetoothLE = 37, // Toggle BLE if present
|
||||
PDVpdo = 38, // Toggle PPS & EPR
|
||||
//
|
||||
SettingsOptionsLength = 39, //
|
||||
};
|
||||
|
||||
@@ -55,6 +55,7 @@ enum class SettingsItemIndex : uint8_t {
|
||||
MinVolCell,
|
||||
QCMaxVoltage,
|
||||
PDNegTimeout,
|
||||
PDVpdo,
|
||||
BoostTemperature,
|
||||
AutoStart,
|
||||
TempChangeShortStep,
|
||||
@@ -77,6 +78,7 @@ enum class SettingsItemIndex : uint8_t {
|
||||
LOGOTime,
|
||||
AdvancedIdle,
|
||||
AdvancedSoldering,
|
||||
BluetoothLE,
|
||||
PowerLimit,
|
||||
CalibrateCJC,
|
||||
VoltageCalibration,
|
||||
@@ -85,8 +87,6 @@ enum class SettingsItemIndex : uint8_t {
|
||||
PowerPulseDuration,
|
||||
SettingsReset,
|
||||
LanguageSwitch,
|
||||
BLEEnabled,
|
||||
PDVpdoEnabled,
|
||||
NUM_ITEMS,
|
||||
};
|
||||
|
||||
|
||||
@@ -86,8 +86,8 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
|
||||
{MIN_BRIGHTNESS, MAX_BRIGHTNESS, BRIGHTNESS_STEP, DEFAULT_BRIGHTNESS}, // OLEDBrightness
|
||||
{0, 5, 1, 1}, // LOGOTime
|
||||
{0, 1, 1, 0}, // CalibrateCJC
|
||||
{0, 1, 1, 1}, // BLEEnabled
|
||||
{0, 1, 1, 1}, // PDVpdoEnabled
|
||||
{0, 1, 1, 1}, // BluetoothLE
|
||||
{0, 1, 1, 1}, // PDVpdo
|
||||
};
|
||||
static_assert((sizeof(settingsConstants) / sizeof(SettingConstants)) == ((int)SettingsOptions::SettingsOptionsLength));
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ static void displayQCInputV(void);
|
||||
#endif
|
||||
#if POW_PD
|
||||
static void displayPDNegTimeout(void);
|
||||
static void displayPDVpdoEnabled(void);
|
||||
static void displayPDVpdo(void);
|
||||
#endif
|
||||
static void displaySensitivity(void);
|
||||
static void displayShutdownTime(void);
|
||||
@@ -43,7 +43,7 @@ static void displayAdvancedIDLEScreens(void);
|
||||
static void displayScrollSpeed(void);
|
||||
static void displayPowerLimit(void);
|
||||
#ifdef BLE_ENABLED
|
||||
static void displayBLEEnabled(void);
|
||||
static void displayBluetoothLE(void);
|
||||
#endif
|
||||
#ifndef NO_DISPLAY_ROTATE
|
||||
static bool setDisplayRotation(void);
|
||||
@@ -101,6 +101,7 @@ static bool enterAdvancedMenu(void);
|
||||
* -Minimum Voltage
|
||||
* QC Voltage
|
||||
* PD Timeout
|
||||
* PDVpdo
|
||||
*
|
||||
* Soldering
|
||||
* Boost Mode Temp
|
||||
@@ -131,6 +132,7 @@ static bool enterAdvancedMenu(void);
|
||||
* Detailed Soldering
|
||||
*
|
||||
* Advanced
|
||||
* BluetoothLE
|
||||
* Power Limit
|
||||
* Calibrate CJC At Next Boot
|
||||
* Calibrate Input V
|
||||
@@ -170,6 +172,7 @@ const menuitem powerMenu[] = {
|
||||
* -Minimum Voltage
|
||||
* QC Voltage
|
||||
* PD Timeout
|
||||
* PDVpdo
|
||||
*/
|
||||
#ifdef POW_DC
|
||||
{SETTINGS_DESC(SettingsItemIndex::DCInCutoff), nullptr, displayInputVRange, nullptr, SettingsOptions::MinDCVoltageCells, SettingsItemIndex::DCInCutoff, 6}, /*Voltage input*/
|
||||
@@ -180,7 +183,7 @@ const menuitem powerMenu[] = {
|
||||
#endif
|
||||
#if POW_PD
|
||||
{SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), nullptr, displayPDNegTimeout, nullptr, SettingsOptions::PDNegTimeout, SettingsItemIndex::PDNegTimeout, 5}, /*PD timeout setup*/
|
||||
{SETTINGS_DESC(SettingsItemIndex::PDVpdoEnabled), nullptr, displayPDVpdoEnabled, nullptr, SettingsOptions::PDVpdoEnabled, SettingsItemIndex::PDVpdoEnabled, 7 }, /*Toggle whether to use PPS/EPR*/
|
||||
{SETTINGS_DESC(SettingsItemIndex::PDVpdo), nullptr, displayPDVpdo, nullptr, SettingsOptions::PDVpdo, SettingsItemIndex::PDVpdo, 7 }, /*Toggle PPS & EPR*/
|
||||
#endif
|
||||
{0, nullptr, nullptr, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::NUM_ITEMS, 0} // end of menu marker. DO NOT REMOVE
|
||||
};
|
||||
@@ -261,7 +264,7 @@ const menuitem UIMenu[] = {
|
||||
};
|
||||
const menuitem advancedMenu[] = {
|
||||
/*
|
||||
* BLE Enabled or not
|
||||
* BluetoothLE
|
||||
* Power Limit
|
||||
* Calibrate CJC At Next Boot
|
||||
* Calibrate Input V
|
||||
@@ -271,7 +274,7 @@ const menuitem advancedMenu[] = {
|
||||
* Factory Reset
|
||||
*/
|
||||
#ifdef BLE_ENABLED
|
||||
{SETTINGS_DESC(SettingsItemIndex::BLEEnabled), nullptr, displayBLEEnabled, nullptr, SettingsOptions::BLEEnabled, SettingsItemIndex::BLEEnabled, 7}, /*Advanced idle screen*/
|
||||
{SETTINGS_DESC(SettingsItemIndex::BluetoothLE), nullptr, displayBluetoothLE, nullptr, SettingsOptions::BluetoothLE, SettingsItemIndex::BluetoothLE, 7}, /*Toggle BLE*/
|
||||
#endif
|
||||
{SETTINGS_DESC(SettingsItemIndex::PowerLimit), nullptr, displayPowerLimit, nullptr, SettingsOptions::PowerLimit, SettingsItemIndex::PowerLimit, 4}, /*Power limit*/
|
||||
{SETTINGS_DESC(SettingsItemIndex::CalibrateCJC), setCalibrate, displayCalibrate, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::CalibrateCJC,
|
||||
@@ -378,7 +381,7 @@ static void displayPDNegTimeout(void) {
|
||||
OLED::printNumber(value, 3, FontStyle::LARGE);
|
||||
}
|
||||
}
|
||||
static void displayPDVpdoEnabled(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::PDVpdoEnabled)); }
|
||||
static void displayPDVpdo(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::PDVpdo)); }
|
||||
#endif
|
||||
|
||||
static bool setBoostTemp(void) {
|
||||
@@ -644,7 +647,7 @@ static void displayAdvancedIDLEScreens(void) { OLED::drawCheckbox(getSettingValu
|
||||
|
||||
static void displayAdvancedSolderingScreens(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::DetailedSoldering)); }
|
||||
#ifdef BLE_ENABLED
|
||||
static void displayBLEEnabled(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::BLEEnabled)); }
|
||||
static void displayBluetoothLE(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::BluetoothLE)); }
|
||||
#endif
|
||||
static void displayPowerLimit(void) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user