Since GCC 10, the compiler defaults to -fno-common, thus variables with
multiple tentative definitions result in linker errors.
We've (me and @MrMoDDoM) extern-ed the shared variables to fix the issue.
Also, when I implemented ISR sharing, somehow I forgot about a function
which was shared as well, so I fixed that mistake and added a couple of
comments on how shared function calls work.
This adds automatic cloning of Mifare Ultralight cards to the selected
setting.
Currently, only the DUMP_MFU command existed. In order to clone a Mifare
Ultralight card, the user had to convert the hex output of DUMP_MFU to binary
and upload the result to the card.
The CLONE_MFU command will attempt to read and store the Mifare Ultralight
contents directy to the slot which is then transitioned to emulation mode.
The CLONE_MFU button action does the same, so the board can be configured to
clone cards by simply selecting a slot with one button and cloning with the
other.
This command is extended original identify command. Upon execution it
will do following:
- change current config to "reader" mode
- identify card
- if multiple or no card detected -> end
- change config to identified card (mifare classic 1k/4k or ultralight)
- set UID of the card
Signed-off-by: Michal Demin <michaldemin@gmail.com>
1. relocated EEPROM accessing functions
2. current FRAM log address is stored in FRAM
3. EEPROM contains flag that indicates whether this address in FRAM is valid
4. the log is written from SRAM to FRAM automatically
5. on boot, the Chameleon logs that it boots right now