From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 24 07:27:43 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 C606516A4CE for ; Thu, 24 Feb 2005 07:27:43 +0000 (GMT) Received: from house.arach.net.au (house1.arach.net.au [203.30.44.84]) by mx1.FreeBSD.org (Postfix) with SMTP id 84B6A43D1D for ; Thu, 24 Feb 2005 07:27:42 +0000 (GMT) (envelope-from kat-free@kaqelectronics.dyndns.org) Received: (qmail 31395 invoked from network); 24 Feb 2005 07:27:41 -0000 Received: from unknown (HELO pythagorus.kaqelectronics.dyndns.org) (202.89.173.156) by house1.arach.net.au with SMTP for ; 24 Feb 2005 07:27:41 -0000 Received: from [192.168.0.2] (kathy.kaqelectronics.dyndns.org. [192.168.0.2]) id j1O7Tagx015203; Thu, 24 Feb 2005 15:29:37 +0800 (WST) (envelope-from kat-free@kaqelectronics.dyndns.org) Received: from 127.0.0.1 (AVG SMTP 7.0.300 [266.4.0]); Thu, 24 Feb 2005 15:27:37 +0800 Message-ID: <421D81E9.809@kaqelectronics.dyndns.org> Date: Thu, 24 Feb 2005 15:27:37 +0800 From: Kathy Quinlan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-au, en, en-us To: "Daniel O'Connor" References: <421D584A.90203@kaqelectronics.dyndns.org> <200502241532.50010.doconnor@gsoft.com.au> In-Reply-To: <200502241532.50010.doconnor@gsoft.com.au> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed cc: freebsd-hackers@freebsd.org 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 07:27:43 -0000 Daniel O'Connor wrote: > 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 differently > for either platform. > > Also you'll want to be careful about the fact that the Atmel has 2 separate > address spaces (if it's an AVR anyway) which can cause problems because you > have to read from the right one. > ATM it is written in codevisionAVR which is where the function is called, so I guess for now I will just break the AVR support;) I am planning on moving wholey over to GCC and FreeBSD, once my final customer has agreed to Eagle for the EDA side, this PC will be Free of M$ crap and I will be wholy FreeBSD :) Regards, Kat. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005