Jul 13, 2020
07:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 13, 2020
07:14 AM
Hi all,
I am calling the sscanf function in my code but DAVE 4.3.2 ignores the %X specifier for interpreting Upper Case Hexadecimal input characters.
PHAB
I am calling the sscanf function in my code but DAVE 4.3.2 ignores the %X specifier for interpreting Upper Case Hexadecimal input characters.
PHAB
- Tags:
- IFX
5 Replies
Jul 14, 2020
12:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2020
12:47 AM
OK, to answer my own question...
DAVE 4 does not interpret the upper case specifier "%X" but it does interpret the lower case specifier "%x" for both lower case AND upper case input.
Here are some examples...
unsigned int Data;
// The following are OK, they return a Data value of 15
sscanf( "0xf", "%x", &Data );
sscanf( "0xF","%x", &Data );
sscanf( "F", "%x", &Data );
sscanf( "f", "%x", &Data );
// The following are NOT OK, the Data value does not change
sscanf( "0xF", "%X", &Data );
sscanf( "0xf", "%X", &Data );
sscanf( "F", "%X", &Data );
sscanf( "f", "%X", &Data );
This seems like a bug in the library.
PHAB
DAVE 4 does not interpret the upper case specifier "%X" but it does interpret the lower case specifier "%x" for both lower case AND upper case input.
Here are some examples...
unsigned int Data;
// The following are OK, they return a Data value of 15
sscanf( "0xf", "%x", &Data );
sscanf( "0xF","%x", &Data );
sscanf( "F", "%x", &Data );
sscanf( "f", "%x", &Data );
// The following are NOT OK, the Data value does not change
sscanf( "0xF", "%X", &Data );
sscanf( "0xf", "%X", &Data );
sscanf( "F", "%X", &Data );
sscanf( "f", "%X", &Data );
This seems like a bug in the library.
PHAB
Jul 14, 2020
01:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2020
01:32 AM
Hi,
Did you try using the Newlib library instead of the default Newlib-nano?
Regards,
Jesus
Did you try using the Newlib library instead of the default Newlib-nano?
Regards,
Jesus
Jul 14, 2020
01:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2020
01:42 AM
Hi Jesus, thanks very much for your reply.
I am using the 'Newlib-nano' library and have not tried the 'Newlib'.
Can you explain the difference between the libraries and the possible implications to other areas of my code, memory size, execution speed etc ?
I am using the 'Newlib-nano' library and have not tried the 'Newlib'.
Can you explain the difference between the libraries and the possible implications to other areas of my code, memory size, execution speed etc ?
Jul 16, 2020
06:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 16, 2020
06:16 AM
Hi,
Have a look to https://community.arm.com/developer/ip-products/system/b/embedded-blog/posts/shrink-your-mcu-code-si...
Regards,
Jesus
Have a look to https://community.arm.com/developer/ip-products/system/b/embedded-blog/posts/shrink-your-mcu-code-si...
Regards,
Jesus
Jul 17, 2020
03:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 17, 2020
03:38 AM
Thanks again Jesus, I'll dig a bit deeper. It is very risky for me to change the library at a very late stage in the project.
Cheers
PHAB
Cheers
PHAB