mifare firmware update

This commit is contained in:
roel@libnfc.org 2009-12-30 00:11:50 +00:00
commit 32cfae439e
4 changed files with 197 additions and 6 deletions

View file

@ -64,6 +64,24 @@ char* strncat(char *dest, const char *src, unsigned int n)
return dest;
}
void num_to_bytes(uint64_t n, size_t len, byte_t* dest)
{
while (len--) {
dest[len] = (byte_t) n;
n >>= 8;
}
}
uint64_t bytes_to_num(byte_t* src, size_t len)
{
uint64_t num = 0;
while (len--)
{
num = (num << 8) | (*src);
src++;
}
return num;
}
void LEDsoff()
{