79772170

Date: 2025-09-23 02:46:07
Score: 1.5
Natty:
Report link

The code in Arduino Core works because the BUTTON_PIN has the pull-up enabled with pinMode(BUTTON_PIN, INPUT_PULLUP);. While in the CMSIS code, this is not the case for the PA02 (BUTTON_PIN). So the EIC_handler will never be triggered.

Try to change the line

PORT->Group[0].PINCFG[BUTTON_PIN].bit.PMUXEN = 1;

to

PORT->Group[PORTA].PINCFG[BUTTON_PIN].reg |= (PORT_PINCFG_PMUXEN | PORT_PINCFG_PULLEN);

I didn't check the rest of the code. Let's know if this works. If this is not working, please elaborate what exactly not working as commented by @thebusybee.

Reasons:
  • RegEx Blacklisted phrase (2.5): please elaborate what
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @thebusybee
  • High reputation (-1):
Posted by: hcheung