Adding definitions required for TSCH to the sky and z1 platforms

This commit is contained in:
Simon Duquennoy 2015-09-21 22:05:40 +02:00
parent b0f936263e
commit 20c97367a9
5 changed files with 36 additions and 0 deletions

View file

@ -48,6 +48,20 @@
#define RTIMER_ARCH_SECOND (4096U*8)
#endif
/* Do the math in 32bits to save precision.
* Round to nearest integer rather than truncate. */
#define US_TO_RTIMERTICKS(US) ((US) >= 0 ? \
(((int32_t)(US) * (RTIMER_ARCH_SECOND) + 500000) / 1000000L) : \
((int32_t)(US) * (RTIMER_ARCH_SECOND) - 500000) / 1000000L)
#define RTIMERTICKS_TO_US(T) ((T) >= 0 ? \
(((int32_t)(T) * 1000000L + ((RTIMER_ARCH_SECOND) / 2)) / (RTIMER_ARCH_SECOND)) : \
((int32_t)(T) * 1000000L - ((RTIMER_ARCH_SECOND) / 2)) / (RTIMER_ARCH_SECOND))
/* A 64-bit version because the 32-bit one cannot handle T >= 4295 ticks.
Intended only for positive values of T. */
#define RTIMERTICKS_TO_US_64(T) ((uint32_t)(((uint64_t)(T) * 1000000 + ((RTIMER_ARCH_SECOND) / 2)) / (RTIMER_ARCH_SECOND)))
rtimer_clock_t rtimer_arch_now(void);
#endif /* RTIMER_ARCH_H_ */

View file

@ -37,6 +37,10 @@
#define CC2420_CONF_AUTOACK 1
#endif /* CC2420_CONF_AUTOACK */
/* The TSCH default slot length of 10ms is a bit too short for this platform,
* use 15ms instead. */
#define TSCH_CONF_DEFAULT_TIMESLOT_LENGTH 15000
/* Specify whether the RDC layer should enable
per-packet power profiling. */
#define CONTIKIMAC_CONF_COMPOWER 1

View file

@ -46,6 +46,13 @@
/* Platform TMOTE_SKY */
#define TMOTE_SKY 1
/* Delay between GO signal and SFD: radio fixed delay + 4Bytes preample + 1B SFD -- 1Byte time is 32us
* ~327us + 129preample = 456 us */
#define RADIO_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(456))
/* Delay between GO signal and start listening
* ~50us delay + 129preample + ?? = 183 us */
#define RADIO_DELAY_BEFORE_RX ((unsigned)US_TO_RTIMERTICKS(183))
#define PLATFORM_HAS_LEDS 1
#define PLATFORM_HAS_BUTTON 1
#define PLATFORM_HAS_LIGHT 1

View file

@ -103,6 +103,10 @@
#define IEEE802154_CONF_PANID 0xABCD
/* The TSCH default slot length of 10ms is a bit too short for this platform,
* use 15ms instead. */
#define TSCH_CONF_DEFAULT_TIMESLOT_LENGTH 15000
#define SHELL_VARS_CONF_RAM_BEGIN 0x1100
#define SHELL_VARS_CONF_RAM_END 0x2000

View file

@ -43,6 +43,13 @@
*/
#define ZOLERTIA_Z1 1 /* Enric */
/* Delay between GO signal and SFD: radio fixed delay + 4Bytes preample + 1B SFD -- 1Byte time is 32us
* ~327us + 129preample = 456 us */
#define RADIO_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(456))
/* Delay between GO signal and start listening
* ~50us delay + 129preample + ?? = 183 us */
#define RADIO_DELAY_BEFORE_RX ((unsigned)US_TO_RTIMERTICKS(183))
#define PLATFORM_HAS_LEDS 1
#define PLATFORM_HAS_BUTTON 1
#define PLATFORM_HAS_RADIO 1