Browse Source

Merge remote-tracking branch 'github/deprecationmacro'

pull/75/merge
Piotr Esden-Tempski 12 years ago
parent
commit
3277c58550
  1. 13
      include/libopencm3/cm3/common.h
  2. 30
      include/libopencm3/stm32/f1/adc.h

13
include/libopencm3/cm3/common.h

@ -42,6 +42,19 @@ typedef uint64_t u64;
# define END_DECLS # define END_DECLS
#endif #endif
/* Full-featured deprecation attribute with fallback for older compilers. */
#ifdef __GNUC__
# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR_ > 4)
# define LIBOPENCM3_DEPRECATED(x) __attribute__ ((deprecated (x)))
# else
# define LIBOPENCM3_DEPRECATED(x) __attribute__ ((deprecated))
# endif
#else
# define LIBOPENCM3_DEPRECATED(x)
#endif
/* Generic memory-mapped I/O accessor functions */ /* Generic memory-mapped I/O accessor functions */
#define MMIO8(addr) (*(volatile u8 *)(addr)) #define MMIO8(addr) (*(volatile u8 *)(addr))
#define MMIO16(addr) (*(volatile u16 *)(addr)) #define MMIO16(addr) (*(volatile u16 *)(addr))

30
include/libopencm3/stm32/f1/adc.h

@ -707,15 +707,7 @@ void adc_reset_calibration(u32 adc);
void adc_calibration(u32 adc); void adc_calibration(u32 adc);
void adc_set_continuous_conversion_mode(u32 adc); void adc_set_continuous_conversion_mode(u32 adc);
void adc_set_single_conversion_mode(u32 adc); void adc_set_single_conversion_mode(u32 adc);
#ifdef __GNUC__ void adc_on(u32 adc) LIBOPENCM3_DEPRECATED("will be removed in the first release");
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR_ > 4)
void adc_on(u32 adc) __attribute__ ((deprecated ("will be removed in the first release")));
#else
void adc_on(u32 adc) __attribute__ ((deprecated));
#endif
#else
void adc_on(u32 adc);
#endif
void adc_off(u32 adc); void adc_off(u32 adc);
void adc_set_sample_time(u32 adc, u8 channel, u8 time); void adc_set_sample_time(u32 adc, u8 channel, u8 time);
void adc_set_sample_time_on_all_channels(u32 adc, u8 time); void adc_set_sample_time_on_all_channels(u32 adc, u8 time);
@ -724,21 +716,11 @@ void adc_set_watchdog_low_threshold(u32 adc, u16 threshold);
void adc_set_regular_sequence(u32 adc, u8 length, u8 channel[]); void adc_set_regular_sequence(u32 adc, u8 length, u8 channel[]);
void adc_set_injected_sequence(u32 adc, u8 length, u8 channel[]); void adc_set_injected_sequence(u32 adc, u8 length, u8 channel[]);
#ifdef __GNUC__ void adc_set_continous_conversion_mode(u32 adc) LIBOPENCM3_DEPRECATED("change to adc_set_continuous_conversion_mode");
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR_ > 4) void adc_set_conversion_time(u32 adc, u8 channel, u8 time) LIBOPENCM3_DEPRECATED("change to adc_set_sample_time");
void adc_set_continous_conversion_mode(u32 adc) __attribute__ ((deprecated ("change to adc_set_continuous_conversion_mode"))); void adc_set_conversion_time_on_all_channels(u32 adc, u8 time) LIBOPENCM3_DEPRECATED("change to adc_set_sample_time_on_all_channels");
void adc_set_conversion_time(u32 adc, u8 channel, u8 time) __attribute__ ((deprecated ("change to adc_set_sample_time"))); void adc_enable_jeoc_interrupt(u32 adc) LIBOPENCM3_DEPRECATED("change to adc_enable_eoc_interrupt_injected");
void adc_set_conversion_time_on_all_channels(u32 adc, u8 time) __attribute__ ((deprecated ("change to adc_set_sample_time_on_all_channels"))); void adc_disable_jeoc_interrupt(u32 adc) LIBOPENCM3_DEPRECATED("change to adc_disable_eoc_interrupt_injected");
void adc_enable_jeoc_interrupt(u32 adc) __attribute__ ((deprecated ("change to adc_enable_eoc_interrupt_injected")));
void adc_disable_jeoc_interrupt(u32 adc) __attribute__ ((deprecated ("change to adc_disable_eoc_interrupt_injected")));
#else
void adc_set_continous_conversion_mode(u32 adc) __attribute__ ((deprecated));
void adc_set_conversion_time(u32 adc, u8 channel, u8 time) __attribute__ ((deprecated));
void adc_set_conversion_time_on_all_channels(u32 adc, u8 time) __attribute__ ((deprecated));
void adc_enable_jeoc_interrupt(u32 adc) __attribute__ ((deprecated));
void adc_disable_jeoc_interrupt(u32 adc) __attribute__ ((deprecated));
#endif
#endif
END_DECLS END_DECLS
#endif #endif

Loading…
Cancel
Save