Hi kashin,<br><br>Having a delay is very simple and clean, simpler than saying it, <br><br>#include <interfaces/timer_client.h><br>#include <timer/timer.h><br><br>timer_t tim, tim_ret;<br>int r;<br><br>timer_init();
<br>tim = timer_create();<br>r = timer_request(tim, MICROSECS(10), TIMER_ONESHOT);<br>do {<br> tim_ret = timer_wait();<br>
} while(tim_ret!=tim) ;<br><br>And that's it, or you can always go dirty with for(i=0;i<N;i++);<br><br>
Hope it helps,<br><br>Cheers,<br><font color="#888888"><br>Jorge</font><br><br><div class="gmail_quote">On Nov 30, 2007 8:18 PM, Jorge Torres <<a href="mailto:jorge.torres.maldonado@gmail.com">jorge.torres.maldonado@gmail.com
</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi kashin,<br><br>Having a delay is very simple and clean, simpler than saying it,
<br><br>#include <interfaces/timer_client.h><br>#include <timer/timer.h><br><br>timer_t tim, tim_ret;<br>int r;<br><br>timer_init();
<br>tim = timer_create();<br>r = timer_request(tim, MICROSECS(10), TIMER_ONESHOT);<br>tim_ret = timer_wait();<br><br>while(tim_ret!=tim);<br><br>And that's it, or you can always go dirty with for(i=0;i<N;i++);<br>
<br>
Hope it helps,<br><br>Cheers,<br><font color="#888888"><br>Jorge</font><div><div></div><div class="Wj3C7c"><br><div class="gmail_quote">On Nov 29, 2007 10:19 AM, kashin Lin <<a href="mailto:kashin08@gmail.com" target="_blank">
kashin08@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>thanks for your reply. <br><br>the reason of the need for delay is that :<br>i want to add some milliseconds delay between contiguous hardware configuration instruction. <br>so maybe it's no need to use this powerful method such as timer.
<br>so are there any alternative way to achieve this goal?<br>p.s. where are those examples use timer server i can refer to?<br> ( i want to learn how to use timer too )<br><br><br><br>another questions for register irq handler:
<br>if i want to use function_A as irq #B's handler<br><br> thread_ref_t thrd;<br> thrd = thread_create_simple( function_A, NULL, 100 );<br> hardware_register_interrupt( thread_l4tid(thrd), B );<br>
<br>is the right way to register it?<br><br><br><br><br><div><span class="gmail_quote">2007/11/29, Jorge Torres <<a href="mailto:jorge.torres.maldonado@gmail.com" target="_blank">
jorge.torres.maldonado@gmail.com</a>>:</span><div><div></div><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi,</div><div> </div><div>You can use iguana's timer server, there are some examples, at which you can look at,</div><div> </div><div>Cheers,</div><div> </div><div>Jorge<br><br></div><div class="gmail_quote"><div>
<span>On Nov 28, 2007 2:49 AM, kashin Lin <<a href="mailto:kashin08@gmail.com" target="_blank">kashin08@gmail.com</a>> wrote: <br></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div><span>Hi,<br><br>i wonder know if OKL4 or Iguana has any system call or API that can delay<br><br>several msec,( similar to uDelay or mDelay in linux kernel). and how to use it? <br><br>ex: which header file i should include, and what function i can call?
<br><br><br>another quetion is about request IRQ:<br><br>in linux kernel there is a functin named request_irq whitch can map a IRQ# to a handler routine. <br><br>i noticed there is a function named hardware_register_interrupt in iguana, but the parameters are
<br><br>IRQ# and a thread id. it doesn't make sense for me. why not a handler routine instead of a thread id?<br><br>if i want to rigster a handler routine for a IRQ#, how should i do?<br><br></span></div>_______________________________________________
<br>Developer mailing list<br><a href="mailto:Developer@okl4.org" target="_blank"> Developer@okl4.org</a><br><a href="https://lists.okl4.org/mailman/listinfo/developer" target="_blank">
https://lists.okl4.org/mailman/listinfo/developer</a><br><br></blockquote></div><br></blockquote></div></div></div><br>
</blockquote></div><br>
</div></div></blockquote></div><br>