''01/09/2022 ''literal floating point assigment bug CON { timing } CLK_FREQ = 200_000_000 ' system freq as a constant BR_TERM = 230_400 ' terminal baud rate _clkfreq = CLK_FREQ ' set system clock CON { user } TARGET_SPEED_CONST = -120.0 PILOOP_SAMPLES_PER_SEC = 10 PILOOP_WAIT_COUNT = CLK_FREQ / PILOOP_SAMPLES_PER_SEC PUB Main() | waitForCnt, target_speed_f1, target_speed_f2 target_speed_f1 := -120.0 ''literal assignment gives incorrect value target_speed_f2 := TARGET_SPEED_CONST ''constant assignment gives correct value waitForCnt := getct() + PILOOP_WAIT_COUNT repeat waitct(waitForCnt += PILOOP_WAIT_COUNT) debug( fdec(target_speed_f1) , fdec(target_speed_f2) )