Redlib sscanf %hhu

取消
显示结果 
搜索替代 
您的意思是: 

Redlib sscanf %hhu

803 次查看
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

标签 (1)
0 项奖励
1 回复

719 次查看
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 项奖励