Export to GitHub

open9x - issue #182

Delay not applied in user function


Posted on Jan 25, 2013 by Massive Dog

After migrating to r1863 for sky9x, my A2 alerts which had previously a delay in order to space the "low battery" voice i'm playing are now always on, resulting in a continuous voice alert.

Regards

Comment #1

Posted on Jan 25, 2013 by Massive Dog

By the way, is it possible to update the voice pack "french.zip" ? the voice is still my favorite :)

Comment #2

Posted on Jan 27, 2013 by Massive Dog

Fixed when reverting this:

Attachments

Comment #3

Posted on Jan 27, 2013 by Quick Hippo

I have quickly made this commit, but it's completely untested: http://code.google.com/p/open9x/source/detail?r=1896

Would you review the code change and test it on Sky9x? 2 case should be handled:

  • when the switch is active during a longer time than the duration (your case if I am right)

  • when the switch is active during a shorter time than the duration (for example with a d>=ofs custom switch)

Thanks!

Comment #4

Posted on Jan 28, 2013 by Massive Dog

Thanks a lot !

r1896 compiled:

  • when the switch is active during a longer time than the duration -> CS is triggered, duration & delay are OK (you're right that's the situation i'am in when my battery gets low)

  • when the switch is active during a shorter time than the duration -> CS is never triggered :(

I'm ready for more tests if you need it. Regards

Comment #5

Posted on Jan 28, 2013 by Quick Hippo

ooops I forgot something important:

if (result && !cswStates[cs_idx]) cswDurations[cs_idx] = get_tmr10ms() + (cs->duration*50);

=> cswStates[cs_idx] = result;

Comment #6

Posted on Jan 28, 2013 by Massive Dog

I'm not sure where to add your line ?

Whith the following code it is still not OK.

Attachments

Comment #7

Posted on Jan 28, 2013 by Quick Hippo

It should be inserted between the 2 if. With other words, just after these 2 lines:

if (result && !cswStates[cs_idx]) cswDurations[cs_idx] = get_tmr10ms() + (cs->duration*50);

Comment #8

Posted on Jan 28, 2013 by Massive Dog

Thanks :)

Unfortunately still not OK for the 2nd case (short time activation)

Comment #9

Posted on Jan 29, 2013 by Quick Hippo

Strange, it seeems to work here on the simu (with the last commit)

Comment #10

Posted on Jan 29, 2013 by Helpful Bear

Maybe i'm not doing the good test. Here is what i'm doing (with r1898 flashed):

I've created IP6: V1>x Dir 5 1 1 If i push "Dir" further more than 1 sec IP6 is triggered (1 sec On, 1 Sec Off, ...)

If i push rapidely "Dir", nothing is triggered (see attached picture)

Attachments

Comment #11

Posted on Feb 2, 2013 by Quick Hippo

I thought I had answered to #10, but now I don't see it ...

A delay means: start the action after a delay of 1s, but only if the condition remains true after this delay! So it's normal in your case, you have set a delay of 1s, you have to push Dir during one second.

Comment #12

Posted on Feb 5, 2013 by Massive Dog

OK, so i have misunderstood the behavior. No problem with that since i'm not using the CS this way. Thanks for the help you can close the issue.

Status: Fixed

Labels:
Type-Defect Priority-Medium