Redlib sscanf %hhu

cancel
Showing results for 
Search instead for 
Did you mean: 

Redlib sscanf %hhu

366 Views
kiryat8
Contributor III

I have a few files that are common to different microcontrollers and I noticed that sscanf %hhu seems not to work with the Redlib on a LPC54016 C project.

This is more less a snippet of my code:

unsigned char com_RXBuf[576];
unsigned char RegMode;
strcpy(com_RXBuf,"+CEREG: 0,5");
if (sscanf(com_RXBuf,"%*s %*u,%hhu",&RegMode)<1){
  RegMode = 4;
}

I can change the %hhu to %u but then I would have to use a #ifdef just for the LPC54016 in 7 places.

Is %hhu supported or is there a define that makes it supported.

Thanks

David

Labels (1)
0 Kudos
1 Reply

282 Views
converse
Senior Contributor V

Redlib is c90 with a couple of minor c99 extensions. I think %hhu/%c is c99 and not supported. See https://community.nxp.com/thread/389152 

0 Kudos