AzureMXChip/MXCHIPAZ3166/core/lib/netxduo/samples/demo_netx_duo_ptp_client.c
void    tx_application_define(void *first_unused_memory)
{

UINT  status;


    /* Initialize the NetX system.  */
    nx_system_initialize();

    /* Create a packet pool.  */
    status =  nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536,  (ULONG*)(((int)packet_pool_area + 15) & ~15) , sizeof(packet_pool_area));

    /* Check for pool creation error.  */
    if (status)
        error_counter++;

    /* Create an IP instance.  */
    status = nx_ip_create(&ip_0,
                          "NetX IP Instance 0",
                          IPV4_ADDRESS,
                          IPV4_NETWORK_MASK,
                          &pool_0,
                          NETWORK_DRIVER,
                          (UCHAR*)ip_thread_stack,
                          sizeof(ip_thread_stack),
                          1);

    /* Check for IP create errors.  */
    if (status)
        error_counter++;

    /* Enable ARP and supply ARP cache memory for IP Instance 0.  */
    status =  nx_arp_enable(&ip_0, (void *)arp_space_area, sizeof(arp_space_area));

    /* Check for ARP enable errors.  */
    if (status)
        error_counter++;

    /* Enable TCP traffic.  */
    status =  nx_tcp_enable(&ip_0);

    /* Check for TCP enable errors.  */
    if (status)
        error_counter++;

    /* Enable UDP traffic.  */
    status =  nx_udp_enable(&ip_0);

    /* Check for UDP enable errors.  */
    if (status)
        error_counter++;

    /* Enable ICMP.  */
    status =  nx_icmp_enable(&ip_0);

    /* Check for errors.  */
    if (status)
        error_counter++;

    /* Create the main thread.  */
    tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
                     thread_0_stack, sizeof(thread_0_stack),
                     4, 4, TX_NO_TIME_SLICE, TX_AUTO_START);
}
/* Define what the initial system looks like.  */
Define what the initial system looks like.
Define what the initial system looks like .
void    tx_application_define(void *first_unused_memory)
{
UINT  status;
    nx_system_initialize();
    status =  nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536,  (ULONG*)(((int)packet_pool_area + 15) & ~15) , sizeof(packet_pool_area));
    if (status)
        error_counter++;
    status = nx_ip_create(&ip_0,
                          "NetX IP Instance 0",
                          IPV4_ADDRESS,
                          IPV4_NETWORK_MASK,
                          &pool_0,
                          NETWORK_DRIVER,
                          (UCHAR*)ip_thread_stack,
                          sizeof(ip_thread_stack),
                          1);
    if (status)
        error_counter++;
    status =  nx_arp_enable(&ip_0, (void *)arp_space_area, sizeof(arp_space_area));
    if (status)
        error_counter++;
    status =  nx_tcp_enable(&ip_0);
    if (status)
        error_counter++;
    status =  nx_udp_enable(&ip_0);
    if (status)
        error_counter++;
    status =  nx_icmp_enable(&ip_0);
    if (status)
        error_counter++;
    tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
                     thread_0_stack, sizeof(thread_0_stack),
                     4, 4, TX_NO_TIME_SLICE, TX_AUTO_START);
}
void tx_application_define ( void * first_unused_memory ) { UINT status ; nx_system_initialize ( ) ; status = nx_packet_pool_create ( & pool_0 , " " , 1536 , ( ULONG * ) ( ( ( int ) packet_pool_area + 15 ) & ~ 15 ) , sizeof ( packet_pool_area ) ) ; if ( status ) error_counter ++ ; status = nx_ip_create ( & ip_0 , " " , IPV4_ADDRESS , IPV4_NETWORK_MASK , & pool_0 , NETWORK_DRIVER , ( UCHAR * ) ip_thread_stack , sizeof ( ip_thread_stack ) , 1 ) ; if ( status ) error_counter ++ ; status = nx_arp_enable ( & ip_0 , ( void * ) arp_space_area , sizeof ( arp_space_area ) ) ; if ( status ) error_counter ++ ; status = nx_tcp_enable ( & ip_0 ) ; if ( status ) error_counter ++ ; status = nx_udp_enable ( & ip_0 ) ; if ( status ) error_counter ++ ; status = nx_icmp_enable ( & ip_0 ) ; if ( status ) error_counter ++ ; tx_thread_create ( & thread_0 , " " , thread_0_entry , 0 , thread_0_stack , sizeof ( thread_0_stack ) , 4 , 4 , TX_NO_TIME_SLICE , TX_AUTO_START ) ; }
Define what the initial system looks like.
Define what the initial system looks like .
/* Initialize the NetX system.  */ /* Create a packet pool.  */ /* Check for pool creation error.  */ /* Create an IP instance.  */ /* Check for IP create errors.  */ /* Enable ARP and supply ARP cache memory for IP Instance 0.  */ /* Check for ARP enable errors.  */ /* Enable TCP traffic.  */ /* Check for TCP enable errors.  */ /* Enable UDP traffic.  */ /* Check for UDP enable errors.  */ /* Enable ICMP.  */ /* Check for errors.  */ /* Create the main thread.  */