Move to latest HAL release trying to get I2C DMA to be more reliable, and known good point.

Cleans up some redundant calls as well to make some flash room.
This commit is contained in:
Ben V. Brown
2018-12-16 18:13:59 +11:00
parent b744f51e2d
commit 873eb2a1e9
135 changed files with 9319 additions and 6521 deletions

View File

@@ -11,7 +11,7 @@
uint8_t tipResistance = 85; //x10 ohms, 8.5 typical for ts100, 4.5 typical for ts80
const uint16_t powerPWM = 255;
const uint16_t totalPWM = 255 + 65; //htim2.Init.Period, the full PWM cycle
const uint16_t totalPWM = 255 + 60; //htim2.Init.Period, the full PWM cycle
history<uint32_t, oscillationPeriod> milliWattHistory = { { 0 }, 0, 0 };
@@ -44,9 +44,8 @@ uint8_t milliWattsToPWM(int32_t milliWatts, uint8_t divisor) {
int32_t v = getInputVoltageX10(divisor, 1); // 100 = 10v
int32_t availableMilliWatts = v * v / tipResistance;
int32_t pwm = ((powerPWM * totalPWM / powerPWM) * milliWatts)
/ availableMilliWatts;
//int32_t pwm = ((powerPWM * totalPWM / powerPWM) * milliWatts) / availableMilliWatts;
int32_t pwm = (totalPWM * milliWatts) / availableMilliWatts;
if (pwm > powerPWM) {
pwm = powerPWM;
} else if (pwm < 0) {