Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

µC/LIB User's Guide

µC/CPU User's Manual

µC/Common DocumentationModule


Listing - AppTaskStart shows an example of the application initialization task that should be started by the RTOS. The listing shows also what prerequisite modules that must absolutely initialized prior calling the TCP/IP function AppInit_TCPIP(), which would be responsible to initialize the Network protocol tacks. Section Sample applications will detailed the contain of the AppInit_TCPIP() function depending on the type of interface used.


Code Block
languagecpp
themeConfluence
firstline1
titleAppTaskStart
linenumberstrue
static  void  AppTaskStart (void *p_arg)                        
{
    CPU_INT32U  cpu_clk_freq;
    CPU_INT32U  cnts;
    OS_ERR      err_os;
    KAL_ERR     kal_err;
    NET_ERR     net_err;

    (void)&p_arg;

    BSP_Init();                                                 (1) 
    CPU_Init();                                                                                
    Mem_Init();   
                                        
    AppInit_TCPIP(&net_err);                                    (2)
                                                                (3)
                                          
    while (1) {                                                                                    
        OSTimeDlyHMSM((CPU_INT16U) 0u,                         
                      (CPU_INT16U) 0u, 
                      (CPU_INT16U) 0u, 
                      (CPU_INT16U) 100u, 
                      (OS_OPT    ) OS_OPT_TIME_HMSM_STRICT,
                      (OS_ERR   *)&err_os);
    }
}


Panel
bgColor#f0f0f0

(1) BSP_Init(), CPU_Init() and Mem_Init() must be called prior to the TCP-IP initialization function AppInit_TCPIP().

(2) AppInit_TCPIP() initializes the µC/TCP-IP stack and the initial parameters to configure it.

(3) If other IP applications are required this is where they are initialized.