From: Andreas Vogt <A_C_V@web.de>
To: xenomai@xenomai.org
Subject: [Xenomai-help] error while rt_task_wait_period, code -110
Date: Fri, 30 Nov 2007 11:52:48 +0100 [thread overview]
Message-ID: <1829866571@domain.hid> (raw)
[-- Attachment #1: Type: text/plain, Size: 391 bytes --]
Hallo,
I get an error in a simple program with a period time of 1 ms.My latency test program works with a period of 100us.The worst latenz time is about 23us
Any suggestions?
Andreas
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066
[-- Attachment #2: speaker.c --]
[-- Type: text/x-csrc, Size: 2030 bytes --]
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/io.h>
#include <sys/mman.h>
#include <native/task.h>
#include <native/queue.h>
#include <native/intr.h>
#include <native/sem.h>
#define STACK_SIZE 0
#define PRIO_TIMER 3
RT_TASK test_task;
int int_count = 0;
int end = 0;
// --s-ms-us-ns
RTIME task_period_ns = 001000000llu;
void test_task_fct(){
int count = 0;
int ret;
int err =0;
unsigned long overrun;
unsigned char sound_byte;
unsigned char toggle = 0;
ret = rt_task_set_periodic(NULL, TM_NOW, rt_timer_ns2ticks(task_period_ns));
if (ret) {
printf("error while set periodic, code %d\n",ret);
return;
}
while(!end){
ret = rt_task_set_mode(0, T_PRIMARY, NULL);
if (ret) {
printf("error while rt_task_set_mode, code %d\n",ret);
return;
}
ret = rt_task_wait_period(&overrun);
if (ret) {
switch (ret) {
case -EWOULDBLOCK: printf("1\n");
break;
case -EINTR: printf("2\n");
break;
case -ETIMEDOUT: printf("3\n");
break;
case -EPERM: printf("4\n");
break;
}
printf("error while rt_task_wait_period, code %d\n",ret);
return;
}
unsigned char bell = 7;
printf("%c",bell);
fflush(NULL);
}
}
// signal-handler, to ensure clean exit on Ctrl-C
void clean_exit(int dummy) {
printf("[MAIN] try clean exit\n");
end = 1;
rt_task_delete(&test_task);
printf("[MAIN] bye bye\n");
}
int main(int argc, char *argv[]) {
int err, ret = 0;
printf("[MAIN] start system\n");
// install signal handler
signal(SIGTERM, clean_exit);
signal(SIGINT, clean_exit);
mlockall(MCL_CURRENT | MCL_FUTURE);
err = rt_task_spawn(&test_task, "Timer", STACK_SIZE, PRIO_TIMER, 0, &test_task_fct, NULL);
if (err) {
printf("error rt_task_spawn\n");
return 0;
}
printf("[MAIN] test_task created\n");
printf("[MAIN] \n");
pause();
fflush(NULL);
return 0;
}
next reply other threads:[~2007-11-30 10:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-30 10:52 Andreas Vogt [this message]
2007-11-30 11:04 ` [Xenomai-help] error while rt_task_wait_period, code -110 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=1829866571@domain.hid \
--to=a_c_v@web.de \
--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.