From: "vasantha.rajan" <vasantha.rajan@cranessoftware.com>
To: gary@mlbassoc.com, hud@zurich.ibm.com, cmcmanis@mcmanis.com
Cc: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] CYGNUM_HAL_RTC_PERIOD
Date: Wed, 22 Feb 2006 09:03:00 -0000 [thread overview]
Message-ID: <200602221433.27107.vasantha.rajan@cranessoftware.com> (raw)
On Tuesday 21 February 2006 15:09, you wrote:
Hi Dirk ,
Thanks for your reply......
In my previous mail I asked one more question.....but did'nt get reply.
I will give a test code....
int count =1;
void alarm_handler( cyg_handle_t alarm_handle, cyg_addrword_t data )
{
printf("value of count:%d\n",count++);
cyg_flag_setbits(&flag,pattern);
}
void counter_thread(cyg_addrword_t data)
{
while(1)
{
value = 0xfffffffe;
pattern = 1;
mode=CYG_FLAG_WAITMODE_OR ;
cyg_flag_maskbits(&flag,value);
cyg_alarm_initialize( alarm_hdl, 100 + cyg_current_time(), 0 );
value=cyg_flag_wait(&flag,pattern,mode);
}
}
void cyg_user_start()
{
sys_clk = cyg_real_time_clock();
cyg_clock_to_counter( sys_clk, &counter_hdl );
cyg_alarm_create( counter_hdl, alarm_handler,
(cyg_addrword_t)&index1, &alarm_hdl, &alarm_obj );
cyg_thread_create(10, &counter_thread, 0 ,"counter_thread", stack,
STACKSIZE, &handle, &thread);
cyg_thread_resume(handle);
}
1. I made CYGNUM_HAL_RTC_DENOMINATOR to 100000, (so that my
clock will trigger for 10us) and in my code if i initialize my alarm to
cyg_alarm_initialize( alarm_hdl, 100000 + cyg_current_time(), 0 ), my alarm
triggered for every 1 sec.
If I reduce my value given to cyg_alarm_initialize() API to 10000 my alarm
triggered for every 0.1 sec ie, my code
count value increments to 10 for every second and still if reduce my value
to 1000 count value increments to 100 for every second,but if I still
reduce my value to 100 ,I expected the count value should increment to
1000,but the count value increments upto some 350 approx.
and if i still reduce my value to 10 or 1 my count only increments to 350
only...why I am not getting the linear increment?????????
Thanks
Vasanth
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next reply other threads:[~2006-02-22 9:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-22 9:03 vasantha.rajan [this message]
2006-02-22 9:32 ` Andrew Lunn
-- strict thread matches above, loose matches on Subject: below --
2006-02-17 14:11 Àlex Bueno Guarner
2006-02-17 13:41 vasantha.rajan
2006-02-17 22:18 ` Chuck McManis
2006-02-21 5:10 ` vasantha.rajan
2006-02-21 7:54 ` Gary Thomas
[not found] ` <43FADFC7.90709@zurich.ibm.com>
[not found] ` <200602221019.24844.vasantha.rajan@cranessoftware.com>
2006-02-22 9:01 ` Dirk Husemann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200602221433.27107.vasantha.rajan@cranessoftware.com \
--to=vasantha.rajan@cranessoftware.com \
--cc=cmcmanis@mcmanis.com \
--cc=ecos-discuss@ecos.sourceware.org \
--cc=gary@mlbassoc.com \
--cc=hud@zurich.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).