FreeCalypso > hg > freecalypso-sw
view loadtools/hexdecode.c @ 867:c4da570dca83
int_osx_receive_prim() in gsm-fw/gpf/osx/osx.c: there was an error in the
reconstruction of this function from disassembly in the logic that implements
special handling for MPHC_RXLEV_REQ messages.
The code is now fixed to properly match what the binary object version does;
with this fix the firmware now performs the power measurement phase correctly
and the initial network registration succeeds.
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Sat, 16 May 2015 06:34:09 +0000 |
parents | aa1f6fe16fef |
children |
line wrap: on
line source
/* * This module contains the decode_hex_byte() function, * which is used by the SREC file reader and will likely be used * by other code as well, such as the dump-to-file function * of loadtool. */ #include <ctype.h> decode_hex_byte(s) char *s; { register int u, l; if (!isxdigit(s[0]) || !isxdigit(s[1])) return(-1); if (isdigit(s[0])) u = s[0] - '0'; else if (isupper(s[0])) u = s[0] - 'A' + 10; else u = s[0] - 'a' + 10; if (isdigit(s[1])) l = s[1] - '0'; else if (isupper(s[1])) l = s[1] - 'A' + 10; else l = s[1] - 'a' + 10; return((u << 4) | l); }