1
0
forked from me/IronOS

All Ticks as the right TickType

Update usb-pd
This commit is contained in:
Ben V. Brown
2022-07-25 16:42:16 +10:00
parent 138e3260da
commit dd239375b1
7 changed files with 26 additions and 26 deletions

View File

@@ -42,7 +42,7 @@ void showWarnings();
#define BUTTON_INACTIVITY_TIME (60 * configTICK_RATE_HZ)
static TickType_t lastHallEffectSleepStart = 0;
static uint16_t min(uint16_t a, uint16_t b) {
if (a > b)
if (a > b)
return b;
else
return a;
@@ -171,9 +171,9 @@ static void gui_drawBatteryIcon() {
#endif
}
static void gui_solderingTempAdjust() {
uint32_t lastChange = xTaskGetTickCount();
TickType_t lastChange = xTaskGetTickCount();
currentTempTargetDegC = 0; // Turn off header while adjusting temp
uint32_t autoRepeatTimer = 0;
TickType_t autoRepeatTimer = 0;
uint8_t autoRepeatAcceleration = 0;
bool waitForRelease = false;
ButtonState buttons = getButtonState();
@@ -370,7 +370,7 @@ static void display_countdown(int sleepThres) {
* Print seconds or minutes (if > 99 seconds) until sleep
* mode is triggered.
*/
int lastEventTime = lastButtonTime < lastMovementTime ? lastMovementTime : lastButtonTime;
TickType_t lastEventTime = lastButtonTime < lastMovementTime ? lastMovementTime : lastButtonTime;
TickType_t downCount = sleepThres - xTaskGetTickCount() + lastEventTime;
if (downCount > (99 * TICKS_SECOND)) {
OLED::printNumber(downCount / 60000 + 1, 2, FontStyle::SMALL);

View File

@@ -17,7 +17,7 @@
static TickType_t powerPulseWaitUnit = 25 * TICKS_100MS; // 2.5 s
static TickType_t powerPulseDurationUnit = (5 * TICKS_100MS) / 2; // 250 ms
TaskHandle_t pidTaskNotification = NULL;
volatile uint32_t currentTempTargetDegC = 0; // Current temperature target in C
volatile uint32_t currentTempTargetDegC = 0; // Current temperature target in C
int32_t powerSupplyWattageLimit = 0;
bool heaterThermalRunaway = false;
@@ -114,8 +114,8 @@ int32_t getPIDResultX10Watts(int32_t setpointDelta) {
static TickType_t lastCall = 0;
static Integrator<int32_t> powerStore = {0};
const int rate = 1000 / (xTaskGetTickCount() - lastCall);
lastCall = xTaskGetTickCount();
const TickType_t rate = 1000 / (xTaskGetTickCount() - lastCall);
lastCall = xTaskGetTickCount();
// Sandman note:
// PID Challenge - we have a small thermal mass that we to want heat up as fast as possible but we don't
// want to overshot excessively (if at all) the setpoint temperature. In the same time we have 'imprecise'