Research, development and trades concerning the powerful Proxmark3 device.
Remember; sharing is caring. Bring something back to the community.
"Learn the tools of the trade the hard way." +Fravia
Time changes and with it the technology
Proxmark3 @ discord
Users of this forum, please be aware that information stored on this site is not private.
I'm exploring the arm<->fpga interaction and development a bit deeper. I'm comparing the way iclass and iso14443a differs (and they are pretty similar).
But what does this block of code do? Specifically, casting a uint8_t (b) to void in a statement - what is the effect of that?
iclass.c:
uint8_t b = 0;
[...]
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
volatile uint8_t b = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
(void)b;
}
iso14443a.c:
static int EmSendCmd14443aRaw(uint8_t *resp, int respLen, bool correctionNeeded)
{
uint8_t b;
[...]
// clear receiving shift register and holding register
while(!(AT91C_BASE_SSC->SSC_SR & AT91C_SSC_RXRDY));
b = AT91C_BASE_SSC->SSC_RHR; (void) b;
while(!(AT91C_BASE_SSC->SSC_SR & AT91C_SSC_RXRDY));
b = AT91C_BASE_SSC->SSC_RHR; (void) b;
And in the later case, b isn't even declared volatile. Isn't that statement optimized removed by the compiler?