From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31618 invoked by alias); 21 May 2002 03:56:17 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 31586 invoked from network); 21 May 2002 03:56:16 -0000 Received: from unknown (HELO andy.url.com.tw) (210.59.228.117) by sources.redhat.com with SMTP; 21 May 2002 03:56:16 -0000 Received: (qmail 31363 invoked from network); 21 May 2002 03:55:40 -0000 Received: from ms42.url.com.tw (HELO ms46.url.com.tw) ([210.59.228.29]) (envelope-sender ) by andy.url.com.tw (qmail-ldap-1.03) with SMTP for ; 21 May 2002 03:55:40 -0000 Received: from pug ([61.230.172.148]) by AccSMTP/NT 2.5 [210.59.228.118]; Tue, 21 May 2002 11:56:35 +0800 Message-ID: <005801c2007b$f4f094a0$4800a8c0@pug> From: "Simoncc" To: References: <000001c20077$f7e23320$790114ac@issc.com.tw> Date: Mon, 20 May 2002 20:56:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Subject: Re: [ECOS] E7T timer0 interrupt issue ? X-SW-Source: 2002-05/txt/msg00213.txt.bz2 Peter, As I knew, you can not invoke any interrupt in your "user_start" program. Only you can do that in driver. Simon ----- Original Message ----- From: "peter_ku" To: Sent: Tuesday, May 21, 2002 11:31 AM Subject: [ECOS] E7T timer0 interrupt issue ? > Hello, > > Target = E7T. > I write a simple program to test timer0 interrupt, I want to toggle the led every 1sec. But I can't enter my ISR. > I can see the INTPND = 0x400, and also see my timer0 running!! > Anyone can check the following code? > > thanks a lot > Peter > > > #define TOTAL_THREADS 1 > > cyg_thread threads[TOTAL_THREADS]; > > cyg_handle_t handle_thread_show_led; > cyg_handle_t handle_timer0_isr; > > cyg_interrupt isr; > > char stack[TOTAL_THREADS][4096]; > > cyg_thread_entry_t show_led_proc; > cyg_ISR_t Timer0_ISR; > cyg_DSR_t Timer0_DSR; > > void cyg_user_start(void) > { > cyg_thread_create(4, show_led_proc , (cyg_addrword_t) 0 , "THREAD SHOW LED", (void *) stack[0], 4096, > &handle_thread_show_led, &threads[0]); > > > cyg_interrupt_create(CYGNUM_HAL_INTERRUPT_TIMER0,99,0,Timer0_ISR, Timer0_DSR, &handle_timer0_isr, &isr); > > cyg_interrupt_attach(handle_timer0_isr); > > HAL_WRITE_UINT32(E7T_TDATA0,50000000); > HAL_WRITE_UINT32(E7T_TMOD,E7T_TMOD_TE0 | E7T_TMOD_TMD0); > > cyg_interrupt_unmask(CYGNUM_HAL_INTERRUPT_TIMER0); > cyg_interrupt_enable(); > > > cyg_thread_resume(handle_thread_show_led); > > > } > > > > > void show_led_proc(cyg_addrword_t data) > { > > int i,j; > int temp_data; > > > HAL_READ_UINT32(E7T_IOPDATA,temp_data); > temp_data |= 0xf0; > HAL_WRITE_UINT32(E7T_IOPDATA,temp_data); > > for( ; ; ) > { > for( i =0 ; i < 10 ; i++) > { > > HAL_READ_UINT32(E7T_IOPDATA,temp_data); > temp_data &= ~SEG_MASK; > temp_data |= numeric_display[i]; > HAL_WRITE_UINT32(E7T_IOPDATA,temp_data); > for(j = 0; j < 10000000; j++) { } > } > > } > > } > > > cyg_uint32 Timer0_ISR(cyg_vector_t vector, cyg_addrword_t data) > { > > cyg_uint32 temp_data; > HAL_READ_UINT32(E7T_IOPDATA,temp_data); > temp_data ^= 0xf0; > HAL_WRITE_UINT32(E7T_IOPDATA,temp_data); > > cyg_interrupt_acknowledge(vector); > > return CYG_ISR_HANDLED; > } > > void Timer0_DSR(cyg_vector_t vector,cyg_ucount32 count, cyg_addrword_t data) > { > > } -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss