2014-01-10 16:21:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "board_uart0.h"
|
|
|
|
#include "posix_io.h"
|
|
|
|
#include "hwtimer.h"
|
|
|
|
#include "thread.h"
|
|
|
|
|
|
|
|
char busy_stack[KERNEL_CONF_STACKSIZE_PRINTF];
|
|
|
|
int busy, i, k;
|
|
|
|
|
|
|
|
void busy_thread(void)
|
|
|
|
{
|
|
|
|
int j;
|
|
|
|
printf("busy_thread starting\n");
|
|
|
|
|
|
|
|
i = 0;
|
2014-01-25 11:29:35 +01:00
|
|
|
|
2014-01-10 16:21:35 +01:00
|
|
|
while (busy) {
|
|
|
|
k = j = ++i;
|
|
|
|
}
|
2014-01-25 11:29:35 +01:00
|
|
|
|
2014-01-10 16:21:35 +01:00
|
|
|
printf("i: %i\n", i);
|
|
|
|
printf("j: %i\n", j);
|
|
|
|
printf("k: %i\n", k);
|
|
|
|
|
|
|
|
printf("success\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
posix_open(uart0_handler_pid, 0);
|
|
|
|
|
|
|
|
busy = 1;
|
|
|
|
k = 23;
|
|
|
|
thread_create(busy_stack, KERNEL_CONF_STACKSIZE_PRINTF,
|
2014-01-25 11:29:35 +01:00
|
|
|
PRIORITY_MAIN + 1, CREATE_WOUT_YIELD, busy_thread,
|
|
|
|
"busy_thread");
|
2014-01-10 16:21:35 +01:00
|
|
|
printf("busy_thread created\n");
|
|
|
|
|
|
|
|
printf("hwtimer_wait()\n");
|
2014-01-14 17:46:20 +01:00
|
|
|
hwtimer_wait(HWTIMER_TICKS(100000));
|
2014-01-10 16:21:35 +01:00
|
|
|
busy = 0;
|
|
|
|
|
|
|
|
printf("main: return\n");
|
|
|
|
}
|