This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: how can I create real time clock interrupt?
- From: Gary Thomas <gthomas at ecoscentric dot com>
- To: =?UTF-8?Q?=E6=9D=8E?= =?UTF-8?Q?=E6=99=96?= <li dot hui at 263 dot net>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: 02 Nov 2002 06:55:32 -0700
- Subject: Re: [ECOS] how can I create real time clock interrupt?
- References: <200211021015.gA2AFVV05714@august.dcel.nwpu.edu.cn>
On Sat, 2002-11-02 at 02:49, 李晖 wrote:
> I try to create a interrupt attach to RTC,but I failed.the code I wrote as below:
> cyg_handle_t timer_intr_handle;
> cyg_interrupt timer_intr;
>
> cyg_interrupt_create(CYGNUM_HAL_INTERRUPT_RTC, 1, 0, do_count, 0, &timer_intr_handle, &timer_intr);
> cyg_interrupt_enable();
> cyg_interrupt_attach(timer_intr_handle);
>
> I download my code to target, and using GDB(insight) debug my code,.When program run to the cyg_interrupt_create(...) sentence, the GDB warning me it "program recieve a signal SIGSEGV, segmentation fault" and then terminate the program.
You probably should not be calling 'cyg_interrupt_enable'. This
will happen automatically when you let the scheduler run.
Also, the kernel will have already attached to this interrupt.
Are you sure that this is what you want/need?
n.b. sending the same message to the mailing list three times
will not improve the response time :-(
--
------------------------------------------------------------
Gary Thomas |
eCosCentric, Ltd. |
+1 (970) 229-1963 | eCos & RedBoot experts
gthomas@ecoscentric.com |
http://www.ecoscentric.com/ |
------------------------------------------------------------
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss