/[avr-libc]/avr-libc/include/compat/deprecated.h
ViewVC logotype

Diff of /avr-libc/include/compat/deprecated.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joerg_wunsch, Fri Nov 4 22:55:15 2005 UTC revision 1.2 by joerg_wunsch, Sat Nov 5 21:22:33 2005 UTC
# Line 40  Line 40 
40      deprecated over time.      deprecated over time.
41    
42      \code #include <compat/deprected.h> \endcode      \code #include <compat/deprected.h> \endcode
   */  
43    
44  #ifdef __cplusplus      These items are supplied within that header file for backward
45  extern "C" {      compatibility reasons only, so old source code that has been
46  #endif      written for previous library versions could easily be maintained
47        until its end-of-life.  Use of any of these items in new code is
48        strongly discouraged.
49      */
50    
51  /** \name Allowing specific system-wide interrupts  /** \name Allowing specific system-wide interrupts
52    
# Line 137  void signame (void) Line 139  void signame (void)
139    
140  /*@}*/  /*@}*/
141    
142  #ifdef __cplusplus  /**
143  }     \name Obsolete IO macros
144  #endif  
145       Back in a time when AVR-GCC and avr-libc could not handle IO port
146       access in the direct assignment form as they are handled now, all
147       IO port access had to be done through specific macros that
148       eventually resulted in inline assembly instructions performing the
149       desired action.
150    
151       These macros became obsolete, as reading and writing IO ports can
152       be done by simply using the IO port name in an expression, and all
153       bit manipulation (including those on IO ports) can be done using
154       generic C bit manipulation operators.
155    
156       The macros in this group simulate the historical behaviour.  While
157       they are supposed to be applied to IO ports, the emulation actually
158       uses standard C methods, so they could be applied to arbitrary
159       memory locations as well.
160    */
161    
162    /*@{*/
163    
164    /**
165       \ingroup deprecated_items
166       \def inp(port)
167       \deprecated
168    
169       Read a value from an IO port \c port.
170    */
171    #define inp(port) (port)
172    
173    /**
174       \ingroup deprecated_items
175       \def outp(port, val)
176       \deprecated
177    
178       Write \c val to IO port \c port.
179    */
180    #define outp(port, val) (port) = (val)
181    
182    /**
183       \ingroup deprecated_items
184       \def sbi(port, bit)
185       \deprecated
186    
187       Set \c bit in IO port \c port.
188    */
189    #define sbi(port, bit) (port) |= (1 << (bit))
190    
191    /**
192       \ingroup deprecated_items
193       \def cbi(port, bit)
194       \deprecated
195    
196       Clear \c bit in IO port \c port.
197    */
198    #define cbi(port, bit) (port) &= ~(1 << (bit))
199    
200    /*@}*/
201    
202  #endif /* _COMPAT_DEPRECATED_H_ */  #endif /* _COMPAT_DEPRECATED_H_ */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26