sam3n port: fix integer comparison in clock initialization
authoraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 29 Sep 2010 13:59:39 +0000 (13:59 +0000)
committeraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 29 Sep 2010 13:59:39 +0000 (13:59 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4351 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/drv/clock_sam3.c

index ae70d52999ae20b35574f792aac35c0e7a7fd2ba..fbc79062216a4ad8207e23423412e65a1aa91860 100644 (file)
@@ -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;
                        }