Jump to content

C wrapper and switch/led matrix...


pilo
 Share

Recommended Posts

Well, I make some mods in the C wrapper to support the switch matrix stuff, but with sm_simple.inc and sm_fast.inc I get always the same probleme : when I press a switch, it can't stop toggle between on and off... don't know why, it works with the example app (so it's not a hardware problem).

I want to use the same dout for driving switch and led matrix (led matrix not yet solder). Maybe it would be a better idea to make those change in mios?

I want to use encoder too... so I think there I can't use sm_fast.inc?

Thanks! ;)

Pilo

Link to comment
Share on other sites

Hi Pilo,

Well, I make some mods in the C wrapper to support the switch matrix stuff, but with sm_simple.inc and sm_fast.inc I get always the same probleme : when I press a switch, it can't stop toggle between on and off... don't know why, it works with the example app (so it's not a hardware problem).

well, what should I say to this statement? I don't know your code ;-)

I want to use the same dout for driving switch and led matrix (led matrix not yet solder). Maybe it would be a better idea to make those change in mios?

no, because matrices are always very hardware dependent and require customizations which are better located in the application, because parametrized code would be too slow.

MIOS already provides a hook which allows to prepare the DOUTs before they are updated. However, currently it is not possible to use this hook in C... I know... this will be added to the C wrapper once I find the time.

I want to use encoder too... so I think there I can't use sm_fast.inc?

you can use two seperate DIN/DOUT chains, one for the standard MIOS stuff, one for the button matrix stuff. You only need to change the pinning in sm_fast.inc

This would be the most performant solution

Best Regards, Thorsten.

Link to comment
Share on other sites

Thanks for the answer ;)

Actually I add stuff in mios_wrapper.asm file :

USER_Tick
        extern  _Tick
        call    SM_ButtonHandler

        lfsr    FSR0, STACK_HEAD        ;; initialize stack
        lfsr    FSR2, STACK_HEAD

        goto    _Tick



USER_SR_Service_Prepare
        ;; TODO
        ;; not forwarded to C yet -- no problem at all, but some additional
        ;; SFRs needs to be saved.
        call    SM_PrepareCol
        return



USER_SR_Service_Finish
        ;; TODO
        ;; not forwarded to C yet -- no problem at all, but some additional
        ;; SFRs needs to be saved.
        call    SM_GetRow
        return

I try to customise to make the matrix works... I need to check again maybe my error is stupid ;)

Link to comment
Share on other sites

maybe my error is stupid ;)

ok, so lets assume that it is a stupid error - maybe the reister addresses declared in app_defines.inc are overlapping the C variables?

You can check this in the projects.map file, where all addresses are listed.

Best Regards, Thorsten.

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...