arduino / arduino/ArduinoCore-samd

Make SERCOM(0,1)_Handler optional

Open
#631 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
502
Forks
740
PR merge metrics
No merged PRs in 30d

Description

Hello,

In file [variant.cpp](https://github.com/arduino/ArduinoCore-samd/blob/master/variants/arduino_zero/variant.cpp#L35), two handlers are defined

```
void SERCOM0_Handler(){ Serial1.IrqHandler();}
void SERCOM5_Handler(){ Serial.IrqHandler();}
```
I understand it simplify the life of many, e.g. but in my case, I use SERCOM5 as an SPI device and I have to comment out that ISR definition.

What I propose is to make this optional by adding define condition

```
#if !defined(_VARIANT_ARDUINO_ZERO_DISABLE_SERCOM_HANDLERS_)
void SERCOM0_Handler(){ Serial1.IrqHandler();}
void SERCOM5_Handler(){ Serial.IrqHandler();}
#endif
```

if it make sense, I will send a PR

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with variants/arduino_zero/variant.cpp at the SERCOM0_Handler and SERCOM5_Handler definitions, then inspect how the variant build exposes the requested disable define. Done means the handlers remain available by default but can be excluded so SERCOM5 can be used as an SPI device; verify the core builds in both configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.