problem using 64-bit Integer type in RTOS SDK

teckhaokoh
Posts: 4
Joined: Wed Jun 08, 2016 3:30 pm

problem using 64-bit Integer type in RTOS SDK

Postby teckhaokoh » Wed Jun 08, 2016 3:45 pm

Recently I'm doing my development on ESP8266, using RTOS version 1.4.0.
RTOS version seems like couldn't the 64 bit integer types, is that true?

I tried printf/os_printf the value for int64_t data type, it will not display for any value more that 32-bit.
I've tried using NONOS SDK version 1.5.3, os_printf having no issue for the int64_t type.

Any further info on this?
Any fixes for the 64-bit integer value in RTOS SDK?

tobewinner
Posts: 45
Joined: Tue Jan 19, 2016 2:39 pm

Re: problem using 64-bit Integer type in RTOS SDK

Postby tobewinner » Sun Jun 12, 2016 8:07 pm

in RTOS, 64-bit integer is not support by "printf", but the 64-bit integer type really works well, you can try it like this:

Code: Select all

int64_t a = 0xF0F0F0F0F0F0F0F0;
printf("%d.%d\n", (int32_t)(a/4294967296), (int32_t)(a%4294967296));

teckhaokoh
Posts: 4
Joined: Wed Jun 08, 2016 3:30 pm

Re: problem using 64-bit Integer type in RTOS SDK

Postby teckhaokoh » Wed Jun 15, 2016 4:43 pm

Thanks buddy!
That's other issue that caused the mess in my value on 64bit integer.
At least I can isolate this from the issue.....:)

Who is online

Users browsing this forum: No registered users and 290 guests