miguelbalboa / rfid

Arduino RFID Library for MFRC522
The Unlicense
2.75k stars 1.43k forks source link

Support for new Arduino Nano Every (ATMEGA4809) planned? #483

Closed seisfeld closed 5 years ago

seisfeld commented 5 years ago

Step 1: Describe your environment

Step 2: Describe the problem

Arduino IDE claims incompatibility of the library to the new Arduino Nano Every board, yet the library seems to compile and work fine (as far as I could test it). No further warnings or errors were observed.

Affected file(s) or example(s):

Steps to reproduce:

  1. set board to Arduino Nano Every
  2. load DumpInfo example into the IDE
  3. hit compile

Observed Results:

WARNING: library MFRC522 claims to run on (avr, STM32F1, teensy, esp8266, samd) architecture(s) and may be incompatible with your current board which runs on (megaavr) architecture(s).

Expected Results:

I'd expect to see no warning. Maybe the only fix required is to update the architectures line in the library.properties file?

Relevant Code:

#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN         9          // Configurable, see typical pin layout above
#define SS_PIN          10         // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create MFRC522 instance

void setup() {
    Serial.begin(9600);     // Initialize serial communications with the PC
    while (!Serial);        // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
    SPI.begin();            // Init SPI bus
    mfrc522.PCD_Init();     // Init MFRC522
    delay(4);               // Optional delay. Some board do need more time after init to be ready, see Readme
    mfrc522.PCD_DumpVersionToSerial();  // Show details of PCD - MFRC522 Card Reader details
    Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}

void loop() {
    // Reset the loop if no new card present on the sensor/reader. This saves the entire process when idle.
    if ( ! mfrc522.PICC_IsNewCardPresent()) {
        return;
    }

    // Select one of the cards
    if ( ! mfrc522.PICC_ReadCardSerial()) {
        return;
    }

    // Dump debug info about the card; PICC_HaltA() is automatically called
    mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}
name=MFRC522
version=1.4.4
author=GithubCommunity
maintainer=GithubCommunity
sentence=Arduino RFID Library for MFRC522 (SPI)
paragraph=Read/Write a RFID Card or Tag using the ISO/IEC 14443A/MIFARE interface.
category=Communication
url=https://github.com/miguelbalboa/rfid
architectures=avr,STM32F1,teensy,esp8266,esp32,samd
Rotzbua commented 5 years ago

it is just a warning, so you dont have to care. if it works make a pull request with changed architecture.