Jump to content

Raise A Flag


Nikolai
 Share

Recommended Posts

Hi!, i'm back with another strange question!

The idea: I would like to have sevral "shift" buttons.

ex. you have 4 buttons for recaling markers, to save a marker you press this "shift" button and the same 4 buttons wold save the markers.

I have a solution for this, The midibox (modifed LC) would have to send one midi enevt for save and one for recal.

so when you press the shift button a flag would be sett in mios, (like the gpc-flag etc) and one could change the midi event.

The problem is I don't know the best way off setting this flag, and the pest place to test it. is there a defined way of doing this?

I have tried different methods but they are all a bit clumsy.

any ideas?

happy Xmas, Nikolai

Link to comment
Share on other sites

Hi Nikolai,

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.

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi again.

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.

Nikolai

Link to comment
Share on other sites

Hi Nikolai,

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

Best Regards, Thorsten.

Link to comment
Share on other sites

Thank you.

I don't want to bother you with describing the required programming steps especially for me :)

Taking a look at the smal programs is probably a good idea. I think I'll stick with the layers.

though I'm not very good in assembler, I will figure this out sooner or later, just give me some coffe and time.

- I will look at how the layer-switching works and try to modify this to my benefits.

Thank you for your help.

-have a nice christmas

Nikolai

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...