From 6c0bbc492bf8ad56960edf14102db711c3a85cf9 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Fri, 2 Sep 2011 12:32:47 -0400 Subject: [PATCH] change mc1322x rtimers to 32-bit hardcode a close default value for the RTC --- cpu/mc1322x/rtimer-arch.h | 2 +- platform/redbee-dev/contiki-conf.h | 5 +++++ platform/redbee-econotag/contiki-conf.h | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cpu/mc1322x/rtimer-arch.h b/cpu/mc1322x/rtimer-arch.h index 80065e953..3b4e932de 100644 --- a/cpu/mc1322x/rtimer-arch.h +++ b/cpu/mc1322x/rtimer-arch.h @@ -53,7 +53,7 @@ #if USE_32KHZ_XTAL #define RTIMER_ARCH_SECOND 32768 #else -#define RTIMER_ARCH_SECOND 2000 /* bogus value --- you should set xmac_config after calibration */ +#define RTIMER_ARCH_SECOND 18778 /* close --- should get calibrated */ #endif #define rtimer_arch_now() (*CRM_RTC_COUNT) diff --git a/platform/redbee-dev/contiki-conf.h b/platform/redbee-dev/contiki-conf.h index cce8dae22..ab1271823 100644 --- a/platform/redbee-dev/contiki-conf.h +++ b/platform/redbee-dev/contiki-conf.h @@ -89,6 +89,11 @@ /* end of mc1322x specific config. */ /* start of conitki config. */ + +/* Core rtimer.h defaults to 16 bit timer unless RTIMER_CLOCK_LT is defined */ +typedef unsigned long rtimer_clock_t; +#define RTIMER_CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0) + #define RIMEADDR_CONF_SIZE 8 /* EUI64 generation */ diff --git a/platform/redbee-econotag/contiki-conf.h b/platform/redbee-econotag/contiki-conf.h index 44b321ed9..0f7f91a48 100644 --- a/platform/redbee-econotag/contiki-conf.h +++ b/platform/redbee-econotag/contiki-conf.h @@ -100,6 +100,10 @@ #define PLATFORM_HAS_LEDS 1 #define PLATFORM_HAS_BUTTON 1 +/* Core rtimer.h defaults to 16 bit timer unless RTIMER_CLOCK_LT is defined */ +typedef unsigned long rtimer_clock_t; +#define RTIMER_CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0) + #define RIMEADDR_CONF_SIZE 8 /* EUI64 generation */