MCPcopy Create free account
hub / github.com/ARMmbed/DAPLink / util_write_uint32

Function util_write_uint32

source/daplink/util.c:57–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57uint32_t util_write_uint32(char *str, uint32_t value)
58{
59 uint32_t temp_val;
60 uint64_t digits;
61 uint32_t i;
62 // Count the number of digits
63 digits = 0;
64 temp_val = value;
65
66 while (temp_val > 0) {
67 temp_val /= 10;
68 digits += 1;
69 }
70
71 if (digits <= 0) {
72 digits = 1;
73 }
74
75 // Write the number
76 for (i = 0; i < digits; i++) {
77 str[digits - i - 1] = '0' + (value % 10);
78 value /= 10;
79 }
80
81 return digits;
82}
83
84uint32_t util_write_uint32_zp(char *str, uint32_t value, uint16_t total_size)
85{

Callers 2

util_write_uint32_zpFunction · 0.85
uint32_field_in_regionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected