|
The following section describes the procedure for adding a customized version of putchar to your project using the IAR Embedded Workbench:
1 Copy putchar.c to your project directory.
2 Make the required additions to your copy of putchar.c, and save it under the same name (or create your own routine using putchar.c as a model).
The code example below shows how memory-mapped I/O could be used to write to a memory-mapped I/O-device:
__no_init volatile unsigned char DEV_IO @ address;
int putchar(int outchar)
{
DEV_IO = outchar;
return ( outchar );
}
The exact address is a design decision. It can, for example, depend on the selected processor variant.
3 Add the customized putchar.c as a program module to your project.
4 Rebuild your project.
To customize getchar.c, use the method described for putchar.c.
E-mail: info@telesys.ru