Added Mifare Ultralight C support.

Changed SettingsSetActiveById() to first MemoryRecall() before initializing Application.
This commit is contained in:
slaenger
2019-09-17 10:25:14 +02:00
parent f02a45b6ef
commit 96ff627f48
3 changed files with 21 additions and 2 deletions
+17
View File
@@ -18,6 +18,7 @@ static const MapEntryType PROGMEM ConfigurationMap[] = {
{ .Id = CONFIG_MF_ULTRALIGHT, .Text = "MF_ULTRALIGHT" },
{ .Id = CONFIG_MF_ULTRALIGHT_EV1_80B, .Text = "MF_ULTRALIGHT_EV1_80B" },
{ .Id = CONFIG_MF_ULTRALIGHT_EV1_164B, .Text = "MF_ULTRALIGHT_EV1_164B" },
{.Id = CONFIG_MF_ULTRALIGHT_C, .Text = "MF_ULTRALIGHT_C"},
#endif
#ifdef CONFIG_MF_CLASSIC_MINI_4B_SUPPORT
{ .Id = CONFIG_MF_CLASSIC_MINI_4B, .Text = "MF_CLASSIC_MINI_4B" },
@@ -107,6 +108,22 @@ static const PROGMEM ConfigurationType ConfigurationTable[] = {
.ReadOnly = false,
.TagFamily = TAG_FAMILY_ISO14443A
},
[CONFIG_MF_ULTRALIGHT_C] ={
.CodecInitFunc = ISO14443ACodecInit,
.CodecDeInitFunc = ISO14443ACodecDeInit,
.CodecTaskFunc = ISO14443ACodecTask,
.ApplicationInitFunc = MifareUltralightCAppInit,
.ApplicationResetFunc = MifareUltralightCAppReset,
.ApplicationTaskFunc = MifareUltralightAppTask,
.ApplicationTickFunc = ApplicationTickDummy,
.ApplicationProcessFunc = MifareUltralightAppProcess,
.ApplicationGetUidFunc = MifareUltralightGetUid,
.ApplicationSetUidFunc = MifareUltralightSetUid,
.UidSize = MIFARE_ULTRALIGHT_UID_SIZE,
.MemorySize = MIFARE_ULTRALIGHTC_MEM_SIZE,
.ReadOnly = false,
.TagFamily = TAG_FAMILY_ISO14443A
},
[CONFIG_MF_ULTRALIGHT_EV1_80B] = {
.CodecInitFunc = ISO14443ACodecInit,
.CodecDeInitFunc = ISO14443ACodecDeInit,
+1
View File
@@ -22,6 +22,7 @@ typedef enum {
#ifdef CONFIG_MF_ULTRALIGHT_SUPPORT
CONFIG_MF_ULTRALIGHT,
CONFIG_MF_ULTRALIGHT_C,
CONFIG_MF_ULTRALIGHT_EV1_80B,
CONFIG_MF_ULTRALIGHT_EV1_164B,
#endif
+3 -2
View File
@@ -72,12 +72,13 @@ bool SettingsSetActiveById(uint8_t Setting) {
GlobalSettings.ActiveSettingPtr =
&GlobalSettings.Settings[SettingIdx];
/* Recall new memory contents ( Moved this to allow for Access to new Memory in Application init())*/
MemoryRecall();
/* Settings have changed. Progress changes through system */
ConfigurationSetById(GlobalSettings.ActiveSettingPtr->Configuration);
LogSetModeById(GlobalSettings.ActiveSettingPtr->LogMode);
/* Recall new memory contents */
MemoryRecall();
SETTING_UPDATE(GlobalSettings.ActiveSettingIdx);
SETTING_UPDATE(GlobalSettings.ActiveSettingPtr);