Skip to content

Conversation

@sago35
Copy link
Member

@sago35 sago35 commented May 28, 2020

#1094
#1111

I wrote the code for SAMD51J19A and SAMD51J20A.
I checked with feather-m4 and pyportal, and it seems to be working fine.

https://github.com/sago35/tinygo/tree/interrupts-pins-samd51

I'm struggling with how to write the following parts.
Is there a better way to do it?

  1. sam.EIC.CTRLA.Set(0) or sam.EIC.CTRLA.ClearBits(0x02)
  2. Is it better to define it outside of SetInterrupt()?
  3. I'd like to write a little nicer, but interrupt.New() only accepts const values, so this is how it's implemented.
  4. I want to make an example, but the feather-m4 I have doesn't have a button.
    Creating an example for pybadge is one thing, but since there is no machine.Button, the other examples need to be modified.

@sago35
Copy link
Member Author

sago35 commented May 28, 2020

The SAMD51P19 has 128 pins, so there's a bit more code.
Also, since the 128 pin setting is not yet in machine_atsamd51.go, it would be better to change it in #1124.

@sago35
Copy link
Member Author

sago35 commented May 28, 2020

@deadprogram
I cherry-picked it.

@sago35 sago35 mentioned this pull request May 28, 2020
5 tasks
@deadprogram
Copy link
Member

Now merging, thanks for working on this @sago35

@deadprogram deadprogram merged commit 5c8d4e5 into tinygo-org:dev May 29, 2020
@deadprogram
Copy link
Member

You might want to submit another PR to change sam.EIC.CTRLA.ClearBits(0x02) to sam.EIC.CTRLA.ClearBits(sam.EIC_CTRLA_ENABLE)

@sago35 sago35 deleted the interrupts-pins-samd51 branch May 30, 2020 21:39
@niaow niaow added this to the v0.14 milestone Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants