【Feedback】os_printf without auto \r\n

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

【Feedback】os_printf without auto \r\n

Postby rudi » Wed Jun 29, 2016 4:02 pm

hi guys

simple question :D
can we switch off this \r 'future'?

if we use

Code: Select all

os_printf("hello world\n");


the output is

    hello world\r\n

btw:
this is bad, if we do communicate with linux terminal and want generate *.sh files from the output example

same if we use a structured output

Code: Select all

os_printf("ADC Value: ");
os_printf("%d", system_adc_read() );


we get

    ADC Value: \r\n
    1024\r\n

thanks
best wishes
rudi ;-)

btw:
i know, we can use os_sprintf too
and we can use

Code: Select all

uart0_tx_buffer("done",4);
uart0_sendStr("hello sendStr world");


but i ask for os_printf.

can we change this back to normal - without auto \r // auto \r\n ?
can we edit the #define?

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

ESP_Rubin
Posts: 222
Joined: Wed Jun 29, 2016 11:59 am

Re: 【Feedback】os_printf without auto \r\n

Postby ESP_Rubin » Thu Jun 30, 2016 11:24 am

which SDK you used?
in our NONOS SDK 1.5.4, no this issue

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

Re: 【Feedback】os_printf without auto \r\n

Postby rudi » Thu Jun 30, 2016 4:56 pm

esp_rubin wrote:which SDK you used?
in our NONOS SDK 1.5.4, no this issue


txs for reply,

NONOS SDK 1.5.4

Code: Select all

os_printf("\nTEST ME WITH back Slash and new line:\n");
os_printf("TEST ME WITH bS and return :\r");

os_printf("\nHSPI_TEST.fcfx\n");



like you can see,


os_printf_1.5.4.png




the new line character

Code: Select all

\n


is changed to

Code: Select all

\r\n





with

Code: Select all


os_printf("\n");



in SDK 1.5.4


feel free to test and try simply whats happend:

Code: Select all


os_printf("\n");




you will get

Code: Select all


\r\n



or try simply this

Code: Select all


os_printf("\n\n\n\n");



you will get

Code: Select all


\r\n
\r\n
\r\n
\r\n



try_this_4x_newLine.png
try_this_4x_newLine.png (7.33 KiB) Viewed 6569 times


thank you for your reply.

best wishes
rudi ;-)

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

Re: 【Feedback】os_printf without auto \r\n

Postby rudi » Thu Jun 30, 2016 9:49 pm

I disagree very reluctantly
But - unlike their Freedom of speech
and because we have a little "play time" just in time:
here the next and all os_printf bugs as result at bottom then
for the SDK 1.5.4 just found..

Code: Select all

os_printf("\r");



this \r will be delete

same here:

Code: Select all

os_printf("\n\r");


and \n will be then replaced
with \r\n


result in SDK 1.5.4 NONOS with
os_printf("\r");
or
os_printf ("\n");
or
os_printf("\n\r");




bug 1)
all \r will be deleted by the SDK

bug 2)
all \n will be replaced automaticaly with \r\n by the SDK




yes, try this for fun:

Code: Select all

os_printf("\r\r\r\r");


and see what happend ;)

thank you for your reply!

best wishes
rudi ;-)

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

Re: 【Feedback】os_printf without auto \r\n

Postby rudi » Fri Jul 01, 2016 6:48 pm

esp_rubin wrote:in our NONOS SDK 1.5.4, no this issue


what is your saying now?

;)

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Who is online

Users browsing this forum: No registered users and 288 guests