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

Assign proper interrupt handler function names to Core's i2c_hal.c #1305

Closed
wants to merge 1 commit into from

Conversation

geekbozu
Copy link

@geekbozu geekbozu commented Apr 22, 2017

Problem

Using a core in I2C slave mode would cause a hard reset on pulling D0/I2C_SCL Low.

Cause

Improperly named function for I2C events and Errors.

Solution

Properly assign I2C interrupt service handler functions.

Steps to Test

Enable Wire library as slave. Pull D0 Low;

Example App

void reqEv(){
    return;
}
void setup() {
  Wire.begin(1);
  Wire.onRequest(reqEv);
}

void loop() {
 // nada needed
}

References

My thread on the problem.
https://community.particle.io/t/core-i2c-reboots-core/31551


Other thoughts.

This will probably fix quite a bit of I2C compatibility on the core as error handling of the peripheral will actually be functional now.
Bug was introduced in this commit cec9ade

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy avtolstoy mentioned this pull request Apr 23, 2017
6 tasks
@avtolstoy
Copy link
Member

Thanks for the contribution! I've opened a PR #1309 that already fixes the incorrect naming of interrupt handlers. Unfortunately even with that fixed, Core still fails the tests. PR #1309 also includes a port of I2C slave implementation from Photon/P1.

@m-mcgowan
Copy link
Contributor

Thanks for the contribution. Since this is superseded by #1309, I will close this. If you are able to help test #1309 to find out why it is still not passing the tests, that would be very much welcomed!

@m-mcgowan m-mcgowan closed this Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants