X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fadc.h;h=d30f72ca7874ce5fa16e8f1b5f5c44b6ee95c9d6;hb=1d80bcc0499da60198f8c52e5c3004a7e885dae5;hp=91f1ebd68d7f5ace94725300d0beec24b07c8066;hpb=791e167e053bdd9250d34a9a5ccae6ccde4d6679;p=bertos.git diff --git a/bertos/drv/adc.h b/bertos/drv/adc.h index 91f1ebd6..d30f72ca 100644 --- a/bertos/drv/adc.h +++ b/bertos/drv/adc.h @@ -32,10 +32,14 @@ * * \version $Id$ * - * \brief ADC driver (interface) + * \brief Analog to Digital Converter driver (ADC). * * \version $Id$ * \author Francesco Sacchi + * + * $WIZ$ module_name = "adc" + * $WIZ$ module_configuration = "bertos/cfg/cfg_adc.h" + * $WIZ$ module_supports = "not atmega103 and not atmega168 and not atmega8" */ @@ -64,6 +68,6 @@ void adc_init(void); * \note \a y1, \a y2 can be negative, and put in ascending or descending order as well. * \note \a data and \a y2 are evaluated only once, \a y1 twice. */ -#define ADC_RANGECONV(data, y1, y2) ((((data) * ((y2) - (y1))) / ((1 << ADC_BITS) - 1)) + (y1)) +#define ADC_RANGECONV(data, y1, y2) (((((int32_t)(data)) * ((y2) - (y1))) / ((1 << ADC_BITS) - 1)) + (y1)) #endif /* DRV_ADC_H */