#define MODULE
#define HZ_FREQUENCY 77
#include <unistd.h>
#include <linux/cons.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <rtl_sched.h>
#include "rt_com.h"
RT_TASK serialPortTask;
void serialPort(int t) { /* this task reads and writes data to the Serial Port */
/* Initialization stuff */
char prueba[]="Hello world\n";
/* open port */
rt_com_setup(0,4800,RT_COM_PARITY_ODD,2,8);
while (1) /* must loop, b/c it is a periodic task */
{
rt_com_write (0,prueba,10);
rt_task_wait();
}
}
int init_module(void)
{
int stackSize=1000*sizeof(int);
/* Returns the number of RT_TICKS_PER_SEC since the computer was booted */
RTIME now = rt_get_time();
rt_task_init(&serialPortTask, serialPort, 50, stackSize, 1);
rt_task_make_periodic(&serialPortTask, now+RT_TICKS_PER_SEC,
RT_TICKS_PER_SEC/HZ_FREQUENCY);
return 0;
}
void cleanup_module(void)
{
rt_task_delete(&serialPortTask);
}
=================================================================
To run this I did
insmod rlt_sched
insmod rtl_nfifo
insmod rt_com
insmod tr_process <- my test example.
Everyting seems to go fine but nothing happens: Nothing is written in the line.
Could you please give some advice?
Thanks a lot for your time.
Joaquin Morcate