use a macro

the hex_asc_upper_lo macro which is defined before do the same thing.
pull/48/head
Heydar Elahi 2017-08-09 02:36:47 +04:30
parent 4c8fb05cb4
commit 243bab70d5
1 changed files with 1 additions and 1 deletions

2
lib.c
View File

@ -69,7 +69,7 @@ static inline void _put_id(char *buf, int end_offset, canid_t id)
{ {
/* build 3 (SFF) or 8 (EFF) digit CAN identifier */ /* build 3 (SFF) or 8 (EFF) digit CAN identifier */
while (end_offset >= 0) { while (end_offset >= 0) {
buf[end_offset--] = hex_asc_upper[id & 0xF]; buf[end_offset--] = hex_asc_upper_lo(id);
id >>= 4; id >>= 4;
} }
} }