Skip to content

Add I2S support #182

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

Merged
merged 1 commit into from
Nov 28, 2016
Merged

Add I2S support #182

merged 1 commit into from
Nov 28, 2016

Conversation

sandeepmistry
Copy link
Contributor

WIP, for review and testing only for now ...

cc/ @cmaglie @facchinm @agdl

@ArduinoBot
Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b116_index.json

ℹ️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request Add I2S support #182
  5. Select one of the boards under SAMD Pull Request Add I2S support #182 in Tools->Board menu
  6. Compile/Upload as usual

@agdl agdl merged commit b49c17d into arduino:master Nov 28, 2016
@agdl
Copy link
Member

agdl commented Nov 28, 2016

Tested and LGTM!

@cmaglie cmaglie added this to the Release 1.6.9 milestone Dec 20, 2016
@cmaglie cmaglie deleted the i2s branch July 11, 2017 12:41
@colintd
Copy link

colintd commented Oct 8, 2019

Hi, I'm doing some detailed timing work on a SAMD21 board, and think this check-in might have broken the micros() function.

To allow micros() to be called from an ISR, the micros() function checks the pending flag on the systick handler. If this is set, it assumes the counter has wrapped but the tickcounter hasn't yet been incremented,, and adds 1ms to the result. This was fine when the handler was the highest priority, as it was either pended or it ran to completion. With this change to reduce the priority, there is a window where the handler is called, but then preempted by a higher priority external interrupt (such as an EIC interrupt from a GPIO pin). In that case, the tick count may or may not have been incremented (we can't tell), which means some of the time we add an extra 1ms when we shouldn't.

I've spotted this problem as I'm using micros() to timestamp edges for which I know the timing (1 pulse per second). I see multiple stamps an hour with exactly 1ms error due to this bug.

Can you elaborate why this change is needed for I2S support?

@matthijskooijman
Copy link
Collaborator

@sandeepmistry, could you have a look at the above comment? IMHO, something like changing the systick interrupt priority should at least have had a comment in the code and commit message, maybe even have been a separate commit for clarity.

boseji pushed a commit to go-ut/combined-ArduinoCore-samd that referenced this pull request May 30, 2020
tinyusb: Correct descriptor string length calculation
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.

6 participants