From: batt Date: Fri, 5 Sep 2008 17:23:37 +0000 (+0000) Subject: Add missing cast. X-Git-Tag: 2.0.0~138 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=5f65d77840d7b773f10fd5c4850fdf5eebbb955f;p=bertos.git Add missing cast. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1796 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/adc.h b/bertos/drv/adc.h index 91f1ebd6..d34accfe 100644 --- a/bertos/drv/adc.h +++ b/bertos/drv/adc.h @@ -64,6 +64,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 */