Has anyone used imp.wakeup() for any tight timing issues and had problems? The imp documentation says the following:
The timer has only centisecond (0.01s) resolution: a call to imp.wakeup(0.0, function) acts like imp.onidle(function), while a call to imp.wakeup(0.000001, function) acts like imp.wakeup(0.01, function).
I’m talking to devices at various baud rates (300-19k2). Some devices have specific spacings between frames and bytes. I’m finding that the float values that I’m passing to the imp.wakeup seem to be rounded down, rather than rounded up as the documentation suggests. I’m aware that imp.wakeup performance is affected by other squirrel routines and internal servicing of other imp functionality, but I would then allow for the fact that the wakeup could trigger AFTER the time I’ve specified. Instead, I see it trigger BEFORE the time I specified, which can be problematic. before For example, if use imp.wakeup(0.006875,timeoutFunc), the callback is invoked within 1-4ms. I would have expected circa 10ms.