From ac9f6aadbae134733113d55f68e556209519dc81 Mon Sep 17 00:00:00 2001 From: Sucareto <28331534+Sucareto@users.noreply.github.com> Date: Fri, 20 May 2022 18:53:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Arduino-Aime-Reader.ino | 14 -------------- README.md | 2 +- cmd.h | 14 +++----------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/Arduino-Aime-Reader.ino b/Arduino-Aime-Reader.ino index 6e729a3..016d4da 100644 --- a/Arduino-Aime-Reader.ino +++ b/Arduino-Aime-Reader.ino @@ -19,25 +19,11 @@ void setup() { SerialDevice.begin(high_baudrate ? 115200 : 38400); FastLED.showColor(high_baudrate ? 0x0000FF : 0x00FF00); - -#ifdef SwitchBaudPIN -#pragma message "已启用波特率切换功能" - pinMode(SwitchBaudPIN, INPUT_PULLUP); -#endif } void loop() { SerialCheck(); packet_write(); -#ifdef SwitchBaudPIN - if (!digitalRead(SwitchBaudPIN)) { - high_baudrate = !high_baudrate; - SerialDevice.flush(); - SerialDevice.begin(high_baudrate ? 115200 : 38400); - FastLED.showColor(high_baudrate ? 0x0000FF : 0x00FF00); - delay(2000); - } -#endif } static uint8_t len, r, checksum; diff --git a/README.md b/README.md index ecfb883..95bb929 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,12 @@ - SparkFun Pro Micro(ATmega32U4),需要发送 DTR/RTS - SparkFun SAMD21 Dev Breakout(ATSAMD21G18) - NodeMCU 1.0(ESP-12E + CP2102 & CH340),SDA=D2,SCL=D1 +- NodeMCU-32S(ESP32-S + CH340) ### 已知问题: - 在 NDA_08 命令的写入 Felica 操作没有实现,因为未确认是否会影响卡片后续使用 - 未确定`res.status`的意义,因此`res.status = 1;`可能是错误的 -- 因为`get_fw`和`get_hw`返回的是自定义版本号,启动时可能触发 amdaemon 的固件升级,可以将 aime_firm 文件夹重命名或删除 - 未实现`mifare_select_tag`,未支持多卡选择,只会读到最先识别的卡片 diff --git a/cmd.h b/cmd.h index b4717e6..159c1cb 100644 --- a/cmd.h +++ b/cmd.h @@ -12,7 +12,6 @@ CRGB leds[NUM_LEDS]; #pragma message "当前的开发板是 NODEMCU_ESP12E" #define SerialDevice Serial #define LED_PIN D5 -//#define SwitchBaudPIN D4 //修改波特率按钮 #elif defined(ARDUINO_NodeMCU_32S) #pragma message "当前的开发板是 NodeMCU_32S" @@ -52,8 +51,8 @@ enum { SG_NFC_CMD_MIFARE_READ_BLOCK = 0x52, SG_NFC_CMD_MIFARE_SET_KEY_AIME = 0x54, SG_NFC_CMD_AIME_AUTHENTICATE = 0x55, - SG_NFC_CMD_UNKNOW0 = 0x60, /* maybe some stuff about AimePay*/ - SG_NFC_CMD_UNKNOW1 = 0x61, + SG_NFC_CMD_TO_UPDATER_MODE = 0x60, + SG_NFC_CMD_SEND_HEX_DATA = 0x61, SG_NFC_CMD_RESET = 0x62, SG_NFC_CMD_FELICA_ENCAP = 0x71, SG_RGB_CMD_SET_COLOR = 0x81, @@ -181,18 +180,12 @@ static void sg_nfc_cmd_reset() { //重置读卡器 static void sg_nfc_cmd_get_fw_version() { sg_res_init(23); - // memcpy(res.version, "TN32MSEC003S F/W Ver1.2", 23); - memcpy(res.version, "-> Sucareto Aime Reader", 23); - // sg_res_init(1); - // memset(res.version, 0x94, 1); + memcpy(res.version, "TN32MSEC003S F/W Ver1.2", 23); } static void sg_nfc_cmd_get_hw_version() { sg_res_init(23); memcpy(res.version, "TN32MSEC003S H/W Ver3.0", 23); - // memcpy(res.version, "-> Sucareto Aime Reader", 23); - // sg_res_init(9); - // memcpy(res.version, "837-15396", 9); } static void sg_nfc_cmd_mifare_set_key_aime() { @@ -207,7 +200,6 @@ static void sg_nfc_cmd_mifare_set_key_bana() { static void sg_led_cmd_reset() { sg_res_init(); - FastLED.showColor(0); } static void sg_led_cmd_get_info() {