[zaptel-commits] tzafrir: branch 1.4 r3032 - /branches/1.4/ztdummy.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Sat Sep 15 12:34:40 CDT 2007


Author: tzafrir
Date: Sat Sep 15 12:34:39 2007
New Revision: 3032

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3032
Log:
ZAPTEL_RATE is not a time period.

Modified:
    branches/1.4/ztdummy.c

Modified: branches/1.4/ztdummy.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/ztdummy.c?view=diff&rev=3032&r1=3031&r2=3032
==============================================================================
--- branches/1.4/ztdummy.c (original)
+++ branches/1.4/ztdummy.c Sat Sep 15 12:34:39 2007
@@ -91,7 +91,8 @@
 #endif
 
 #ifdef LINUX26
-#define ZAPTEL_RATE 1000
+#define ZAPTEL_RATE 1000                     /* zaptel ticks per second */
+#define ZAPTEL_TIME (1000000 / ZAPTEL_RATE)  /* zaptel tick time in us */
 #ifndef USE_RTC
 /* New 2.6 kernel timer stuff */
 static struct timer_list timer;
@@ -149,7 +150,7 @@
 
 	/* Is spinlock required here??? */
 	spin_lock_irqsave(&ztd->rtclock, flags);
-	ztd->counter += ZAPTEL_RATE;
+	ztd->counter += ZAPTEL_TIME;
 	while (ztd->counter >= current_rate) {
 		ztd->counter -= current_rate;
 		/* Update of RTC IRQ rate isn't possible from interrupt handler :( */
@@ -169,7 +170,7 @@
 	timer.expires = jiffies + 1;
 	add_timer(&timer);
 
-	ztd->counter += ZAPTEL_RATE;
+	ztd->counter += ZAPTEL_TIME;
 	while (ztd->counter >= HZ) {
 		ztd->counter -= HZ;
 		zt_receive(&ztd->span);




More information about the zaptel-commits mailing list