OpenBK7231T_App icon indicating copy to clipboard operation
OpenBK7231T_App copied to clipboard

BL0937: Fixed swapped division and multiplication in measured value correction

Open rpv-tomsk opened this issue 8 months ago • 4 comments

value = pulses / time

More pulses for same time - bigger value. More time for same pulses count - smaller value. Twice more pulses for twice time - same value.

ticksElapased * tick_period == elapsed time in ms ticksElapased * tick_period / 1000 == elapsed time in s

final = final * expected_time / elapsed_time; //expected time is 1 second. final = final * expected_ticks / elapsed_ticks; //expected ticks for 1 second: (1000.0ms / portTICK_PERIOD_MS)

Closes: #1270

rpv-tomsk avatar Jun 24 '24 14:06 rpv-tomsk