Skip to content

Commit

Permalink
Fix ESP32 SPI initialization for MFRC522
Browse files Browse the repository at this point in the history
Fix ESP32 SPI initialization for MFRC522 (#18711)
  • Loading branch information
arendst committed May 23, 2023
1 parent 242eb30 commit 10f9c20
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ All notable changes to this project will be documented in this file.
- Command ``WifiPower 1`` to restore default wifi power
- HASPmota `meta` attribute and improved `berry_run`


### Breaking Changed

### Changed
Expand All @@ -23,7 +22,8 @@ All notable changes to this project will be documented in this file.
- AIThinker webcam issues (#18652)
- Berry `tasmota.wifi()` would wrongly report wifi as up
- Inverted shutter now reflect status also in WEBGUI and several minor fixes to make "inverted" consistant (#18701)
- Matter fix fabric provisioning from CASE session for iOS 16.5
- Matter fix fabric provisioning from CASE session for iOS 16.5 (#18709)
- ESP32 SPI initialization for MFRC522 (#18711)

### Removed

Expand Down
12 changes: 7 additions & 5 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,15 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Shutter sliders in WEBGUI automatically appear and disappear during configuration and update during movement [#18701](https://github.com/arendst/Tasmota/issues/18701)

### Fixed
- ESP8266 Energy Export Active no update regression from v12.3.1.3
- ESP32 InfluxDb initial connection delays using HTTPClient [#18015](https://github.com/arendst/Tasmota/issues/18015)
- ESP8266 no update on Energy Export Active regression from v12.3.1.3
- NovaSDS GUI values [#18444](https://github.com/arendst/Tasmota/issues/18444)
- LED PWM ac_dimmer curve was wrongly applied instead of Gamma regression from v12.2.0.5 [#18666](https://github.com/arendst/Tasmota/issues/18666)
- AIThinker webcam issues [#18652](https://github.com/arendst/Tasmota/issues/18652)
- Shutter bootloop using more than 4 shutters [#18673](https://github.com/arendst/Tasmota/issues/18673)
- Inverted shutter now reflect status also in WEBGUI and several minor fixes to make "inverted" consistant [#18701](https://github.com/arendst/Tasmota/issues/18701)
- Berry rules for string comparisons [#18464](https://github.com/arendst/Tasmota/issues/18464)
- Berry a rare condition when a GC causes a memory corruption
- ESP32 Partition_Manager.tapp
- ESP32 InfluxDb initial connection delays using HTTPClient [#18015](https://github.com/arendst/Tasmota/issues/18015)
- ESP32 AIThinker webcam issues [#18652](https://github.com/arendst/Tasmota/issues/18652)
- ESP32 SPI initialization for MFRC522 [#18711](https://github.com/arendst/Tasmota/issues/18711)
- Berry a rare condition when a GC causes a memory corruption
- Berry rules for string comparisons [#18464](https://github.com/arendst/Tasmota/issues/18464)
- Matter fix fabric provisioning from CASE session for iOS 16.5 [#18709](https://github.com/arendst/Tasmota/issues/18709)
7 changes: 6 additions & 1 deletion tasmota/tasmota_xsns_sensor/xsns_80_mfrc522.ino
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,14 @@ void RC522ScanForTag(void) {
}

void RC522Init(void) {
if (PinUsed(GPIO_RC522_CS) && PinUsed(GPIO_RC522_RST) && TasmotaGlobal.spi_enabled) {
if (PinUsed(GPIO_RC522_CS) && PinUsed(GPIO_RC522_RST) && (SPI_MOSI_MISO == TasmotaGlobal.spi_enabled)) {
Mfrc522 = new MFRC522(Pin(GPIO_RC522_CS), Pin(GPIO_RC522_RST));
#ifdef EPS8266
SPI.begin();
#endif // EPS8266
#ifdef ESP32
SPI.begin(Pin(GPIO_SPI_CLK), Pin(GPIO_SPI_MISO), Pin(GPIO_SPI_MOSI), -1);
#endif // ESP32
Mfrc522->PCD_Init();
// if (Mfrc522->PCD_PerformSelfTest()) { // Saves 0k5 code
uint8_t v = Mfrc522->PCD_ReadRegister(Mfrc522->VersionReg);
Expand Down

1 comment on commit 10f9c20

@msedv
Copy link
Contributor

@msedv msedv commented on 10f9c20 Jul 28, 2023

Choose a reason for hiding this comment

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

EPS8266 instead of ESP8266. See #19207

Please sign in to comment.