MCPcopy Index your code
hub / github.com/ThrowTheSwitch/Unity / UnityPrintNumberHex

Function UnityPrintNumberHex

src/unity.c:273–296  ·  view source on GitHub ↗

-----------------------------------------------*/

Source from the content-addressed store, hash-verified

271
272/*-----------------------------------------------*/
273void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print)
274{
275 int nibble;
276 char nibbles = nibbles_to_print;
277
278 if ((unsigned)nibbles > UNITY_MAX_NIBBLES)
279 {
280 nibbles = UNITY_MAX_NIBBLES;
281 }
282
283 while (nibbles > 0)
284 {
285 nibbles--;
286 nibble = (int)(number >> (nibbles * 4)) & 0x0F;
287 if (nibble <= 9)
288 {
289 UNITY_OUTPUT_CHAR((char)('0' + nibble));
290 }
291 else
292 {
293 UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble));
294 }
295 }
296}
297
298/*-----------------------------------------------*/
299void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number)

Callers 5

UnityPrintCharFunction · 0.85
UnityPrintLenFunction · 0.85
UnityPrintNumberByStyleFunction · 0.85
unity.cFile · 0.85

Calls

no outgoing calls

Tested by 1