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

Add MFRC522 support for customizable SPI pins #18711

Closed
wants to merge 2 commits into from

Conversation

AlKi
Copy link

@AlKi AlKi commented May 22, 2023

Description:

(MF)RC522 reader modules cannot be used with e.g. ESP32-cam modules, since the driver uses the default SPI interface.
This code change enables custom builds to use the SPI pins configured via a template (e.g. via web UI)

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with Tasmota core ESP32 V.2.0.9 (Note: tested on ESP32-cam)
  • I accept the CLA.

AlKi added 2 commits May 22, 2023 21:36
…2.ino

RC522_USE_CONFIGURED_SPI_PINS can now be defined so the SPI pins configured in the WebUI are used for communication to the RC522
Added (commented out)
RC522_USE_CONFIGURED_SPI_PINS option and
a description to my_user_config.h
@Jason2866
Copy link
Collaborator

Mhh, is the #ifdef needed in general? There should be no fixed GPIOs in any Tasmota driver!
So imho this PR is a bugfix

@arendst
Copy link
Owner

arendst commented May 23, 2023

Agree with @Jason2866. I'll need to dive in why this needs to be fixed the way it is proposed here.

@arendst arendst added the on hold by dev team Result - Feature request put on hold by member of development team label May 23, 2023
@arendst
Copy link
Owner

arendst commented May 23, 2023

I see the issue. Will fix in a generic way. Thx for your input.

arendst added a commit that referenced this pull request May 23, 2023
Fix ESP32 SPI initialization for MFRC522 (#18711)
@arendst
Copy link
Owner

arendst commented May 23, 2023

Thx. Merged in some way. See above.

@arendst arendst closed this May 23, 2023
@AlKi
Copy link
Author

AlKi commented May 25, 2023

Oh, nice!
I added the #ifdef since I was not sure if this would break things.
I'm happy this lead to your nice (and way cleaner) fix in #18711 :)

@AlKi AlKi deleted the RC522_customizable_SPI_pins branch May 25, 2023 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold by dev team Result - Feature request put on hold by member of development team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants