Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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 ;)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...