From 51c933f7fdf6d0c8801b6ff277b291bbd3c104b2 Mon Sep 17 00:00:00 2001 From: dopefishh Date: Fri, 9 Oct 2015 14:35:31 +0200 Subject: [PATCH] YAYYYYYYYYY --- mart/ex11/ex11.c | 84 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 23 deletions(-) diff --git a/mart/ex11/ex11.c b/mart/ex11/ex11.c index 503029f..fade86c 100644 --- a/mart/ex11/ex11.c +++ b/mart/ex11/ex11.c @@ -13,6 +13,7 @@ #define LPT1IRQ 7 #define TICKS 5 #define BANNERWIDTH 10000 +#define MSGMAX 1000 #define MAXX 20 RT_TASK intrtask, drawtask; @@ -20,7 +21,8 @@ RTIME ticks[TICKS+1]; RTIME tocks[TICKS+1]; unsigned char data[BANNERWIDTH]; -char* message; +char message[MSGMAX]; +char inputmsg[MSGMAX]; unsigned int pointer = 0; unsigned int msglen; @@ -61,7 +63,7 @@ void taski(void *arg) //Register as interrupt handler RT_INTR intr; rt_intr_create(&intr, NULL, LPT1IRQ, 0); - rt_printf("Interrupt created\n"); + //rt_printf("Interrupt created\n"); //Initialize and declare the timer variables RTIME tick = rt_timer_read(); @@ -78,7 +80,7 @@ void taski(void *arg) rt_task_create(&drawtask, NULL, 0, 50, 0); period = ticks[TICKS]+tocks[TICKS]; rt_task_start(&drawtask, &taskd, &period); - rt_printf("tocks is the short stretch\n"); + //rt_printf("tocks is the short stretch\n"); } rt_intr_wait(&intr, TM_INFINITE); @@ -92,7 +94,7 @@ void taski(void *arg) rt_task_create(&drawtask, NULL, 0, 50, 0); period = ticks[TICKS]+tocks[TICKS]; rt_task_start(&drawtask, &taskd, &period); - rt_printf("ticks is the short stretch\n"); + //rt_printf("ticks is the short stretch\n"); } rt_intr_wait(&intr, TM_INFINITE); //Print average @@ -101,26 +103,12 @@ void taski(void *arg) } } -int main(int argc, char* argv[]) +void make_message(char *msg) { - if(argc != 2){ - printf("Usage: %s \"Message\"\n", argv[0]); - return 1; - } - message = argv[1]; - rt_print_auto_init(1); - mlockall(MCL_CURRENT | MCL_FUTURE); - - unsigned int i; - for(i=0; i