From: John Wojnaroski <castle@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] USB task
Date: Thu, 26 Aug 2010 09:59:27 -0700 [thread overview]
Message-ID: <1282841967.2867.28.camel@domain.hid> (raw)
Hi,
I'm writing a task to control an A2D conversion chip via a USB port. The
task will run at 100Hz to convert and read up to 8 channels with a setup
time of 10us between channels. Using a usb_control_msg(....) to control
and talk to the chip(s) in user space.
here is the real time task wrapper that calls the 3 modules
void smc_task( void *cookie) {
rt_task_set_periodic(NULL, TM_NOW, smc_period_ns);
while (!end) {
rt_task_wait_period(NULL); // 100Hz
p_rtMCP->Polling(); // this calls the pUSB->Scan() method
pFltCtrls->Scan();
pSMC->Execute();
}
}
can the task be treated as "atomic" in that all three modules will run
to completion in order without being prempted? or would signals need
blocking as in
/* Block signals to make transaction atomic */
memset( &set, 0xFF, sizeof(sigset_t) );
sigprocmask(SIG_BLOCK, &set, &oldset);
or would this make matters worse. ATM the task is up and running and
*seems* to be working and am assuming the pUSB->Scan() is dropping into
kernel space to communicate via the USB port.
If it is not violating some basic rules and tenets of rt programming
with Xenomai would be happy to leave it as is....
Any thoughts, comments, critiques much appreciated
John
next reply other threads:[~2010-08-26 16:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-26 16:59 John Wojnaroski [this message]
2010-08-26 17:11 ` [Xenomai-help] USB task Gilles Chanteperdrix
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=1282841967.2867.28.camel@domain.hid \
--to=castle@domain.hid \
--cc=xenomai@xenomai.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.