From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 24 05:03:03 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9A38C16A4CE for ; Thu, 24 Feb 2005 05:03:03 +0000 (GMT) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99E2A43D31 for ; Thu, 24 Feb 2005 05:03:02 +0000 (GMT) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (localhost [127.0.0.1]) (authenticated bits=0) by cain.gsoft.com.au (8.12.11/8.12.10) with ESMTP id j1O52rQK045086; Thu, 24 Feb 2005 15:32:53 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org Date: Thu, 24 Feb 2005 15:32:39 +1030 User-Agent: KMail/1.7.92 References: <421D584A.90203@kaqelectronics.dyndns.org> In-Reply-To: <421D584A.90203@kaqelectronics.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3373236.7uS1DI0nbt"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200502241532.50010.doconnor@gsoft.com.au> X-Spam-Score: -5.4 () IN_REP_TO,PGP_SIGNATURE_2,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_KMAIL X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) cc: Kathy Quinlan Subject: Re: gcc question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Feb 2005 05:03:03 -0000 --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--