Redlib sscanf %hhu

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Redlib sscanf %hhu

1,501件の閲覧回数
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 返信

1,417件の閲覧回数
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 件の賞賛
返信