Skip to content

Turn off Interrupt Triggers and Pull Up Resistors on begin() #55

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 10 commits into from
Feb 9, 2021

Conversation

PsuFan
Copy link
Contributor

@PsuFan PsuFan commented Feb 9, 2021

  • Describe the scope of your change--i.e. what the change does and what parts
    of the code were modified.

    Turn off Interrupt Triggers and Pull Up Resistors on begin()

  • Describe any known limitations with your change.
    None

  • Please run any tests or examples that can exercise your modified code.
    Fully tested by compiling with MCP.pullUp(0, HIGH); checking voltage, commenting out and recompiling.

If an interrupt comes before the board is ready, the interrupt pin does not get reset until a read is made from A/B (if mirrored).
@ladyada
Copy link
Member

ladyada commented Feb 9, 2021

kk please check the CI errors and once passing, tag me to review!

@PsuFan
Copy link
Contributor Author

PsuFan commented Feb 9, 2021

@ladyada ugh I have a learning curve on GitHub... I don't know what the problem is. It runs fine for me, I don't know how it could verify with a MCP23017 lol

@evaherrada
Copy link
Collaborator

@PsuFan Hey! What GitHub Actions is currently failing on is the clang-format check. You can find out how to install and run that here: https://learn.adafruit.com/the-well-automated-arduino-library/formatting-with-clang-format

If you have any questions about doing that, or you find anything confusing, let me know (please @ ping me because there's a much higher chance I'll see it if you do).

Also, don't worry about not knowing GitHub super well. We all had to learn it at some point.

Thanks!

@PsuFan
Copy link
Contributor Author

PsuFan commented Feb 9, 2021

@dherrada clang-format returns nothing...

ESP8266 Serial\RFIDDoorSystem>clang-format -i Adafruit_MCP23017.cpp

ESP8266 Serial\RFIDDoorSystem>

@evaherrada
Copy link
Collaborator

@PsuFan Looks like you've got some trailing whitespace on lines 12, 16, and 19, although it is pretty odd that clang didn't catch that. Maybe try running it again and then just do it manually if it doesn't fix it.

@evaherrada
Copy link
Collaborator

Yeah, it's not supposed to return anything. It just edits the files for you

@PsuFan
Copy link
Contributor Author

PsuFan commented Feb 9, 2021

Line 12, 16, 19? I've only added lines 132-138. I'm using Windows and just editing on GitHub.com, I don't have sync setup.

@evaherrada
Copy link
Collaborator

@PsuFan Oh yah, you're definitely right. I misread the CI readout

Comment on lines 298 to 303
/**
* Disable a pin for interrupt.
*
* @param pin Pin to set
*
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason you removed this? It's causing the Doxygen check to fail

@evaherrada
Copy link
Collaborator

@PsuFan The good news is that the clang check is passing. See above for the doxygen (documentation) check.

@PsuFan
Copy link
Contributor Author

PsuFan commented Feb 9, 2021

clang-format removed it... Putting it back in now...

@evaherrada
Copy link
Collaborator

@PsuFan Looks like it's passing. Good job!

@evaherrada
Copy link
Collaborator

@ladyada Am I good to merge?

@@ -124,10 +124,20 @@ void Adafruit_MCP23017::begin(uint8_t addr, TwoWire *theWire) {

_wire->begin();

_wire->setClock(400000);
Copy link
Member

Choose a reason for hiding this comment

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

plz remove

@ladyada
Copy link
Member

ladyada commented Feb 9, 2021

close! one request

@PsuFan
Copy link
Contributor Author

PsuFan commented Feb 9, 2021

Oops, that wasn't supposed to be in there. That actually gave me increased bandwidth when reading RFID reader!

@ladyada ladyada merged commit 89eba2b into adafruit:master Feb 9, 2021
@PsuFan
Copy link
Contributor Author

PsuFan commented Feb 9, 2021

thanks! okay I have one more in examples :S

EDIT: oh that already got pushed, cool. Yeah that was messing me up for a while too. If you miss the FALL event and don't read the interrupt, you don't get any after that.

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.

3 participants