Quantcast
Channel: EngineerZone: Message List
Viewing all articles
Browse latest Browse all 24339

ADuCRF101 UART example code error

$
0
0

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


Viewing all articles
Browse latest Browse all 24339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>