gigabeatle

ADuCRF101 UART example code error

Discussion created by gigabeatle on Dec 4, 2014
Latest reply on Dec 5, 2014 by PatrickN

HI,

I would like to provide some kind of feedback by this way. Or at least to help to save some time to everyone who is starting with ADuCRF101 MCU and trying to figure out why example of UART from included CD (or from ftp) isn't working.

 

So there is an error in in file ./Common/RealView/Retarget.c

there are missing curly brackets in function "int fputc"

-------------it is-------------------------------------------------------

int fputc(int ch, FILE * stream )

{

   if(ch == '\n')

      while(!(COMLSR_THRE==(UrtLinSta(0) & COMLSR_THRE)));

   UrtTx(0, CR); /* output CR */

   while(!(COMLSR_THRE==(UrtLinSta(0) & COMLSR_THRE)));

   UrtTx(0, ch);

   return(ch);

}

 

--------------it should be-------------------------------------------

int fputc(int ch, FILE * stream )

{

   if(ch == '\n')

   { 

       while(!(COMLSR_THRE==(UrtLinSta(0) & COMLSR_THRE)));

       UrtTx(0, CR); /* output CR */

   }

   while(!(COMLSR_THRE==(UrtLinSta(0) & COMLSR_THRE)));

   UrtTx(0, ch);

   return(ch);

}

 

 

Regards,

Jan

Outcomes