the best place is in lc_buttons.inc - here you can modify the LC_BUTTON_Handler so that one button is not forwarded to the common code, but sets/clears a flag of any free register (see app_defines.h for the memory allocation, some addresses which are not used yet are 0x24-0x3f)
Thereafter you could select between different button tables depending on the flag state. You could do this for all buttons at the same time, or only for a small range - it’s on you.
Yepp everything fine, except I don’t fully get this part:
TABLE_ADDR LC_IO_TABLE_LAYER0 ; init table pointer
movf MIOS_PARAMETER1, W
mullw 2
;; if layer1 selected, increment high byte (-> +256)
btfsc LC_STAT, LC_STAT_LAYER_SEL
incf PRODH, F
movf PRODL, W ; add low-byte of offset to TBLPTRL
addwf TBLPTRL, F
movf PRODH, W ; add high-byte of offset to TBLPTRL
addwfc TBLPTRH, F
How should I read from a seperate table, and must this consist of 128 entrys? can I just change the “TABLE_ADDR LC_IO_TABLE_LAYER0” and add a table in LC_IO_TABLE.inc? I gues it’s the offset (256) that makes me confused.
If someone could enlighten me a little on this, cause I’m verry close to the final goal.
before I spent one or two hours to think about how to describe the required programming steps especially for you, one question:
Did you ever try the ID_MBLC_HOLD_LAYER function which switches between the two layer tables? It works like a shift button, and the implementation is a little bit more advanced than the way how you are planning to do this. Because not only the button functions, but also the LED functions are switched. And if the LED status is changed from the host application although it’s located in the not-active layer, the status will be saved in RAM so that this information doesn’t get lost.
I think that you want to have something like this, but should I really describe all the details?
If you want to have more than one “shift” button, you could also use smaller tables. But before you are trying this, I would highly suggest to begin with a simple DIN example from the MIOS download page. Try to understand how the programs are working, this should enable you to understand even more compilcated implementations sooner or later. And once you’ve reached this level, it will be much easier for me to give you hints which really help