foldedtoad / dwm1001

Decawave DWM1001-Dev board
GNU General Public License v3.0
31 stars 13 forks source link

sprintf float output support #8

Open laran002 opened 3 years ago

laran002 commented 3 years ago

Problem: I am having issues with printing floating point output.

This line: sprintf(dist_str, "dist (%u): %3.2f m\n",frame_seq_nb_rx, (float)(distance)); printk("%s", dist_str);

Outputs this: dist (0): %3.2f m\n

Possible Solution: I added CONFIG_FPU=y in prj.conf to enable floating point support.

Action: If you think this is a valid solution I can generate a pull request to fix it

mohannad999 commented 6 months ago

thanks that's work with me

mrodriguezca commented 6 months ago

Another solution is to add CONFIG_CBPRINTF_FP_SUPPORT=y to prj.conf.