Skip to content

Commit

Permalink
Merge pull request #36 from aveao/rrgulfix
Browse files Browse the repository at this point in the history
UL: Handle compatibility writes correctly
  • Loading branch information
iceman1001 authored Sep 12, 2020
2 parents cc2b0db + b430b37 commit 2a9dcfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Firmware/Chameleon-Mini/Application/MifareUltralight.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static uint16_t AppProcess(uint8_t *const Buffer, uint16_t ByteCount) {

//Handle MF ULC counter
if (CompatWritePageAddress == MF_ULC_COUNTER_ADDRESS && Flavor == UL_C) {
if (IncrementCounter(&Buffer[2])) {
if (IncrementCounter(&Buffer[0])) {
Buffer[0] = ACK_VALUE;
return ACK_FRAME_SIZE;
} else {
Expand All @@ -294,7 +294,7 @@ static uint16_t AppProcess(uint8_t *const Buffer, uint16_t ByteCount) {
}
}

AppWritePage(CompatWritePageAddress, &Buffer[2]);
AppWritePage(CompatWritePageAddress, &Buffer[0]);
Buffer[0] = ACK_VALUE;
return ACK_FRAME_SIZE;
}
Expand Down

0 comments on commit 2a9dcfa

Please sign in to comment.