Skip to content

Commit

Permalink
#28
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jul 1, 2020
1 parent ce419db commit 614785d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/eez/modules/psu/list_program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,9 @@ void tick(uint32_t tick_usec) {

active = true;

uint32_t tickCount;
if (g_execution[i].currentTotalDwellTime > CONF_COUNTER_THRESHOLD_IN_SECONDS) {
tickCount = millis();
} else {
tickCount = tick_usec;
uint32_t tickCount = millis();
if (g_execution[i].currentTotalDwellTime <= CONF_COUNTER_THRESHOLD_IN_SECONDS) {
tickCount *= 1000;
}

if (io_pins::isInhibited()) {
Expand Down Expand Up @@ -640,12 +638,11 @@ void tick(uint32_t tick_usec) {
if (g_execution[i].currentTotalDwellTime > CONF_COUNTER_THRESHOLD_IN_SECONDS) {
// ... then count in milliseconds
g_execution[i].currentRemainingDwellTime = (uint32_t)round(g_execution[i].currentTotalDwellTime * 1000L);
g_execution[i].nextPointTime = millis() + g_execution[i].currentRemainingDwellTime;
} else {
// ... else count in microseconds
g_execution[i].currentRemainingDwellTime = (uint32_t)round(g_execution[i].currentTotalDwellTime * 1000000L);
g_execution[i].nextPointTime = tick_usec + g_execution[i].currentRemainingDwellTime;
}
g_execution[i].nextPointTime = tickCount + g_execution[i].currentRemainingDwellTime;
}
}

Expand Down

0 comments on commit 614785d

Please sign in to comment.