ARM Cortex-M Microcontroller startup files

Timo Sintonen via Digitalmars-d digitalmars-d at puremagic.com
Fri May 1 00:15:58 PDT 2015


On Thursday, 30 April 2015 at 20:54:07 UTC, Martin Nowak wrote:
> On 04/30/2015 08:43 AM, Timo Sintonen wrote:
>> Printf is a little tricky. It is actually a file operation to 
>> stdout and
>> that is actually a syscall to kernel.
>
> No, you usually have to implement some hook for outputting 
> yourself,
> e.g. putc or write, printf solely takes care of the formatting.

I repeat here that there are several output devices in a board at 
the same time like serial port and lcd display. Printf can not be 
bound to one device at compile time.
It is not hard to take the formatter out of printf and make it a 
separate interface that can be connected to different outputs. 
this way we do not need the libc dummies. I think this is more 
the D and object oriented way. A hook sounds too much C for me.

Even better would be a CTFE formatter. There was discussion about 
this last year. Anybody knows the state?


More information about the Digitalmars-d mailing list