Lines Matching refs:ch
102 static int hex(unsigned char ch);
122 static int hex(unsigned char ch) in hex() argument
124 if (ch >= 'a' && ch <= 'f') in hex()
125 return ch-'a'+10; in hex()
126 if (ch >= '0' && ch <= '9') in hex()
127 return ch-'0'; in hex()
128 if (ch >= 'A' && ch <= 'F') in hex()
129 return ch-'A'+10; in hex()
142 unsigned char ch; in getpacket() local
149 while ((ch = (getDebugChar() & 0x7f)) != '$') ; in getpacket()
159 ch = getDebugChar() & 0x7f; in getpacket()
160 if (ch == '#') in getpacket()
162 checksum = checksum + ch; in getpacket()
163 buffer[count] = ch; in getpacket()
172 if (ch == '#') { in getpacket()
209 unsigned char ch; in putpacket() local
220 while ((ch = buffer[count]) != 0) { in putpacket()
221 if (!(putDebugChar(ch))) in putpacket()
223 checksum += ch; in putpacket()
246 unsigned char ch; in mem2hex() local
251 ch = *(mem++); in mem2hex()
256 *buf++ = hexchars[ch >> 4]; in mem2hex()
257 *buf++ = hexchars[ch & 0xf]; in mem2hex()
274 unsigned char ch; in hex2mem() local
280 ch = hex(*buf++) << 4; in hex2mem()
281 ch |= hex(*buf++); in hex2mem()
282 *(mem++) = ch; in hex2mem()