Skip to content

Conversation

@sago35
Copy link
Member

@sago35 sago35 commented May 29, 2020

#1139

@deadprogram
This PR modifies the register access for interrupts pins on samd51.

Since only the EIC.CTRLA.ENABLE bit is required, only the EIC.CTRLA.ENABLE bit should be accessed and changed.

I tested it with feather-m4 and confirmed that it works.

@sago35 sago35 mentioned this pull request May 29, 2020
5 tasks
interruptPins[extint] = p

if (sam.EIC.CTRLA.Get() & 0x02) == 0 {
if (sam.EIC.CTRLA.Get() & sam.EIC_CTRLA_ENABLE) == 0 {
Copy link
Member

@deadprogram deadprogram May 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use the volatile package HasBits() function here:

if !sam.EIC.CTRLA.HasBits(sam.EIC_CTRLA_ENABLE) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source code has been modified.
It's better to use HasBits().

@sago35
Copy link
Member Author

sago35 commented May 30, 2020

I tested it with feather-m4 and confirmed that it works.
c9b3763

@deadprogram
Copy link
Member

Squashed and merged, thank you @sago35

@deadprogram deadprogram merged commit b92fad8 into tinygo-org:dev May 30, 2020
@sago35 sago35 deleted the interrupts-pins-samd51-rename 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