Add two threads into the IOT WIFIDemo for test_JacobShi

Dependencies:   C12832 HTTPClient wifiontros wifirtos mbed

Fork of frdm_rtos by Freescale

sysinterface.cpp

Committer:
shiyilei
Date:
2014-12-05
Revision:
4:242715d40e54
Parent:
3:5f921ff0868d

File content as of revision 4:242715d40e54:

#include "sysinterface.h"

PUBLICDATA globaldata;
    
DigitalOut threadled(LED1);
void send_task(void const *args)
{
    while(1)
    {
        if(globaldata.send_ready==1)
        {
                globaldata.send_ready=0;
                short idx=baselevel_send_data(globaldata.send_buffer,globaldata.send_length);
                    globaldata.send_length_over=idx;
                    globaldata.send_completed=1;    
        }
        
        
        threadled=!threadled;
        Thread::wait(20);
    }
}


void recv_task(void const *args)
{
    
    int lengthtemp;
    while(1)
    {
        //recv_app();
            if(globaldata.receive_start==1)
    {
            globaldata.receive_length=baselevel_receive_data(globaldata.receive_buffer,globaldata.need_receive);
            if(globaldata.receive_length>0)
            {
                globaldata.receive_start=0;
                globaldata.receive_completed=1;
            }
    }

    
        Thread::wait(20);
    }

}