Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Feb 2005 15:32:39 +1030
From:      "Daniel O'Connor" <doconnor@gsoft.com.au>
To:        freebsd-hackers@freebsd.org
Cc:        Kathy Quinlan <kat-free@kaqelectronics.dyndns.org>
Subject:   Re: gcc question
Message-ID:  <200502241532.50010.doconnor@gsoft.com.au>
In-Reply-To: <421D584A.90203@kaqelectronics.dyndns.org>
References:  <421D584A.90203@kaqelectronics.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart3373236.7uS1DI0nbt
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Thu, 24 Feb 2005 15:00, Kathy Quinlan wrote:
> I have some code that I build for two targets, one an Atmel uC and the
> other FreeBSD.
>
> What is the best way to redefine getchar and putchar (in uC they use the
> serial port, in FreeBSD stdin stdout)
>
> Or would I be better #ifdef the commands and making getchar only used in
> uC and my serial port handler in FreeBSD ??

I didn't think getchar/putchar existed in the Atmel libc implementation..

I would suggest using a different function name and implement it differentl=
y=20
for either platform.

Also you'll want to be careful about the fact that the Atmel has 2 separate=
=20
address spaces (if it's an AVR anyway) which can cause problems because you=
=20
have to read from the right one.

=2D-=20
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

--nextPart3373236.7uS1DI0nbt
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iD8DBQBCHV/55ZPcIHs/zowRAlTqAJ9zJZHr2OAlgTNG06Y5MDBeNj+F4QCeOrEC
WuRsKRbVVQRwD74rVFMUcx4=
=emgK
-----END PGP SIGNATURE-----

--nextPart3373236.7uS1DI0nbt--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502241532.50010.doconnor>