simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] simulator performance


From: Joerg Wunsch
Subject: Re: [Simulavr-devel] simulator performance
Date: Thu, 12 Mar 2009 21:36:15 +0100
User-agent: Mutt/1.5.11

As Chris Kuethe wrote:

> The avr-libc stdio page is a good read. That's where I go every time I
> have to be reminded of how to use printf on an avr. But try this on
> for size:

At least, that will do the job on real hardware (which Joel is also
interested in).  Currently, I don't have an idea what simulavrxx would
do with any kind of device IO.  I think it's got an option to
commicate it through a TCP channel some way.

For the old simulavr (which I believe Joel also wants to compare),
there's a couple of #if 0 statements in the code that, when removing
them, allows for standard IO ports to print their value on stdout, so
you could write up an stdio backend like:

static int
port_putchar(char c, FILE *stream)
{
   PORTA = c;
   return 0;
}

int
main(void)
{
   DDRA = 0xff;
   stdout = &mystdout;
   printf_P(PSTR("Hello, world!\n"));

   return 0;
}

That's probably sufficient for the purpose.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]