/* $Id$
* $URL$
*
* Generic grouping of widgets that have been set to the same update
* interval, thus allowing synchronized updates.
*
* Copyright (C) 2010 Martin Zuther
* Copyright (C) 2010 The LCD4Linux Team
*
* Based on "timer.c" which is
* Copyright (C) 2003, 2004 Michael Reinelt
* Copyright (C) 2004 The LCD4Linux Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
/*
* Exported functions:
*
* void timer_process_group(void *data)
*
* Process all widgets of a timer group; if the timer group only
* contains one-shot timers, it will be deleted after processing.
*
*
* void timer_exit_group(void)
*
* Release all timer groups and widgets and free the associated
* memory blocks.
*
*
* int timer_add_widget(void (*callback) (void *data), void *data,
* const int interval, const int one_shot)
*
* Add widget to timer group of the specified update interval
* (also creates a new timer group if necessary).
*
*
* int timer_remove_widget(void (*callback) (void *data), void *data)
*
* Remove widget from the timer group with the specified update
* interval (also removes corresponding timer group if empty).
*
*/
#include "config.h"
#include
#include
#include
#include "debug.h"
#include "cfg.h"
#include "timer.h"
#include "timer_group.h"
#ifdef WITH_DMALLOC
#include
#endif
/* structure for storing all relevant data of a single timer group */
typedef struct TIMER_GROUP {
/* pointer to the group's triggering interval in milliseconds;
this will be used to identify a specific timer group and also
as callback data for the underlying generic timer */
int *interval;
/* marks timer group as being active (so it will get processed) or
inactive (which means the timer group has been deleted and its
allocated memory may be re-used) */
int active;
} TIMER_GROUP;
/* number of allocated timer group slots */
int nTimerGroups = 0;
/* pointer to memory allocated for storing the timer group slots */
TIMER_GROUP *TimerGroups = NULL;
/* structure for storing all relevant timer data of a single widget */
typedef struct T# DVB-T Paramo (Lugo, Spain)
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 778000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C59: Canales nacionales
T 810000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE # C63: Canales autonomicos