Re: gcc question

From: Daniel O'Connor (doconnor_at_gsoft.com.au)
Date: 02/24/05

  • Next message: River: ""sleep" "select" system call not work correctly when linking with multithread libray--FreeBSD 4.5"
    To: freebsd-hackers@freebsd.org
    Date: Thu, 24 Feb 2005 15:32:39 +1030
    
    
    

    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.

    -- 
    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
    
    



  • Next message: River: ""sleep" "select" system call not work correctly when linking with multithread libray--FreeBSD 4.5"

    Relevant Pages

    • Re: gcc question
      ... >>What is the best way to redefine getchar and putchar (in uC they use the ... >>serial port, in FreeBSD stdin stdout) ... > I didn't think getchar/putchar existed in the Atmel libc implementation.. ... so I guess for now I will just break the AVR support;) ...
      (freebsd-hackers)
    • gcc question
      ... I have some code that I build for two targets, one an Atmel uC and the ... What is the best way to redefine getchar and putchar (in uC they use the ... serial port, in FreeBSD stdin stdout) ... uC and my serial port handler in FreeBSD ?? ...
      (freebsd-hackers)