Forum > Embedded - ARM

writeln redirect to usart

(1/2) > >>

diego bertotti:
hello

somebody knows how i can redirect de write and writeln functions to use as output the usart tx?

thanks

MarkMLl:
Console app? Lazarus? Operating system? type of hardware?

Come on old chap, give us a clue.

MarkMLl

ccrause:

--- Quote from: diego bertotti on July 17, 2020, 05:09:47 pm ---somebody knows how i can redirect de write and writeln functions to use as output the usart tx?

--- End quote ---
One has to provide the required character read & write implementations and pass pointers to these functions to OpenIO.  OpenIO is defined in the consoleio unit.  An example of this redirection can be seen in the avrsim unit.  Of course in avrsim the redirection just dump the character in a special register, in your case WriteChar() needs to implement the UART call to transmit a character.

ccrause:

--- Quote from: MarkMLl on July 17, 2020, 06:39:10 pm ---Console app? Lazarus? Operating system? type of hardware?

Come on old chap, give us a clue.

MarkMLl

--- End quote ---
The location of Diego's question gives the necessary context.  Don't worry, I have been baffled before by apparently context-less questions before, only to later realize it is all about the specific subforum.  Something that is easy to miss when looking at the Recent list.

MarkMLl:

--- Quote from: ccrause on July 17, 2020, 07:07:21 pm ---The location of Diego's question gives the necessary context.  Don't worry, I have been baffled before by apparently context-less questions before, only to later realize it is all about the specific subforum.  Something that is easy to miss when looking at the Recent list.

--- End quote ---

I agree, my apologies :-)

MarkMLl

Navigation

[0] Message Index

[#] Next page

Go to full version