mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-20 12:55:43 +08:00
Move nuttx/configs/stm3240g-eval/src/up_cxxinitialize.c to apps/platform/stm3240g-eval/
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
#if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0
|
||||
struct tftpc_args_s
|
||||
{
|
||||
bool binary; /* true:binary ("octect") false:text ("netascii") */
|
||||
bool binary; /* true:binary ("octet") false:text ("netascii") */
|
||||
bool allocated; /* true: destpath is allocated */
|
||||
char *destpath; /* Path at destination */
|
||||
const char *srcpath; /* Path at src */
|
||||
@@ -502,6 +502,7 @@ int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
free(args.destpath);
|
||||
}
|
||||
|
||||
free(fullpath);
|
||||
return OK;
|
||||
}
|
||||
@@ -596,7 +597,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
}
|
||||
|
||||
/* If both the network interface name and an IP address are supplied as
|
||||
* arguments, then ifconfig will set the address of the ethernet device:
|
||||
* arguments, then ifconfig will set the address of the Ethernet device:
|
||||
*
|
||||
* ifconfig nic_name ip_address
|
||||
*/
|
||||
@@ -677,7 +678,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* Set Hardware ethernet MAC addr */
|
||||
/* Set Hardware Ethernet MAC address */
|
||||
|
||||
if (hw)
|
||||
{
|
||||
@@ -915,12 +916,12 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
(ipaddr >> 16 ) & 0xff, (ipaddr >> 24 ) & 0xff,
|
||||
DEFAULT_PING_DATALEN);
|
||||
|
||||
start = g_system_timer;
|
||||
start = clock_systimer();
|
||||
for (i = 1; i <= count; i++)
|
||||
{
|
||||
/* Send the ECHO request and wait for the response */
|
||||
|
||||
next = g_system_timer;
|
||||
next = clock_systimer();
|
||||
seqno = uip_ping(ipaddr, id, i, DEFAULT_PING_DATALEN, maxwait);
|
||||
|
||||
/* Was any response returned? We can tell if a non-negative sequence
|
||||
@@ -934,7 +935,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
* to an earlier request, then fudge the elpased time.
|
||||
*/
|
||||
|
||||
elapsed = TICK2MSEC(g_system_timer - next);
|
||||
elapsed = TICK2MSEC(clock_systimer() - next);
|
||||
if (seqno < i)
|
||||
{
|
||||
elapsed += 100 * dsec * (i - seqno);
|
||||
@@ -952,7 +953,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
* to the current request!
|
||||
*/
|
||||
|
||||
elapsed = TICK2DSEC(g_system_timer - next);
|
||||
elapsed = TICK2DSEC(clock_systimer() - next);
|
||||
if (elapsed < dsec)
|
||||
{
|
||||
usleep(100000 * (dsec - elapsed));
|
||||
@@ -961,7 +962,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
|
||||
/* Get the total elapsed time */
|
||||
|
||||
elapsed = TICK2MSEC(g_system_timer - start);
|
||||
elapsed = TICK2MSEC(clock_systimer() - start);
|
||||
|
||||
/* Calculate the percentage of lost packets */
|
||||
|
||||
@@ -1013,6 +1014,7 @@ int cmd_put(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
free(args.destpath);
|
||||
}
|
||||
|
||||
free(fullpath);
|
||||
return OK;
|
||||
}
|
||||
@@ -1123,7 +1125,7 @@ int cmd_wget(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
nsh_output(vtbl, g_fmtcmdfailed, argv[0], "wget", NSH_ERRNO);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Free allocated resources */
|
||||
|
||||
@@ -1132,18 +1134,22 @@ exit:
|
||||
{
|
||||
close(fd);
|
||||
}
|
||||
|
||||
if (allocfile)
|
||||
{
|
||||
free(allocfile);
|
||||
}
|
||||
|
||||
if (fullpath)
|
||||
{
|
||||
free(fullpath);
|
||||
}
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
errout:
|
||||
|
Reference in New Issue
Block a user