Index: hal/common/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/common/current/ChangeLog,v retrieving revision 1.106 diff -u -r1.106 ChangeLog --- hal/common/current/ChangeLog 22 Aug 2004 12:06:40 -0000 1.106 +++ hal/common/current/ChangeLog 20 Nov 2004 15:19:40 -0000 @@ -1,3 +1,8 @@ +2004-11-20 Andrew Lunn + + * tests/intr.c: Make the ISR call the DSR to make sure this works + correctly. + 2004-08-22 Gary Thomas * doc/porting.sgml: Replace [very misleading dated] comments Index: hal/common/current/tests/intr.c =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/common/current/tests/intr.c,v retrieving revision 1.10 diff -u -r1.10 intr.c --- hal/common/current/tests/intr.c 23 May 2002 23:02:50 -0000 1.10 +++ hal/common/current/tests/intr.c 20 Nov 2004 15:19:40 -0000 @@ -74,6 +74,7 @@ // ------------------------------------------------------------------------- volatile cyg_count32 ticks = 0; +volatile cyg_count32 dsr_ticks = 0; static cyg_interrupt intr; static cyg_handle_t intr_handle; @@ -91,18 +92,26 @@ ticks++; - return CYG_ISR_HANDLED; + return CYG_ISR_CALL_DSR; } // ------------------------------------------------------------------------- +void dsr( cyg_uint32 vector, cyg_ucount32 count, CYG_ADDRWORD data ) +{ + CYG_TEST_CHECK( ISR_DATA == data , "Bad data passed to DSR"); + CYG_TEST_CHECK( CYGNUM_HAL_INTERRUPT_RTC == vector , + "Bad vector passed to DSR"); + + dsr_ticks += count; +} void intr_main( void ) { CYG_INTERRUPT_STATE oldints; cyg_drv_interrupt_create(CYGNUM_HAL_INTERRUPT_RTC, 1, - ISR_DATA, isr, NULL, &intr_handle, &intr); + ISR_DATA, isr, dsr, &intr_handle, &intr); cyg_drv_interrupt_attach(intr_handle); HAL_CLOCK_INITIALIZE( CYGNUM_HAL_RTC_PERIOD ); cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_RTC); @@ -114,6 +123,9 @@ } + + CYG_TEST_CHECK( dsr_ticks == 10, "DSR not called sufficient times"); + HAL_DISABLE_INTERRUPTS(oldints); CYG_TEST_PASS_FINISH("HAL interrupt test");