Ejemplo n.º 1
0
        public static void recalc_timer(int i)
        {
            long period = (long)(1000000000 * timer[i].scale * timer[i].preset / 33868800);

            if (period != 0)
            {
                period = (long)(1000000000 / 62.8206);
            }
            if (timer[i].period != period)
            {
                timer[i].period = period;
                if (period != 0)
                {
                    Timer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_IN_NSEC(period), Attotime.ATTOTIME_IN_NSEC(period));
                }
                else
                {
                    Timer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER);
                }
            }
        }