1
0
mirror of synced 2024-12-18 02:15:52 +01:00

删除多余代码。

This commit is contained in:
Sucareto 2022-05-20 18:53:52 +08:00
parent 029e06eae9
commit ac9f6aadba
3 changed files with 4 additions and 26 deletions

View File

@ -19,25 +19,11 @@ void setup() {
SerialDevice.begin(high_baudrate ? 115200 : 38400); SerialDevice.begin(high_baudrate ? 115200 : 38400);
FastLED.showColor(high_baudrate ? 0x0000FF : 0x00FF00); FastLED.showColor(high_baudrate ? 0x0000FF : 0x00FF00);
#ifdef SwitchBaudPIN
#pragma message "已启用波特率切换功能"
pinMode(SwitchBaudPIN, INPUT_PULLUP);
#endif
} }
void loop() { void loop() {
SerialCheck(); SerialCheck();
packet_write(); 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; static uint8_t len, r, checksum;

View File

@ -38,12 +38,12 @@
- SparkFun Pro MicroATmega32U4需要发送 DTR/RTS - SparkFun Pro MicroATmega32U4需要发送 DTR/RTS
- SparkFun SAMD21 Dev BreakoutATSAMD21G18 - SparkFun SAMD21 Dev BreakoutATSAMD21G18
- NodeMCU 1.0ESP-12E + CP2102 & CH340SDA=D2SCL=D1 - NodeMCU 1.0ESP-12E + CP2102 & CH340SDA=D2SCL=D1
- NodeMCU-32SESP32-S + CH340
### 已知问题: ### 已知问题:
- 在 NDA_08 命令的写入 Felica 操作没有实现,因为未确认是否会影响卡片后续使用 - 在 NDA_08 命令的写入 Felica 操作没有实现,因为未确认是否会影响卡片后续使用
- 未确定`res.status`的意义,因此`res.status = 1;`可能是错误的 - 未确定`res.status`的意义,因此`res.status = 1;`可能是错误的
- 因为`get_fw`和`get_hw`返回的是自定义版本号,启动时可能触发 amdaemon 的固件升级,可以将 aime_firm 文件夹重命名或删除
- 未实现`mifare_select_tag`,未支持多卡选择,只会读到最先识别的卡片 - 未实现`mifare_select_tag`,未支持多卡选择,只会读到最先识别的卡片

14
cmd.h
View File

@ -12,7 +12,6 @@ CRGB leds[NUM_LEDS];
#pragma message "当前的开发板是 NODEMCU_ESP12E" #pragma message "当前的开发板是 NODEMCU_ESP12E"
#define SerialDevice Serial #define SerialDevice Serial
#define LED_PIN D5 #define LED_PIN D5
//#define SwitchBaudPIN D4 //修改波特率按钮
#elif defined(ARDUINO_NodeMCU_32S) #elif defined(ARDUINO_NodeMCU_32S)
#pragma message "当前的开发板是 NodeMCU_32S" #pragma message "当前的开发板是 NodeMCU_32S"
@ -52,8 +51,8 @@ enum {
SG_NFC_CMD_MIFARE_READ_BLOCK = 0x52, SG_NFC_CMD_MIFARE_READ_BLOCK = 0x52,
SG_NFC_CMD_MIFARE_SET_KEY_AIME = 0x54, SG_NFC_CMD_MIFARE_SET_KEY_AIME = 0x54,
SG_NFC_CMD_AIME_AUTHENTICATE = 0x55, SG_NFC_CMD_AIME_AUTHENTICATE = 0x55,
SG_NFC_CMD_UNKNOW0 = 0x60, /* maybe some stuff about AimePay*/ SG_NFC_CMD_TO_UPDATER_MODE = 0x60,
SG_NFC_CMD_UNKNOW1 = 0x61, SG_NFC_CMD_SEND_HEX_DATA = 0x61,
SG_NFC_CMD_RESET = 0x62, SG_NFC_CMD_RESET = 0x62,
SG_NFC_CMD_FELICA_ENCAP = 0x71, SG_NFC_CMD_FELICA_ENCAP = 0x71,
SG_RGB_CMD_SET_COLOR = 0x81, SG_RGB_CMD_SET_COLOR = 0x81,
@ -181,18 +180,12 @@ static void sg_nfc_cmd_reset() { //重置读卡器
static void sg_nfc_cmd_get_fw_version() { static void sg_nfc_cmd_get_fw_version() {
sg_res_init(23); sg_res_init(23);
// memcpy(res.version, "TN32MSEC003S F/W Ver1.2", 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);
} }
static void sg_nfc_cmd_get_hw_version() { static void sg_nfc_cmd_get_hw_version() {
sg_res_init(23); sg_res_init(23);
memcpy(res.version, "TN32MSEC003S H/W Ver3.0", 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() { 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() { static void sg_led_cmd_reset() {
sg_res_init(); sg_res_init();
FastLED.showColor(0);
} }
static void sg_led_cmd_get_info() { static void sg_led_cmd_get_info() {