From: aleph Date: Wed, 29 Sep 2010 13:59:39 +0000 (+0000) Subject: sam3n port: fix integer comparison in clock initialization X-Git-Tag: 2.6.0~50 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d83ff60c86ab9c3fae79eddc491adebd15959e1d;p=bertos.git sam3n port: fix integer comparison in clock initialization git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4351 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/cortex-m3/drv/clock_sam3.c b/bertos/cpu/cortex-m3/drv/clock_sam3.c index ae70d529..fbc79062 100644 --- a/bertos/cpu/cortex-m3/drv/clock_sam3.c +++ b/bertos/cpu/cortex-m3/drv/clock_sam3.c @@ -65,8 +65,8 @@ INLINE uint32_t evaluate_pll(void) { // RC oscillator set to 12 MHz freq = 12000000 / div * (1 + mul); - if (ABS(CPU_FREQ - freq) < best_delta) { - best_delta = ABS(CPU_FREQ - freq); + if (ABS((int)CPU_FREQ - freq) < best_delta) { + best_delta = ABS((int)CPU_FREQ - freq); best_mul = mul; best_div = div; }