[FL-1371] New LF-RFID app. Second encounter. (#547)
* File worker: file operations helper. * Notification app: removed yield * File worker: write operations, calls to system file widgets * App ibutton: use file worker * Lfrfid: generic key loading, add path helper and hex conversion to lib * FileWorker: plain C verison * FileWorker: add to lib.mk * FileWorker: add to C sources, instead of CPP * Lfrfid: save scene * App lfrfid: add key scene, saved key menu * App lfrfid: saved key info scene * App lfrfid: delete key scene
This commit is contained in:
16
lib/args/hex.c
Normal file
16
lib/args/hex.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "hex.h"
|
||||
|
||||
bool hex_char_to_hex_nibble(char c, uint8_t* nibble) {
|
||||
if((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) {
|
||||
if((c >= '0' && c <= '9')) {
|
||||
*nibble = c - '0';
|
||||
} else if((c >= 'A' && c <= 'F')) {
|
||||
*nibble = c - 'A' + 10;
|
||||
} else {
|
||||
*nibble = c - 'a' + 10;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user