Part Number: MSP432E411Y
Tool/software: Code Composer Studio
Hello I always thank you for your help.
I am currently creating and using tcpip.c and mainthread.c.
This is my tcpip.c code.
|
#include <string.h> #include <pthread.h> #include <ti/net/slnetutils.h> #include <ti/display/Display.h> static int server = -1; #define TCPPACKETSIZE 256 extern Display_Handle display; extern void fdOpenSession(); void senddata(char* adcname, int time, int adcresult)
fdOpenSession(TaskSelf()); memset(&pc_addr, 0, sizeof(pc_addr)); while(1) if(status < 0) server = pc; while(1) close(pc); fdCloseSession(TaskSelf()); return (NULL); |
And this is my mainthread.c.
|
#include <ti/drivers/Timer.h> #include <pthread.h> #include "ti_drivers_config.h"
#define THREADSTACKSIZE (768) extern void senddata(char* adcname, int time, int adcresult); void timerCallback(Timer_Handle myHandle, int_fast16_t status); int sec = 0; void *mainThread(void *arg0) Timer_Params_init(¶ms); timer0 = Timer_open(CONFIG_TIMER_0, ¶ms); if (timer0 == NULL) { if (Timer_start(timer0) == Timer_STATUS_ERROR) { return (NULL); void timerCallback(Timer_Handle myHandle, int_fast16_t status) } |
Using the senddata function in tcpip.c, data is transferred to pc very well.
However, if the function is called in mainthread.c, data is not transmitted.
I may have coded stupidly.
After thinking for a few days, I couldn't figure it out.
The send function server was declared as an extern and sent was used by mainthread.c, but the result was the same.
What am I doing wrong?
Help me.