From 60528889ed015b327f29c7ae59579682da5342ab Mon Sep 17 00:00:00 2001 From: wu58430 Date: Sun, 10 Dec 2023 00:40:29 +0800 Subject: [PATCH] =?UTF-8?q?MDC=E8=81=94=E7=B3=BB=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 23 +++++++++++++---------- app/mdc1200.c | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 20efd53..f06adce 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -20,7 +20,10 @@ - + + + + diff --git a/app/mdc1200.c b/app/mdc1200.c index 33d570d..596744d 100644 --- a/app/mdc1200.c +++ b/app/mdc1200.c @@ -546,14 +546,14 @@ bool mdc1200_contact_find(uint16_t mdc_id, char *contact) { for (uint8_t i = 0; i < contact_num; i++) { uint8_t read_once[16]={0}; if ((i & 3) == 0 && i) add++; - EEPROM_ReadBuffer(MDC_ADD[add] + i * 16, read_once, 16); + EEPROM_ReadBuffer(MDC_ADD[add] +((i&3) <<4), read_once, 16); if (mdc_id == (uint16_t) (read_once[1] | (read_once[0] << 8))) { for (int j = 0; j < 14; ++j) { if(read_once[2+j]<' '||read_once[2+j]>'~') return false; - memcpy(contact,read_once+2,14); } + memcpy(contact,read_once+2,14); return true; }