fabricedesre / cc3200-rs

Getting Rust to run on a TI cc3200
Mozilla Public License 2.0
7 stars 2 forks source link

Add console printf #26

Closed dhylands closed 7 years ago

dhylands commented 7 years ago

Some background. StrXPrintf is a function I adapted about 10 years ago. It's much smaller than the C runtime printf because it doesn't have floating point support. It also add support for %b to print binary output.

It does no memory allocations and because it takes a pointer to a function to output each character you can printf your string directly to an LCD or UART or whatever, without having to sprintf into a string someplace and then output that.

dhylands commented 7 years ago

I went and ran StrPrintf.c through indent with something closer to my current coding style (I last formatted that file about 10 years ago).