From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32486 invoked by alias); 19 Jul 2009 14:47:30 -0000 Received: (qmail 32476 invoked by uid 22791); 19 Jul 2009 14:47:28 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.stmi.com (HELO mail.stmi.com) (70.169.254.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Jul 2009 14:47:20 +0000 X-Ninja-PIM: Scanned by Ninja X-Ninja-AttachmentFiltering: (no action) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Sun, 19 Jul 2009 14:47:00 -0000 Message-ID: In-Reply-To: <186ad4050907190707w790c7bdcxda0d58ed32392e7d@mail.gmail.com> From: "Christophe Coutand" To: "Nodir Qodirov" , X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: RE: [ECOS] eCos heartbeat function handler X-SW-Source: 2009-07/txt/msg00160.txt.bz2 I believe what you are looking for is located in: kernel\current\src\common\clock.cxx The clock is created here and attached to the HW interrupt: Cyg_RealTimeClock::Cyg_RealTimeClock() : Cyg_Clock(rtc_resolution), interrupt(CYGNUM_HAL_INTERRUPT_RTC, CYGNUM_KERNEL_COUNTERS_CLOCK_ISR_PRIORITY, (CYG_ADDRWORD)this, isr, dsr) { CYG_REPORT_FUNCTION(); HAL_CLOCK_INITIALIZE( CYGNUM_KERNEL_COUNTERS_RTC_PERIOD); interrupt.attach(); interrupt.unmask_interrupt(CYGNUM_HAL_INTERRUPT_RTC); Cyg_Clock::real_time_clock =3D this; } The tick value is incremented from the DSR: void Cyg_RealTimeClock::dsr(cyg_vector vector, cyg_ucount32 count, CYG_ADDR= WORD data) rtc->tick( count ); The period of the RTC clock is configurable from your .ecc file. Christophe -----Original Message----- From: ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss-owner@eco= s.sourceware.org] On Behalf Of Nodir Qodirov Sent: Sunday, July 19, 2009 4:07 PM To: Nodir Qodirov; ecos-discuss@ecos.sourceware.org Subject: Re: [ECOS] eCos heartbeat function handler Thank you Andrew! I think your answer is from eCos application programmer's view, I want to know tick handler function from system designer/developer point of view. For example in the example which you gave at http://ecos.sourceware.org/docs-latest/user-guide/clocks-and-alarm-handlers= .html I initialize alarm and it will be called whenever it reaches given clock ti= cks. In this case cyg_alarm_initialize(test_alarmH, cyg_current_time()+1, 1); I'm just creating timer with the period of one tick and asking re-trigger this alarm periodically. If I run this example (at clocks-and-alarm-handlers.html) on my i386 board, it works fine, but there is some function which is receiving hardware ticks and making all eCos alarms to work. What is that function? Maybe I can paraphrase my question simple as: which function in eCos kernel is handling hardware clock tick (or clock tick interrupts) ? 2009/7/19 Andrew Lunn : >> 2) Where should I specify (some assembler file...) which function to >> call on each heartbeat? > > Take a look at: > > http://ecos.sourceware.org/docs-latest/user-guide/clocks-and-alarm-handle= rs.html > > Call > cyg_alarm_initialize(test_alarmH, cyg_current_time()+1, 1); > > and you alarm function will be called every tick. > > =A0 =A0Andrew > --=20 Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss