[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BOUNCE rtl@rtlinux.org: Approval required: (fwd)
- To: rtl@rtlinux.org
- Subject: BOUNCE rtl@rtlinux.org: Approval required: (fwd)
- From: Der Herr Hofrat <der.herr@hofr.at>
- Date: Sun, 15 Jul 2001 20:28:07 +0200 (CEST)
>From owner-rtl Sun Jul 15 09:53:36 2001
Received: from hq2.fsmlabs.com (hq2.fsmlabs.com [209.155.42.199])
by localhost.fsmlabs.com (8.11.2/8.11.2) with SMTP id f6FFraU06439
for <rtl@rtlinux.org>; Sun, 15 Jul 2001 09:53:36 -0600
Received: (qmail 28579 invoked by uid 1002); 15 Jul 2001 15:49:30 -0000
Date: Sun, 15 Jul 2001 09:49:30 -0600
From: Victor Yodaiken <yodaiken@fsmlabs.com>
To: rtl@fsmlabs.com
Cc: rtl@rtlinux.org, yodaiken@fsmlabs.com
Subject: Re: [rtl] bug in examples rtc_toggle.c and rtc_toggle_fifo.c
Message-ID: <20010715094930.A28569@hq2>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3B51844C.F3A22AED@3dsite.com>
User-Agent: Mutt/1.3.18i
Organization: FSM Labs
did you set CONFIG_V1API ?
On Sun, Jul 15, 2001 at 04:53:48AM -0700, Greg Ercolano wrote:
> I was showing my engineering friend the wonders of rtlinux,
> setting it up on his machine, and monitoring the parallel port
> with his scope, when we came across a couple of examples that
> didn't work, namely:
>
> /usr/rtlinux-3.0/examples/v1api/parallel/rtc_toggle.c
> /usr/rtlinux-3.0/examples/v1api/parallel/rtc_toggle_fifo.c
>
> We found their interrupts only went off once, then stopped.
>
> For fun we debugged them, and found the problem was just
> the interrupt handler; wasn't calling
> I'm guessing these programs were written to use the older
> API which automatically re-enabled the irqs, but when ported
> to the new API, they forgot to add the necessary irq enable.
>
> To make the examples work, just add the rtl_hard_enable_irq(8)
> call above the 'break' statement for 'case 0' in handler(), eg:
> _________________________________________________________________________
>
> unsigned int handler(unsigned int irq_number, struct pt_regs *p) {
> /* Do not rt_task_wait() in a handler */
> switch(shutdown_flag){
> case 0:
> outb(output, LPT_PORT);
> /* I'm too lazy to figure out which pin is which
> so just toggle all of them */
> output = ~output;
> (void) CMOS_READ(RTC_REG_C); /* clear IRQ */
> rtf_put(0, &samp, sizeof(samp));
> samp++;
> rtl_hard_enable_irq(8); // <--- ADD THIS LINE
> break;
> _________________________________________________________________________
>
> Once that's added, both examples will work correctly; the scope puts
> out a nice square wave, and the fifo starts generating data you can
> view with 'od -x /dev/rtf0'.
>
> Other examples should likely be checked for this problem.
>
> HTH..
>
> ps. I really dig rtl. I've already got an RTL interrupt driver going
> for a popular 'Kuper Controls' RTMC48 stepper motor card used in the
> motion picture effects industry. I'm porting my optical printer
> motion control software from DOS to RTL, and it's been a breeze
> so far.. great work.
>
> --
>
> \___/
> |o,o|
> \/ )
> ----mm---------------------------------------------------------------------
> Greg Ercolano UNIX NightOwl / Systems Programmer & Admin
> erco@3dsite.com http://3dsite.com/people/erco/
> ---------------------------------------------------------------------------
>
> ----- End of forwarded message from owner-rtl@fsmlabs.com -----
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/
----- End of forwarded message from owner-rtl@fsmlabs.com -----