All pastes #695418 Raw Edit

Mine

public c v1 · immutable
#695418 ·published 2007-09-13 09:42 UTC
rendered paste body
#include <stdio.h>#include <signal.h>#include <unistd.h>#include <sys/mman.h>#include <string.h>#include <stdlib.h>#include <native/task.h>#include <native/timer.h>#include <rtdm/rtserial.h>#define MAIN_PREFIX "main : "#define WTASK_PREFIX "write_task: "#define STATE_FILE_OPENED         1#define STATE_TASK_CREATED        2#define TASK_PRIO  10 #define TASK_MODE  0  /* No flags */#define TASK_STKSZ 0  /* Stack size (use default one) */ #define WRITE_FILE    "rtser0"static const struct rtser_config write_config = {	.config_mask       = RTSER_SET_BAUD,	.baud_rate         = 115200,};//NATIVE SKINint main(int argc, char *argv[]){       int fd;       int counter = 0;	int *pCounter;	char* myString = "helloworld\n";	RT_TASK task;	mlockall(MCL_CURRENT | MCL_FUTURE);       fd = rt_dev_open("rtser0", O_RDWR);       rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config);       rt_task_shadow(&task, NULL, 90, T_CPU(0)); /* may be done earlier,                                             but not later */       while(counter <100){	rt_dev_write(fd, myString, strlen(myString));printf("%d\n",counter);// sleep(1);  WITHOUT THIS SLEEP helloworld is sent on serial once.counter++;}	rt_dev_close(fd);       return 0;}