summaryrefslogtreecommitdiff
path: root/cesar/bsu/src
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/bsu/src')
-rw-r--r--cesar/bsu/src/bsu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cesar/bsu/src/bsu.c b/cesar/bsu/src/bsu.c
index 2b98eadd85..578ae14047 100644
--- a/cesar/bsu/src/bsu.c
+++ b/cesar/bsu/src/bsu.c
@@ -402,6 +402,7 @@ PRIVATE inline void
bsu_schedules_merge__allocation_add (bsu_t *ctx, ca_schedule_t *schedules,
uint pos, u32 end_time_atu, u8 glid)
{
+ dbg_claim (end_time_atu);
schedules->allocations[pos].end_offset_tck =
MAC_ATU_TO_TCK (end_time_atu);
schedules->allocations[pos].glid = glid;
@@ -440,10 +441,11 @@ bsu_schedules_merge (bsu_t *ctx, bsu_beacon_t *beacon,
ctx, schedule, alloc, sai->start_time_atu, glid);
alloc++;
}
- /* Add a hole between the previous allocation end this one. */
- else if (sai->stpf
+ /* Add a hole between the previous allocation and this one. */
+ else if (alloc
+ && sai->stpf
&& MAC_ATU_TO_TCK(sai->start_time_atu)
- != schedule->allocations[alloc-1].end_offset_tck)
+ != schedule->allocations[alloc-1].end_offset_tck)
{
bsu_schedules_merge__allocation_add (
ctx, schedule, alloc, sai->start_time_atu, MAC_LID_SPC_HOLE);