1
0
forked from me/IronOS

Rough refactor main control loop to C

This commit is contained in:
Ben V. Brown
2019-10-07 18:58:51 +11:00
parent c5f6f6d044
commit 1cf88b2cd6
11 changed files with 233 additions and 496 deletions

View File

@@ -14,11 +14,11 @@ const uint16_t totalPWM = 255 + 17; //htim2.Init.Period, the full PWM cycle
history<uint32_t, oscillationPeriod> milliWattHistory = { { 0 }, 0, 0 };
int32_t tempToMilliWatts(int32_t rawTemp, uint8_t rawC) {
int32_t tempToMilliWatts(int32_t rawTemp) {
// mass is in milliJ/*C, rawC is raw per degree C
// returns milliWatts needed to raise/lower a mass by rawTemp
// degrees in one cycle.
int32_t milliJoules = tipMass*10 * (rawTemp / rawC);
int32_t milliJoules = tipMass*10 * rawTemp;
return milliJoules;
}