AVR platforms: use 32 bit clock_time_t.

This commit is contained in:
Cristiano De Alti 2015-11-28 10:17:38 +01:00
parent 6def22b3c5
commit 2e78558964
6 changed files with 24 additions and 72 deletions

View File

@ -56,18 +56,10 @@
*/ */
/* Clock ticks per second */ /* Clock ticks per second */
#define CLOCK_CONF_SECOND 128 #define CLOCK_CONF_SECOND 128
#if 1
/* 16 bit counter overflows every ~10 minutes */ typedef uint32_t clock_time_t;
typedef unsigned short clock_time_t; #define CLOCK_LT(a,b) ((int32_t)((a)-(b)) < 0)
#define CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
#define INFINITE_TIME 0xffff
#define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#else
typedef unsigned long clock_time_t;
#define CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0)
#define INFINITE_TIME 0xffffffff
#endif
/* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */ /* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */
void clock_delay_msec(uint16_t howlong); void clock_delay_msec(uint16_t howlong);
void clock_adjust_ticks(clock_time_t howmany); void clock_adjust_ticks(clock_time_t howmany);

View File

@ -68,18 +68,10 @@
*/ */
/* Clock ticks per second */ /* Clock ticks per second */
#define CLOCK_CONF_SECOND 128 #define CLOCK_CONF_SECOND 128
#if 1
/* 16 bit counter overflows every ~10 minutes */ typedef uint32_t clock_time_t;
typedef unsigned short clock_time_t; #define CLOCK_LT(a,b) ((int32_t)((a)-(b)) < 0)
#define CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
#define INFINITE_TIME 0xffff
#define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#else
typedef unsigned long clock_time_t;
#define CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0)
#define INFINITE_TIME 0xffffffff
#endif
/* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */ /* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */
void clock_delay_msec(uint16_t howlong); void clock_delay_msec(uint16_t howlong);
void clock_adjust_ticks(clock_time_t howmany); void clock_adjust_ticks(clock_time_t howmany);

View File

@ -70,18 +70,10 @@
*/ */
/* Clock ticks per second */ /* Clock ticks per second */
#define CLOCK_CONF_SECOND 125 #define CLOCK_CONF_SECOND 125
#if 1
/* 16 bit counter overflows every ~10 minutes */ typedef uint32_t clock_time_t;
typedef unsigned short clock_time_t; #define CLOCK_LT(a,b) ((int32_t)((a)-(b)) < 0)
#define CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
#define INFINITE_TIME 0xffff
#define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#else
typedef unsigned long clock_time_t;
#define CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0)
#define INFINITE_TIME 0xffffffff
#endif
/* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */ /* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */
void clock_delay_msec(uint16_t howlong); void clock_delay_msec(uint16_t howlong);
void clock_adjust_ticks(clock_time_t howmany); void clock_adjust_ticks(clock_time_t howmany);

View File

@ -62,18 +62,10 @@
*/ */
/* Clock ticks per second */ /* Clock ticks per second */
#define CLOCK_CONF_SECOND 125 #define CLOCK_CONF_SECOND 125
#if 1
/* 16 bit counter overflows every ~10 minutes */ typedef uint32_t clock_time_t;
typedef unsigned short clock_time_t; #define CLOCK_LT(a,b) ((int32_t)((a)-(b)) < 0)
#define CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
#define INFINITE_TIME 0xffff
#define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#else
typedef unsigned long clock_time_t;
#define CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0)
#define INFINITE_TIME 0xffffffff
#endif
/* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */ /* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */
void clock_delay_msec(uint16_t howlong); void clock_delay_msec(uint16_t howlong);
void clock_adjust_ticks(clock_time_t howmany); void clock_adjust_ticks(clock_time_t howmany);

View File

@ -62,18 +62,10 @@
*/ */
/* Clock ticks per second */ /* Clock ticks per second */
#define CLOCK_CONF_SECOND 125 #define CLOCK_CONF_SECOND 125
#if 1
/* 16 bit counter overflows every ~10 minutes */ typedef uint32_t clock_time_t;
typedef unsigned short clock_time_t; #define CLOCK_LT(a,b) ((int32_t)((a)-(b)) < 0)
#define CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
#define INFINITE_TIME 0xffff
#define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#else
typedef unsigned long clock_time_t;
#define CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0)
#define INFINITE_TIME 0xffffffff
#endif
/* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */ /* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */
void clock_delay_msec(uint16_t howlong); void clock_delay_msec(uint16_t howlong);
void clock_adjust_ticks(clock_time_t howmany); void clock_adjust_ticks(clock_time_t howmany);

View File

@ -56,18 +56,10 @@
*/ */
/* Clock ticks per second */ /* Clock ticks per second */
#define CLOCK_CONF_SECOND 128 #define CLOCK_CONF_SECOND 128
#if 1
/* 16 bit counter overflows every ~10 minutes */ typedef uint32_t clock_time_t;
typedef unsigned short clock_time_t; #define CLOCK_LT(a,b) ((int32_t)((a)-(b)) < 0)
#define CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
#define INFINITE_TIME 0xffff
#define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
#else
typedef unsigned long clock_time_t;
#define CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0)
#define INFINITE_TIME 0xffffffff
#endif
/* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */ /* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */
void clock_delay_msec(uint16_t howlong); void clock_delay_msec(uint16_t howlong);
void clock_adjust_ticks(clock_time_t howmany); void clock_adjust_ticks(clock_time_t howmany);