getTipResistanceX10()
This commit is contained in:
@@ -16,6 +16,9 @@ extern "C" {
|
|||||||
// Can be used to check any details for the power system
|
// Can be used to check any details for the power system
|
||||||
void power_check();
|
void power_check();
|
||||||
|
|
||||||
|
// Return the tip resistance in x10 ohms (8.5 -> 85)
|
||||||
|
uint8_t getTipResistanceX10();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -17,3 +17,5 @@ void power_check() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool getIsPoweredByDCIN() { return false; }
|
bool getIsPoweredByDCIN() { return false; }
|
||||||
|
|
||||||
|
uint8_t getTipResistanceX10() { return TIP_RESISTANCE; }
|
||||||
@@ -288,3 +288,5 @@ uint64_t getDeviceID() {
|
|||||||
//
|
//
|
||||||
return HAL_GetUIDw0() | ((uint64_t)HAL_GetUIDw1() << 32);
|
return HAL_GetUIDw0() | ((uint64_t)HAL_GetUIDw1() << 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t getTipResistanceX10() { return TIP_RESISTANCE; }
|
||||||
@@ -93,3 +93,5 @@ void setStatusLED(const enum StatusLED state) {}
|
|||||||
|
|
||||||
uint8_t preStartChecks() { return 0; }
|
uint8_t preStartChecks() { return 0; }
|
||||||
uint64_t getDeviceID() { return dbg_id_get(); }
|
uint64_t getDeviceID() { return dbg_id_get(); }
|
||||||
|
|
||||||
|
uint8_t getTipResistanceX10() { return TIP_RESISTANCE; }
|
||||||
@@ -49,7 +49,7 @@ uint32_t availableW10(uint8_t sample) {
|
|||||||
// R = R*10
|
// R = R*10
|
||||||
// P therefore is in V^2*100/R*10 = W*10.
|
// P therefore is in V^2*100/R*10 = W*10.
|
||||||
uint32_t v = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), sample); // 100 = 10v
|
uint32_t v = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), sample); // 100 = 10v
|
||||||
uint32_t availableWattsX10 = (v * v) / TIP_RESISTANCE;
|
uint32_t availableWattsX10 = (v * v) / getTipResistanceX10();
|
||||||
// However, 100% duty cycle is not possible as there is a dead time while the ADC takes a reading
|
// However, 100% duty cycle is not possible as there is a dead time while the ADC takes a reading
|
||||||
// Therefore need to scale available milliwats by this
|
// Therefore need to scale available milliwats by this
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user