Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu: samd21: fix gpio irq handling compile handling #2865

Merged

Conversation

kaspar030
Copy link
Contributor

fixes compile issue exposed in #2852 (bug shows when compiling with -Os)

(this gpio implementation needs a complete rewrite)

@OlegHahm
Copy link
Member

This fixes an issue by an PR that's not even merged?

@OlegHahm OlegHahm added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: drivers Area: Device drivers labels Apr 24, 2015
@kaspar030
Copy link
Contributor Author

@OlegHahm The PR exposed a bug.

@haukepetersen
Copy link
Contributor

this PR does suppress the warning, but does not fix the issue:
say GPIO_NUMOF is 8. Then the sizeof(gpio_config) is 8. Now your loop accesses this array from 0 to 16 -> this seems off :-)

@biboc
Copy link
Member

biboc commented Apr 29, 2015

Wait, if we set GPIO_NUMOF to 1 and we use only PA04 as an int for GPIO1, extint for PA04 is 4 so gpio_config[extint].cb = cb; will crash because of static gpio_state_t gpio_config[GPIO_NUMOF];

I do understand why it needs a rewrite ...

@OlegHahm OlegHahm modified the milestone: Release 2015.06 Apr 29, 2015
@kaspar030
Copy link
Contributor Author

@OlegHahm Could you give this a try?

@@ -36,7 +36,7 @@ typedef struct {
void *arg; /**< argument passed to the callback */
} gpio_state_t;

static gpio_state_t gpio_config[GPIO_NUMOF];
static gpio_state_t gpio_config[16];
Copy link
Member

Choose a reason for hiding this comment

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

please replace with a non-literal

@OlegHahm
Copy link
Member

This PR alone seems to work - will test with #2852.

@OlegHahm
Copy link
Member

ACK, please squash.

@OlegHahm OlegHahm added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label May 15, 2015
@haukepetersen
Copy link
Contributor

ACK

@PeterKietzmann
Copy link
Member

Third ACK. Please squash :-)

@kaspar030 kaspar030 force-pushed the fix_samd21_gpio_compile_issue branch from 4fadabf to aff2593 Compare May 26, 2015 08:23
@kaspar030
Copy link
Contributor Author

squashed, rebased

@OlegHahm OlegHahm removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label May 26, 2015
@PeterKietzmann PeterKietzmann added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 26, 2015
@PeterKietzmann
Copy link
Member

And go

PeterKietzmann added a commit that referenced this pull request May 26, 2015
cpu: samd21: fix gpio irq handling compile handling
@PeterKietzmann PeterKietzmann merged commit 68dd9a3 into RIOT-OS:master May 26, 2015
@kaspar030 kaspar030 deleted the fix_samd21_gpio_compile_issue branch February 7, 2017 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants