mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Compare commits
23 Commits
5121cf244d
...
bccead5d0b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bccead5d0b | ||
|
|
05158321ba | ||
|
|
f810921b0c | ||
|
|
2b8568ce37 | ||
|
|
d122a9fb52 | ||
|
|
57c8a35041 | ||
|
|
3ed86d2acf | ||
|
|
7c6ce812f6 | ||
|
|
c92bf89296 | ||
|
|
8a392b5364 | ||
|
|
68aac2847b | ||
|
|
dc2b91c879 | ||
|
|
24d7742df2 | ||
|
|
3c54811937 | ||
|
|
ba58d95adb | ||
|
|
c3f6de189c | ||
|
|
2001093b14 | ||
|
|
c336ec7773 | ||
|
|
c6705ac3c2 | ||
|
|
896bbd0522 | ||
|
|
52a57d4df5 | ||
|
|
bcb08ad6cd | ||
|
|
17ac550433 |
@@ -40,9 +40,9 @@ I.e.:
|
||||
|
||||
**Additional scroll-able items appear in this order**:
|
||||
|
||||
### Date
|
||||
### Timestamp
|
||||
|
||||
- This is a date of firmware compilation and it has the following format: `DD-MM-YY` (i.e., `01-07-23` means it has been built in July, 1st, 2023)
|
||||
- This is a timestamp of firmware compilation and it has the following format: `YYYYMMDD HHMMSS` (i.e., `20230701 213456` means it has been built in July, 1st, 2023 at 9:34:56 pm)
|
||||
|
||||
### ID
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ _This firmware does **NOT** support the USB port while running for changing sett
|
||||
|
||||
## Supported Hardware
|
||||
|
||||
| Device | DC | QC | PD | EPR | BLE | Tip Sense | Recommended Purchase | Notes |
|
||||
| Device | DC | QC | PD | EPR\*\*\*\* | BLE | Tip Sense | Recommended Purchase | Notes |
|
||||
| :------------: | :-: | :-: | :-: | :-: | :-: | :-------: | :------------------: | :-------------------------------------: |
|
||||
| Miniware MHP30 | ❌ | ❌ | ✔️ | ❌ | ❌ | ✔️ | ✔️ | |
|
||||
| Pinecil V1 | ✔️ | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ \* | |
|
||||
@@ -48,6 +48,9 @@ The _TS101_ & _S60(P)_ irons and _MHP30_ & _T55_ plates feature a higher resolut
|
||||
|
||||
\*\*\* _TS80_ is replaced by _TS80P_. Production ramped down a long time ago and it's just existing stock clearing the system. It's marked not recommended being optimistic that people might pause and buy the far superior _TS80P_ instead. This is the main reason why the _TS80_ is **_no longer recommended_**.
|
||||
|
||||
\*\*\*\* **EPR/PPS with 28V support** is _**disabled by default**_ due to [safety concerns](https://github.com/Ralim/IronOS/pull/2073), but to turn it back on set
|
||||
_PD Mode_ option in _Power settings_ submenu to _Safe_ or _Default_.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To get started with _IronOS firmware_, please jump to [Getting Started Guide](https://ralim.github.io/IronOS/GettingStarted/).
|
||||
|
||||
@@ -152,7 +152,7 @@ def get_constants() -> List[Tuple[str, str]]:
|
||||
|
||||
def get_debug_menu() -> List[str]:
|
||||
return [
|
||||
datetime.today().strftime("%Y-%m-%d"),
|
||||
datetime.today().strftime("%Y%m%d %H%M%S"),
|
||||
"ID ",
|
||||
"ACC ",
|
||||
"PWR ",
|
||||
|
||||
@@ -165,6 +165,14 @@
|
||||
#define ACCEL_EXITS_ON_MOVEMENT
|
||||
#define NEEDS_VBUS_PROBE 0
|
||||
|
||||
#define CANT_DIRECT_READ_SETTINGS // We cant memcpy settings due to flash cache
|
||||
#define TIP_CONTROL_PID // We use PID rather than integrator
|
||||
#define TIP_PID_KP 22 //40 // Reasonable compromise for most tips so far
|
||||
#define TIP_PID_KI 300 //6 // About as high for stability across tips
|
||||
#define TIP_PID_KD 600 //200 // Helps dampen smaller tips; ~= nothing for larger tips
|
||||
#define FILTER_DISPLAYED_TIP_TEMP 8 // Filtering for GUI display
|
||||
|
||||
|
||||
#define HARDWARE_MAX_WATTAGE_X10 650
|
||||
#define TIP_THERMAL_MASS 65 // TODO, needs refinement
|
||||
#define TIP_RESISTANCE 60 // x10 ohms, ~6 typical
|
||||
|
||||
@@ -57,16 +57,16 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) {
|
||||
PB1 ------> ADC2_IN9
|
||||
*/
|
||||
GPIO_InitStruct.Pin = TIP_TEMP_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
HAL_GPIO_Init(TIP_TEMP_GPIO_Port, &GPIO_InitStruct);
|
||||
GPIO_InitStruct.Pin = TMP36_INPUT_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
HAL_GPIO_Init(TMP36_INPUT_GPIO_Port, &GPIO_InitStruct);
|
||||
GPIO_InitStruct.Pin = VIN_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
HAL_GPIO_Init(VIN_GPIO_Port, &GPIO_InitStruct);
|
||||
GPIO_InitStruct.Pin = PLATE_SENSOR_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||
HAL_GPIO_Init(PLATE_SENSOR_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* ADC2 interrupt Init */
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "TipThermoModel.h"
|
||||
#include "USBPD.h"
|
||||
#include "Utils.hpp"
|
||||
#include "bflb_platform.h"
|
||||
#include "bl702_adc.h"
|
||||
#include "configuration.h"
|
||||
#include "crc32.h"
|
||||
@@ -282,16 +283,3 @@ void showBootLogo(void) {
|
||||
|
||||
BootLogo::handleShowingLogo(scratch);
|
||||
}
|
||||
|
||||
TemperatureType_t getCustomTipMaxInC() {
|
||||
// have to lookup the max temp while being aware of the coe scaling value
|
||||
float max_reading = ADC_MAX_READING - 1.0;
|
||||
|
||||
if (adcGainCoeffCal.adcGainCoeffEnable) {
|
||||
max_reading /= adcGainCoeffCal.coe;
|
||||
}
|
||||
|
||||
TemperatureType_t maximumTipTemp = TipThermoModel::convertTipRawADCToDegC(max_reading);
|
||||
maximumTipTemp += getHandleTemperature(0) / 10; // Add handle offset
|
||||
return maximumTipTemp - 1;
|
||||
}
|
||||
|
||||
@@ -161,7 +161,6 @@
|
||||
#define OLED_96x16 1
|
||||
#define TEMP_NTC
|
||||
#define ACCEL_BMA
|
||||
#define CUSTOM_MAX_TEMP_C 1 // Uses custom max temp lookup
|
||||
#define ACCEL_SC7
|
||||
#define HALL_SENSOR
|
||||
#define HALL_SI7210
|
||||
|
||||
@@ -337,68 +337,51 @@ bool pdbs_dpm_evaluate_capability(const pd_msg *capabilities, pd_msg *request) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void add_v_record(pd_msg *cap, uint16_t voltage_mv, int numobj) {
|
||||
|
||||
uint16_t current = (voltage_mv) / getTipResistanceX10(); // In centi-amps
|
||||
|
||||
/* Add a PDO for the desired power. */
|
||||
cap->obj[numobj] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_MV2PDV(voltage_mv)) | PD_PDO_SNK_FIXED_CURRENT_SET(current);
|
||||
}
|
||||
void pdbs_dpm_get_sink_capability(pd_msg *cap, const bool isPD3) {
|
||||
/* Keep track of how many PDOs we've added */
|
||||
// int numobj = 0;
|
||||
int numobj = 0;
|
||||
|
||||
// /* If we have no configuration or want something other than 5 V, add a PDO
|
||||
// * for vSafe5V */
|
||||
// /* Minimum current, 5 V, and higher capability. */
|
||||
// cap->obj[numobj++] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_MV2PDV(5000)) | PD_PDO_SNK_FIXED_CURRENT_SET(DPM_MIN_CURRENT);
|
||||
/* If we have no configuration or want something other than 5 V, add a PDO
|
||||
* for vSafe5V */
|
||||
/* Minimum current, 5 V, and higher capability. */
|
||||
cap->obj[numobj++] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_MV2PDV(5000)) | PD_PDO_SNK_FIXED_CURRENT_SET(DPM_MIN_CURRENT);
|
||||
// Voltages must be in order of lowest -> highest
|
||||
#if USB_PD_VMAX >= 20
|
||||
add_v_record(cap, 9000, numobj);
|
||||
numobj++;
|
||||
add_v_record(cap, 15000, numobj);
|
||||
numobj++;
|
||||
add_v_record(cap, 20000, numobj);
|
||||
numobj++;
|
||||
#elif USB_PD_VMAX >= 15
|
||||
add_v_record(cap, 9000, numobj);
|
||||
numobj++;
|
||||
add_v_record(cap, 12000, numobj);
|
||||
numobj++;
|
||||
add_v_record(cap, 15000, numobj);
|
||||
numobj++;
|
||||
#elif USB_PD_VMAX >= 12
|
||||
add_v_record(cap, 9000, numobj);
|
||||
numobj++;
|
||||
add_v_record(cap, 12000, numobj);
|
||||
numobj++;
|
||||
#elif USB_PD_VMAX >= 9
|
||||
add_v_record(cap, 9000, numobj);
|
||||
numobj++;
|
||||
#endif
|
||||
|
||||
// /* Get the current we want */
|
||||
// uint16_t voltage = USB_PD_VMAX * 1000; // in mv
|
||||
// if (requested_voltage_mv != 5000) {
|
||||
// voltage = requested_voltage_mv;
|
||||
// }
|
||||
// uint16_t current = (voltage) / getTipResistanceX10(); // In centi-amps
|
||||
/* Set the USB communications capable flag. */
|
||||
cap->obj[0] |= PD_PDO_SNK_FIXED_USB_COMMS;
|
||||
|
||||
// /* Add a PDO for the desired power. */
|
||||
// cap->obj[numobj++] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_MV2PDV(voltage)) | PD_PDO_SNK_FIXED_CURRENT_SET(current);
|
||||
|
||||
// /* Get the PDO from the voltage range */
|
||||
// int8_t i = dpm_get_range_fixed_pdo_index(cap);
|
||||
|
||||
// /* If it's vSafe5V, set our vSafe5V's current to what we want */
|
||||
// if (i == 0) {
|
||||
// cap->obj[0] &= ~PD_PDO_SNK_FIXED_CURRENT;
|
||||
// cap->obj[0] |= PD_PDO_SNK_FIXED_CURRENT_SET(current);
|
||||
// } else {
|
||||
// /* If we want more than 5 V, set the Higher Capability flag */
|
||||
// if (PD_MV2PDV(voltage) != PD_MV2PDV(5000)) {
|
||||
// cap->obj[0] |= PD_PDO_SNK_FIXED_HIGHER_CAP;
|
||||
// }
|
||||
|
||||
// /* If the range PDO is a different voltage than the preferred
|
||||
// * voltage, add it to the array. */
|
||||
// if (i > 0 && PD_PDO_SRC_FIXED_VOLTAGE_GET(cap->obj[i]) != PD_MV2PDV(voltage)) {
|
||||
// cap->obj[numobj++] = PD_PDO_TYPE_FIXED | PD_PDO_SNK_FIXED_VOLTAGE_SET(PD_PDO_SRC_FIXED_VOLTAGE_GET(cap->obj[i])) | PD_PDO_SNK_FIXED_CURRENT_SET(PD_PDO_SRC_FIXED_CURRENT_GET(cap->obj[i]));
|
||||
// }
|
||||
|
||||
// /* If we have three PDOs at this point, make sure the last two are
|
||||
// * sorted by voltage. */
|
||||
// if (numobj == 3 && (cap->obj[1] & PD_PDO_SNK_FIXED_VOLTAGE) > (cap->obj[2] & PD_PDO_SNK_FIXED_VOLTAGE)) {
|
||||
// cap->obj[1] ^= cap->obj[2];
|
||||
// cap->obj[2] ^= cap->obj[1];
|
||||
// cap->obj[1] ^= cap->obj[2];
|
||||
// }
|
||||
// /* If we're using PD 3.0, add a PPS APDO for our desired voltage */
|
||||
// if ((hdr_template & PD_HDR_SPECREV) >= PD_SPECREV_3_0) {
|
||||
// cap->obj[numobj++]
|
||||
// = PD_PDO_TYPE_AUGMENTED | PD_APDO_TYPE_PPS | PD_APDO_PPS_MAX_VOLTAGE_SET(PD_MV2PAV(voltage)) | PD_APDO_PPS_MIN_VOLTAGE_SET(PD_MV2PAV(voltage)) |
|
||||
// PD_APDO_PPS_CURRENT_SET(PD_CA2PAI(current));
|
||||
// }
|
||||
// }
|
||||
|
||||
// /* Set the unconstrained power flag. */
|
||||
// if (_unconstrained_power) {
|
||||
// cap->obj[0] |= PD_PDO_SNK_FIXED_UNCONSTRAINED;
|
||||
// }
|
||||
// /* Set the USB communications capable flag. */
|
||||
// cap->obj[0] |= PD_PDO_SNK_FIXED_USB_COMMS;
|
||||
|
||||
// /* Set the Sink_Capabilities message header */
|
||||
// cap->hdr = hdr_template | PD_MSGTYPE_SINK_CAPABILITIES | PD_NUMOBJ(numobj);
|
||||
/* Set the Sink_Capabilities message header */
|
||||
cap->hdr = PD_DATAROLE_UFP | PD_SPECREV_3_0 | PD_POWERROLE_SINK | PD_MSGTYPE_SINK_CAPABILITIES | PD_NUMOBJ(numobj);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -161,11 +161,11 @@ OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) {
|
||||
return OperatingMode::Sleeping;
|
||||
}
|
||||
|
||||
if (heaterThermalRunaway) {
|
||||
currentTempTargetDegC = 0; // heater control off
|
||||
heaterThermalRunaway = false;
|
||||
cxt->transitionMode = TransitionAnimation::Right;
|
||||
return OperatingMode::ThermalRunaway;
|
||||
}
|
||||
// if (heaterThermalRunaway) {
|
||||
// currentTempTargetDegC = 0; // heater control off
|
||||
// heaterThermalRunaway = false;
|
||||
// cxt->transitionMode = TransitionAnimation::Right;
|
||||
// return OperatingMode::ThermalRunaway;
|
||||
// }
|
||||
return handleSolderingButtons(buttons, cxt);
|
||||
}
|
||||
|
||||
@@ -397,6 +397,9 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
|
||||
/* Check for multiplication overflow. */
|
||||
configASSERT( ( uxItemSize == 0 ) || ( uxQueueLength == ( xQueueSizeInBytes / uxItemSize ) ) );
|
||||
|
||||
/* Check for addition overflow. */
|
||||
configASSERT( ( sizeof( Queue_t ) + xQueueSizeInBytes ) > xQueueSizeInBytes );
|
||||
|
||||
/* Allocate the queue and storage area. Justification for MISRA
|
||||
* deviation as follows: pvPortMalloc() always ensures returned memory
|
||||
* blocks are aligned per the requirements of the MCU stack. In this case
|
||||
|
||||
Reference in New Issue
Block a user