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; }