Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

how implement a thread ... for call a function

I want call a function like in a freeRTOS thread
how i can do that in mongoose_os?

in this example, i would call the function "eMBMasterPoll" into a while(1)..

enum mgos_app_init_result mgos_app_init(void)
{
// Initialize protocol stack in RTU mode for a Master
eStatus = eMBMasterInit( MB_RTU, 1, 9600, MB_PAR_NONE );

// Enable the Modbus Protocol Stack.
eStatus = eMBMasterEnable( );

for( ;; )
{   
    // Call the main polling loop of the Modbus Master protocol stack.
    ( void )eMBMasterPoll(  );

    /* Here we simply count the number of poll cycles. */
    usRegInputBuf[0]++;
}

}

can someone help me?

Comments

Sign In or Register to comment.