Page 1 of 1

Macro + DKP + LKP = Legal?

Posted: Fri Mar 10, 2006 12:50 pm
by mkmcgregor
It appears to work the way I intended, but I just wanted to confirm that the fall through condition is not just hapinstance and prone to change in future extender revisions.

I have a macro #4 for the CBL button calling into the DKP special protocol funtion #8, which, in the case of single key press calls into the LKP function #3 to determine if the single key press was short or long. I have scripted them to avoid recurrsion.

Is this type of nested calling likely to always behave correctly? It was unclear as to the "globalness" of the internal timers and button states in the extender as one protocol function calls into the next; i.e. when I'm holding the button, does the extender not call anything until the various possible states have been discounted and only one remains (single, double, long).

Posted: Fri Mar 10, 2006 2:46 pm
by Capn Trips
I never bothered trying this, but I recall a discussion some 12-18 months ago about this very topic, and it was unclear to me what the relationship between the various timers (threshhold between Short and Long, and threshhold between Double and Two Separate keypresses) was, but in JP1, the main rule is:
"If it works, don't fix it."

Can you post the IR file just for my/our edification?

And just to ensure I understand correctly, you have set it up such that for a single button, you have THREE different behaviours:
(1) Single Short press = sequence/macro1
(2) Single long press = sequence/macro2
(3) Double press = sequence/macro3

Is that correct? Cool!

And as far as extender revisions go -
(a) they don't happen that often (again the "if it works..." theory); and
(b) if the extender is revised, you're not obligated to adopt the newer version. (again - "if it...")

File posted

Posted: Fri Mar 10, 2006 4:30 pm
by mkmcgregor
Here is the file.
http://www.hifi-remote.com/forums/dload ... le_id=2925

Sorry, I have not cleaned up the device code operlap yet. :( But that's one of my next projects now that I overlayed their text output on the LCD :)

Also, Phantom2 is still the extra key sequence to prevent macro power failure. You'll see it in a lot of places. Usually one per macro sequence.

Posted: Fri Mar 10, 2006 6:30 pm
by mkmcgregor
Capn Trips wrote:And just to ensure I understand correctly, you have set it up such that for a single button, you have THREE different behaviours:
(1) Single Short press = sequence/macro1
(2) Single long press = sequence/macro2
(3) Double press = sequence/macro3

Is that correct? Cool!
Well, for the most part. It is more of addition of macro steps based on the state of key. It goes more like
Macro starts running some instruction then calls DKP protocol
If DKP then run some additional macro code and return to
main macro
If not DKP, then call LKP protocol
If LKP then run some additional macro code and return to DKP
If not LKP then (instruction area left blank) return to DKP
additional post steps may run here, but not normally
return to main macro
Main device macro finishes remaining instructions

This interwoven addition of steps was why I was asking questions about processing of the steps and state of the keys during the processing. This logic flow depends on DKP knowing the difference between double and or not double and that long, double, and short are mutually exclusive things. I'm guessing if the timing of the button pressing, length of the LKP, and the duration values that I place on each could make the macro function iradically. So far it has worked fairly well, but is also a little slow to complete.

Posted: Sat Mar 11, 2006 11:00 am
by ElizabethD
Capn Trips wrote:I never bothered trying this, but I recall a discussion some 12-18 months ago about this very topic
I recently bumped into this 9/2004 thread, #2901, while trying to experiment with DKP.
http://www.hifi-remote.com/forums/viewtopic.php?t=2901
Be careful interpreting though, because the memory layout has changed since some of the posts in there. Current IR puts keymoves of both kinds before macros.
I'd like to have the triple-LDKP as well.

Posted: Sat Mar 11, 2006 12:17 pm
by mkmcgregor
Thanks ElizabethD!

It's a great reference and good read about what I was trying to accomplish.