Hello,
I would like to make a real time application . This appliaction has a
periodic thread that has to be executed with a period of 1 milisecond.
Therefore, I create the following file modulo_rt.c.
#include <rtl.h>
#include <time.h>
#include <pthread.h>
#include <float.h>
#include "modelo.h"
pthread_t thread;
void * start_routine(void *arg)
{
float salida;
struct sched_param p;
p . sched_priority = 1;
pthread_setschedparam (pthread_self(), SCHED_FIFO, &p);
pthread_make_periodic_np (pthread_self(), gethrtime(), 1000000);
while (1) {
Actualiza modelo():
salida=Salida_modelo();
pthread_wait_np ();
rtl_printf("Salida %f\n", salida);
}
return 0;
}
int init_module(void) {
Inicializa_modelo();
return pthread_create (&thread, NULL, start_routine, 0);
}
void cleanup_module(void) {
Finaliza_modelo();
pthread_delete_np (thread);
}
The following functions Actualiza_modelo(), Salida_modelo,
Inicializa_modelo, Finaliza_modelo() are in a different file: fun.c and they
are declared in the include file # include modelo.h.
How would I compile and create the RTL programm?
I have proved
make -f rtl.mk modulo_rt.c fun.c modulo_rt.o but the module_rt.o does not
recogniza the functions written in fun.c file.
Would I make a RT program with main() function with
pthread_create();
pthread_setperiod_np(); and so on
functions?
Could someone help me, please?
Ana.
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/