TSCH: timeslot timing templates as const
This commit is contained in:
parent
cc0c70c1b3
commit
22cbced037
|
@ -977,7 +977,7 @@ get_object(radio_param_t param, void *dest, size_t size)
|
|||
if(size != sizeof(uint16_t *) || !dest) {
|
||||
return RADIO_RESULT_INVALID_VALUE;
|
||||
}
|
||||
*(uint16_t **)dest = tsch_timeslot_timing_us_10000;
|
||||
*(const uint16_t **)dest = tsch_timeslot_timing_us_10000;
|
||||
return RADIO_RESULT_OK;
|
||||
}
|
||||
#endif /* MAC_CONF_WITH_TSCH */
|
||||
|
|
|
@ -94,7 +94,7 @@ static const char rf_cfg_descriptor[] = "802.15.4g 863-870MHz MR-FSK mode #1";
|
|||
)
|
||||
|
||||
/* TSCH timeslot timing (mircoseconds) */
|
||||
static uint16_t cc1200_50kbps_tsch_timing[tsch_ts_elements_count] = {
|
||||
static const uint16_t cc1200_50kbps_tsch_timing[tsch_ts_elements_count] = {
|
||||
CC1200_TSCH_DEFAULT_TS_CCA_OFFSET,
|
||||
CC1200_TSCH_DEFAULT_TS_CCA,
|
||||
CC1200_TSCH_DEFAULT_TS_TX_OFFSET,
|
||||
|
|
|
@ -86,7 +86,7 @@ static const char rf_cfg_descriptor[] = "868MHz 2-GFSK 1000 kbps";
|
|||
)
|
||||
|
||||
/* TSCH timeslot timing (in rtimer ticks) */
|
||||
static uint16_t cc1200_1000kbps_tsch_timing[tsch_ts_elements_count] = {
|
||||
static const uint16_t cc1200_1000kbps_tsch_timing[tsch_ts_elements_count] = {
|
||||
CC1200_TSCH_DEFAULT_TS_CCA_OFFSET,
|
||||
CC1200_TSCH_DEFAULT_TS_CCA,
|
||||
CC1200_TSCH_DEFAULT_TS_TX_OFFSET,
|
||||
|
|
|
@ -97,7 +97,7 @@ typedef struct cc1200_rf_cfg {
|
|||
/* The bitrate in bps */
|
||||
uint32_t bitrate;
|
||||
/* TSCH timeslot timing */
|
||||
uint16_t *tsch_timing;
|
||||
const uint16_t *tsch_timing;
|
||||
} cc1200_rf_cfg_t;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* CC1200_RF_CFG_H */
|
||||
|
|
|
@ -1477,7 +1477,7 @@ get_object(radio_param_t param, void *dest, size_t size)
|
|||
if(size != sizeof(uint16_t *) || !dest) {
|
||||
return RADIO_RESULT_INVALID_VALUE;
|
||||
}
|
||||
*(uint16_t **)dest = CC1200_RF_CFG.tsch_timing;
|
||||
*(const uint16_t **)dest = CC1200_RF_CFG.tsch_timing;
|
||||
return RADIO_RESULT_OK;
|
||||
}
|
||||
#endif /* MAC_CONF_WITH_TSCH */
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
* \brief 15ms TSCH timeslot timings, required for cc2420 platforms as
|
||||
* they are unable to keep up with the defulat 10ms timeslots.
|
||||
*/
|
||||
uint16_t tsch_timeslot_timing_us_15000[tsch_ts_elements_count] = {
|
||||
const uint16_t tsch_timeslot_timing_us_15000[tsch_ts_elements_count] = {
|
||||
1800, /* CCAOffset */
|
||||
128, /* CCA */
|
||||
4000, /* TxOffset */
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#endif /* NETSTACK_CONF_RADIO */
|
||||
|
||||
/* TSCH 15ms timeslot timing template, required for cc2420 */
|
||||
extern uint16_t tsch_timeslot_timing_us_15000[];
|
||||
extern const uint16_t tsch_timeslot_timing_us_15000[];
|
||||
|
||||
/* The TSCH default slot length of 10ms is a bit too short for this platform,
|
||||
* use 15ms instead. */
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
* (TxOffset - (RxWait / 2)) instead
|
||||
*/
|
||||
|
||||
uint16_t tsch_timeslot_timing_us_10000[tsch_ts_elements_count] = {
|
||||
const uint16_t tsch_timeslot_timing_us_10000[tsch_ts_elements_count] = {
|
||||
1800, /* CCAOffset */
|
||||
128, /* CCA */
|
||||
2120, /* TxOffset */
|
||||
|
|
|
@ -181,7 +181,7 @@ extern unsigned long sync_count;
|
|||
extern int32_t min_drift_seen;
|
||||
extern int32_t max_drift_seen;
|
||||
/* The TSCH standard 10ms timeslot timing */
|
||||
extern uint16_t tsch_timeslot_timing_us_10000[tsch_ts_elements_count];
|
||||
extern const uint16_t tsch_timeslot_timing_us_10000[tsch_ts_elements_count];
|
||||
|
||||
/* TSCH processes */
|
||||
PROCESS_NAME(tsch_process);
|
||||
|
|
Loading…
Reference in New Issue