mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Second pass
This commit is contained in:
@@ -16,7 +16,7 @@ void power_check() {
|
|||||||
if (FUSB302_present) {
|
if (FUSB302_present) {
|
||||||
PolicyEngine::PPSTimerCallback();
|
PolicyEngine::PPSTimerCallback();
|
||||||
// Cant start QC until either PD works or fails
|
// Cant start QC until either PD works or fails
|
||||||
if (PolicyEngine::setupCompleteOrTimedOut(systemSettings.PDNegTimeout) == false) {
|
if (PolicyEngine::setupCompleteOrTimedOut(getSettingValue(SettingsOptions::PDNegTimeout)) == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PolicyEngine::pdHasNegotiated()) {
|
if (PolicyEngine::pdHasNegotiated()) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void power_check() {
|
|||||||
if (FUSB302_present) {
|
if (FUSB302_present) {
|
||||||
PolicyEngine::PPSTimerCallback();
|
PolicyEngine::PPSTimerCallback();
|
||||||
// Cant start QC until either PD works or fails
|
// Cant start QC until either PD works or fails
|
||||||
if (PolicyEngine::setupCompleteOrTimedOut(systemSettings.PDNegTimeout) == false) {
|
if (PolicyEngine::setupCompleteOrTimedOut(getSettingValue(SettingsOptions::PDNegTimeout)) == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PolicyEngine::pdHasNegotiated()) {
|
if (PolicyEngine::pdHasNegotiated()) {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ uint8_t QC_DM_PulledDown() { return HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_11) == GPIO
|
|||||||
#endif
|
#endif
|
||||||
void QC_resync() {
|
void QC_resync() {
|
||||||
#ifdef POW_QC
|
#ifdef POW_QC
|
||||||
seekQC((systemSettings.QCIdealVoltage) ? 120 : 90,
|
seekQC((getSettingValue(SettingsOptions::QCIdealVoltage)) ? 120 : 90,
|
||||||
systemSettings.voltageDiv); // Run the QC seek again if we have drifted too much
|
getSettingValue(SettingsOptions::VoltageDiv)); // Run the QC seek again if we have drifted too much
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void power_check() {
|
|||||||
if (FUSB302_present) {
|
if (FUSB302_present) {
|
||||||
PolicyEngine::PPSTimerCallback();
|
PolicyEngine::PPSTimerCallback();
|
||||||
// Cant start QC until either PD works or fails
|
// Cant start QC until either PD works or fails
|
||||||
if (PolicyEngine::setupCompleteOrTimedOut(systemSettings.PDNegTimeout) == false) {
|
if (PolicyEngine::setupCompleteOrTimedOut(getSettingValue(SettingsOptions::PDNegTimeout)) == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PolicyEngine::pdHasNegotiated()) {
|
if (PolicyEngine::pdHasNegotiated()) {
|
||||||
@@ -43,7 +43,7 @@ uint8_t usb_pd_detect() {
|
|||||||
|
|
||||||
bool getIsPoweredByDCIN() {
|
bool getIsPoweredByDCIN() {
|
||||||
// We return false until we are sure we are not using PD
|
// We return false until we are sure we are not using PD
|
||||||
if (PolicyEngine::setupCompleteOrTimedOut(systemSettings.PDNegTimeout) == false) {
|
if (PolicyEngine::setupCompleteOrTimedOut(getSettingValue(SettingsOptions::PDNegTimeout)) == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (PolicyEngine::pdHasNegotiated()) {
|
if (PolicyEngine::pdHasNegotiated()) {
|
||||||
|
|||||||
@@ -47,12 +47,12 @@ uint8_t QC_DM_PulledDown() { return gpio_input_bit_get(USB_DM_LOW_GPIO_Port, USB
|
|||||||
void QC_resync() {
|
void QC_resync() {
|
||||||
#ifdef POW_QC
|
#ifdef POW_QC
|
||||||
uint8_t targetvoltage = 90;
|
uint8_t targetvoltage = 90;
|
||||||
if (systemSettings.QCIdealVoltage == 1) {
|
if (getSettingValue(SettingsOptions::QCIdealVoltage) == 1) {
|
||||||
targetvoltage = 120;
|
targetvoltage = 120;
|
||||||
} else if (systemSettings.QCIdealVoltage == 2) {
|
} else if (getSettingValue(SettingsOptions::QCIdealVoltage) == 2) {
|
||||||
targetvoltage = 200;
|
targetvoltage = 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
seekQC(targetvoltage, systemSettings.voltageDiv); // Run the QC seek again if we have drifted too much
|
seekQC(targetvoltage, getSettingValue(SettingsOptions::VoltageDiv)); // Run the QC seek again if we have drifted too much
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,3 +250,9 @@ const uint8_t tipResistance = 45; // x10 ohms, 4.5 typical for ts80 tips
|
|||||||
const uint32_t tipMass = 45; // TODO
|
const uint32_t tipMass = 45; // TODO
|
||||||
const uint8_t tipResistance = 60; // x10 ohms, ~6 typical
|
const uint8_t tipResistance = 60; // x10 ohms, ~6 typical
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef POW_QC_20V
|
||||||
|
#define QC_SETTINGS_MAX 3
|
||||||
|
#else
|
||||||
|
#define QC_SETTINGS_MAX 2
|
||||||
|
#endif
|
||||||
@@ -46,7 +46,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
|
|||||||
{0, 16, 1, 0}, // SleepTime
|
{0, 16, 1, 0}, // SleepTime
|
||||||
{0, 5, 1, 0}, // MinDCVoltageCells
|
{0, 5, 1, 0}, // MinDCVoltageCells
|
||||||
{24, 38, 1, 31}, // MinVoltageCells
|
{24, 38, 1, 31}, // MinVoltageCells
|
||||||
{0, 0, 0, 0}, // QCIdealVoltage
|
{0, QC_SETTINGS_MAX, 1, 0}, // QCIdealVoltage
|
||||||
{0, 0, 0, 0}, // OrientationMode
|
{0, 0, 0, 0}, // OrientationMode
|
||||||
{0, 10, 0, 0}, // Sensitivity
|
{0, 10, 0, 0}, // Sensitivity
|
||||||
{0, 1, 1, 1}, // AnimationLoop
|
{0, 1, 1, 1}, // AnimationLoop
|
||||||
|
|||||||
@@ -341,16 +341,7 @@ static bool settings_displayInputMinVRange(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef POW_QC
|
#ifdef POW_QC
|
||||||
static bool settings_setQCInputV(void) {
|
static bool settings_setQCInputV(void) { return nextSettingValue(SettingsOptions::QCIdealVoltage); }
|
||||||
#ifdef POW_QC_20V
|
|
||||||
systemSettings.QCIdealVoltage = (systemSettings.QCIdealVoltage + 1) % 3;
|
|
||||||
|
|
||||||
return systemSettings.QCIdealVoltage == 2;
|
|
||||||
#else
|
|
||||||
systemSettings.QCIdealVoltage = (systemSettings.QCIdealVoltage + 1) % 2;
|
|
||||||
return systemSettings.QCIdealVoltage == 1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool settings_displayQCInputV(void) {
|
static bool settings_displayQCInputV(void) {
|
||||||
printShortDescription(SettingsItemIndex::QCMaxVoltage, 5);
|
printShortDescription(SettingsItemIndex::QCMaxVoltage, 5);
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ static int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
|
|||||||
GUIDelay();
|
GUIDelay();
|
||||||
#ifdef ACCEL_EXITS_ON_MOVEMENT
|
#ifdef ACCEL_EXITS_ON_MOVEMENT
|
||||||
// If the accel works in reverse where movement will cause exiting the soldering mode
|
// If the accel works in reverse where movement will cause exiting the soldering mode
|
||||||
if (systemSettings.sensitivity) {
|
if (getSettingValue(SettingsOptions::Sensitivity)) {
|
||||||
if (lastMovementTime) {
|
if (lastMovementTime) {
|
||||||
if (lastMovementTime > TICKS_SECOND * 10) {
|
if (lastMovementTime > TICKS_SECOND * 10) {
|
||||||
// If we have moved recently; in the last second
|
// If we have moved recently; in the last second
|
||||||
|
|||||||
Reference in New Issue
Block a user