From 7fcb9554f42fb7a1183f52f009101599b624718c Mon Sep 17 00:00:00 2001 From: fros4943 Date: Thu, 13 Mar 2008 14:27:34 +0000 Subject: [PATCH] added timetable aggregate reset function --- core/sys/timetable-aggregate.c | 12 +++++++++++- core/sys/timetable-aggregate.h | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/sys/timetable-aggregate.c b/core/sys/timetable-aggregate.c index dabe4189e..5c35b035d 100644 --- a/core/sys/timetable-aggregate.c +++ b/core/sys/timetable-aggregate.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: timetable-aggregate.c,v 1.1 2008/01/17 12:19:26 adamdunkels Exp $ + * $Id: timetable-aggregate.c,v 1.2 2008/03/13 14:27:34 fros4943 Exp $ */ /** @@ -115,6 +115,16 @@ timetable_aggregate_print_detailed(struct timetable_aggregate *a) } /*---------------------------------------------------------------------------*/ void +timetable_aggregate_reset(struct timetable_aggregate *a) +{ + int i; + for(i = 0; i < a->ptr; ++i) { + a->entries[i].time = 0; + a->entries[i].episodes = 0; + } +} +/*---------------------------------------------------------------------------*/ +void timetable_aggregate_print_categories(struct timetable_aggregate *a) { int i; diff --git a/core/sys/timetable-aggregate.h b/core/sys/timetable-aggregate.h index d7bc72b6e..24477c54c 100644 --- a/core/sys/timetable-aggregate.h +++ b/core/sys/timetable-aggregate.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: timetable-aggregate.h,v 1.1 2008/01/17 12:19:26 adamdunkels Exp $ + * $Id: timetable-aggregate.h,v 1.2 2008/03/13 14:27:34 fros4943 Exp $ */ /** @@ -81,6 +81,8 @@ void timetable_aggregate_print_detailed(struct timetable_aggregate *a); void timetable_aggregate_print_categories(struct timetable_aggregate *a); +void timetable_aggregate_reset(struct timetable_aggregate *a); + void timetable_aggregate_compute_detailed(struct timetable_aggregate *a, struct timetable *timetable); void timetable_aggregate_compute_categories(struct timetable_aggregate *a,