ARM Shanghai IoT Team (Internal) / Mbed 2 deprecated WifiaddThread

Dependencies:   C12832 HTTPClient wifiontros wifirtos mbed

Fork of frdm_rtos by Freescale

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sysinterface.cpp Source File

sysinterface.cpp

00001 #include "sysinterface.h"
00002 
00003 PUBLICDATA globaldata;
00004     
00005 DigitalOut threadled(LED1);
00006 void send_task(void const *args)
00007 {
00008     while(1)
00009     {
00010         if(globaldata.send_ready==1)
00011         {
00012                 globaldata.send_ready=0;
00013                 short idx=baselevel_send_data(globaldata.send_buffer,globaldata.send_length);
00014                     globaldata.send_length_over=idx;
00015                     globaldata.send_completed=1;    
00016         }
00017         
00018         
00019         threadled=!threadled;
00020         Thread::wait(20);
00021     }
00022 }
00023 
00024 
00025 void recv_task(void const *args)
00026 {
00027     
00028     int lengthtemp;
00029     while(1)
00030     {
00031         //recv_app();
00032             if(globaldata.receive_start==1)
00033     {
00034             globaldata.receive_length=baselevel_receive_data(globaldata.receive_buffer,globaldata.need_receive);
00035             if(globaldata.receive_length>0)
00036             {
00037                 globaldata.receive_start=0;
00038                 globaldata.receive_completed=1;
00039             }
00040     }
00041 
00042     
00043         Thread::wait(20);
00044     }
00045 
00046 }