1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/irq/main.c
Lucas Jenss 426170b064 Improve naming of thread stacksize/priority constants
As discussed in #2725, this commit renames a number of stacksize constants to
better convey their intended usage. In addition, constants for thread priority
are given a `THREAD_` prefix. Changes are:

* KERNEL_CONF_STACKSIZE_PRINTF renamed to THREAD_EXTRA_STACKSIZE_PRINTF
* KERNEL_CONF_STACKSIZE_DEFAULT renamed to THREAD_STACKSIZE_DEFAULT
* KERNEL_CONF_STACKSIZE_IDLE renamed to THREAD_STACKSIZE_IDLE
* KERNEL_CONF_STACKSIZE_MAIN renamed to THREAD_STACKSIZE_MAIN
* Move thread stacksizes from kernel.h to thread.h, since the prefix changed
* PRIORITY_MIN renamed to THREAD_PRIORITY_MIN
* PRIORITY_IDLE renamed to THREAD_PRIORITY_IDLE
* PRIORITY_MAIN renamed to THREAD_PRIORITY_MAIN
* Move thread priorities from kernel.h to thread.h since the prefix has changed
* MINIMUM_STACK_SIZE renamed to THREAD_STACKSIZE_MINIMUM for consistency
2015-05-21 00:14:23 +02:00

69 lines
1.1 KiB
C

/*
* Copyright (C) 2013 Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief IRQ test application
*
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
*
* @}
*/
#include <stdio.h>
#include "hwtimer.h"
#include "thread.h"
char busy_stack[THREAD_STACKSIZE_MAIN];
volatile int busy, i, k;
void *busy_thread(void *arg)
{
(void) arg;
int j = 0;
puts("busy_thread starting");
i = 0;
while (busy) {
k = j = ++i;
}
printf("i: %i\n", i);
printf("j: %i\n", j);
printf("k: %i\n", k);
puts("success");
return NULL;
}
int main(void)
{
busy = 1;
k = 23;
thread_create(busy_stack, sizeof(busy_stack),
THREAD_PRIORITY_MAIN + 1, CREATE_WOUT_YIELD,
busy_thread, NULL, "busy_thread");
puts("busy_thread created");
puts("hwtimer_wait()");
hwtimer_wait(HWTIMER_TICKS(100000));
busy = 0;
puts("main: return");
return 0;
}