Skip to content

Commit 26f6a01

Browse files
authored
expand error code printf to 4 chars. (#233)
1 parent 70879d5 commit 26f6a01

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

core/src/sntp_client.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void set_sntp_time()
7676
status = nx_sntp_client_get_local_time(&sntp_client, &seconds, &milliseconds, NX_NULL);
7777
if (status != NX_SUCCESS)
7878
{
79-
printf("FAIL: Internal error with getting local time (0x%02x)\n", status);
79+
printf("FAIL: Internal error with getting local time (0x%04x)\n", status);
8080
return;
8181
}
8282

@@ -123,7 +123,7 @@ static UINT sntp_client_run()
123123
NX_IP_VERSION_V4);
124124
if (status != NX_SUCCESS)
125125
{
126-
printf("\tFAIL: Unable to resolve DNS for SNTP Server %s (0x%02x)\r\n", SNTP_SERVER[sntp_server_count], status);
126+
printf("\tFAIL: Unable to resolve DNS for SNTP Server %s (0x%04x)\r\n", SNTP_SERVER[sntp_server_count], status);
127127
return status;
128128
}
129129

@@ -134,7 +134,7 @@ static UINT sntp_client_run()
134134
status = nxd_sntp_client_initialize_unicast(&sntp_client, &sntp_address);
135135
if (status != NX_SUCCESS)
136136
{
137-
printf("\tFAIL: Unable to initialize unicast SNTP client (0x%02x)\r\n", status);
137+
printf("\tFAIL: Unable to initialize unicast SNTP client (0x%04x)\r\n", status);
138138
nx_sntp_client_delete(&sntp_client);
139139
return status;
140140
}
@@ -143,7 +143,7 @@ static UINT sntp_client_run()
143143
status = nx_sntp_client_run_unicast(&sntp_client);
144144
if (status != NX_SUCCESS)
145145
{
146-
printf("\tFAIL: Unable to start unicast SNTP client (0x%02x)\r\n", status);
146+
printf("\tFAIL: Unable to start unicast SNTP client (0x%04x)\r\n", status);
147147
nx_sntp_client_stop(&sntp_client);
148148
nx_sntp_client_delete(&sntp_client);
149149
return status;
@@ -164,14 +164,14 @@ static void sntp_thread_entry(ULONG info)
164164
status = nx_sntp_client_create(&sntp_client, &nx_ip, 0, nx_ip.nx_ip_default_packet_pool, NX_NULL, NX_NULL, NULL);
165165
if (status != NX_SUCCESS)
166166
{
167-
printf("\tFAIL: SNTP client create failed (0x%02x)\r\n", status);
167+
printf("\tFAIL: SNTP client create failed (0x%04x)\r\n", status);
168168
return;
169169
}
170170

171171
status = nx_sntp_client_set_local_time(&sntp_client, 0, 0);
172172
if (status != NX_SUCCESS)
173173
{
174-
printf("\tFAIL: Unable to set local time for SNTP client (0x%02x)\r\n", status);
174+
printf("\tFAIL: Unable to set local time for SNTP client (0x%04x)\r\n", status);
175175
nx_sntp_client_delete(&sntp_client);
176176
return;
177177
}
@@ -180,7 +180,7 @@ static void sntp_thread_entry(ULONG info)
180180
status = nx_sntp_client_set_time_update_notify(&sntp_client, time_update_callback);
181181
if (status != NX_SUCCESS)
182182
{
183-
printf("\tFAIL: Unable to set time update notify CB (0x%02x)\r\n", status);
183+
printf("\tFAIL: Unable to set time update notify CB (0x%04x)\r\n", status);
184184
nx_sntp_client_delete(&sntp_client);
185185
return;
186186
}
@@ -199,7 +199,7 @@ static void sntp_thread_entry(ULONG info)
199199
status = nx_sntp_client_receiving_updates(&sntp_client, &server_status);
200200
if (status != NX_SUCCESS)
201201
{
202-
printf("FAIL: SNTP receiving updates call failed (0x%02x)\r\n", status);
202+
printf("FAIL: SNTP receiving updates call failed (0x%04x)\r\n", status);
203203
continue;
204204
}
205205

@@ -260,14 +260,14 @@ UINT sntp_start()
260260
status = tx_event_flags_create(&sntp_flags, "SNTP event flags");
261261
if (status != TX_SUCCESS)
262262
{
263-
printf("FAIL: Unable to create SNTP event flags (0x%02x)\r\n", status);
263+
printf("FAIL: Unable to create SNTP event flags (0x%04x)\r\n", status);
264264
return false;
265265
}
266266

267267
status = tx_mutex_create(&time_mutex, "time mutex", TX_NO_INHERIT);
268268
if (status != TX_SUCCESS)
269269
{
270-
printf("FAIL: Unable to create SNTP time mutex (0x%02x)\r\n", status);
270+
printf("FAIL: Unable to create SNTP time mutex (0x%04x)\r\n", status);
271271
return status;
272272
}
273273

@@ -283,7 +283,7 @@ UINT sntp_start()
283283
TX_AUTO_START);
284284
if (status != TX_SUCCESS)
285285
{
286-
printf("Unable to create SNTP thread (0x%02x)\r\n", status);
286+
printf("Unable to create SNTP thread (0x%04x)\r\n", status);
287287
return status;
288288
}
289289

0 commit comments

Comments
 (0)