AnsweredAssumed Answered

MySerialPtr = AS1_Init(NULL); problem

Question asked by Ken Armitage on Sep 24, 2018
Latest reply on Sep 24, 2018 by Erich Styger

I'm trying to use the ASerialLDD1 serial component - more specifically the RecvBlock and SendBlock functions.

I found the following code in the help on the component;

Component documentation - Typical Usage

volatile bool DataReceivedFlg = FALSE; char OutData[] = "Hello world"; char InpData[10]; LDD_TError Error; LDD_TDeviceData *MySerialPtr;  void main(void) {   . . .   MySerialPtr = AS1_Init(NULL);                                     /* Initialization of AS1 component */   for(;;) {     Error = AS1_ReceiveBlock(MySerialPtr, InpData, 1U);             /* Start reception of one character */     while (!DataReceivedFlg) {                                      /* Wait until 'e' character is received */     }     if (InpData[0] == 'e') {       Error = AS1_SendBlock(MySerialPtr, OutData, sizeof(OutData)); /* Send block of characters */     }     DataReceivedFlg = FALSE;   } }

But when I add this code to my project, I get an error message from the compiler;

MySerialPtr = AS1_Init(NULL);

too many agrumentsto function AS1_Init void value not ignored as it should be.


Has anyone else seen this or am I doing something wrong...?