#if defined(DOXYGEN_BUILD)
#if (INCLUDE__UBINOS__UBIK_TEST == 1)
#include <stdio.h>
#if (UBINOS__BSP__CPU_MODEL == UBINOS__BSP__CPU_MODEL__SAM7X256)
#include "../../bsp_sam7x256ek/hdr/board.h"
#elif (UBINOS__BSP__CPU_MODEL == UBINOS__BSP__CPU_MODEL__SAM7X512)
#include "../../bsp_sam7x256ek/hdr/board__512.h"
#else
#error "Unsupported UBINOS__BSP__CPU_MODEL"
#endif
#define LOOPCOUNT 10
static void htimerisr(void) {
unsigned int reg;
reg = AT91C_BASE_TC0->TC_SR;
}
static void intrtest00_taskfunc(void * arg) {
unsigned int i;
for (i=0; i<LOOPCOUNT; i++) {
printf("hello world!\n");
}
}
int ubik_test_intrtest00(void) {
int r;
int r2;
unsigned int reg;
if (0 != r) {
logme(
"fail at sem_create");
r = -1;
goto end0;
}
if (0 != r) {
printf("fail at task_create_noautodel(), err=%d\n", r);
r = -1;
goto end1;
}
AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKDIS;
AT91C_BASE_TC0->TC_IDR = 0xFFFFFFFF;
reg = AT91C_BASE_TC0->TC_SR;
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_TC0;
AT91C_BASE_TC0->TC_CMR = AT91C_TC_CPCTRG |
AT91C_TC_CLKS_TIMER_DIV5_CLOCK;
AT91C_BASE_TC0->TC_RC = 46929;
AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKEN;
AT91C_BASE_TC0->TC_IER = AT91C_TC_CPCS;
AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG;
if (0 != r) {
printf("fail at task_join_and_delete(), err=%d\n", r);
r = -1;
}
AT91C_BASE_TC0->TC_CCR = AT91C_TC_CLKDIS;
AT91C_BASE_TC0->TC_IDR = 0xFFFFFFFF;
reg = AT91C_BASE_TC0->TC_SR;
r = 0;
end1:
if (0 != r2) {
printf("fail at sem_delete(), err=%d\n", r2);
r = -1;
}
end0:
return r;
}
#endif
#endif
#define INTR_OPT__LEVEL
Definition: intr.h:49
int intr_getlowestpriority(void)
int intr_connectisr(int no, isr_ft isr, int priority, unsigned int option)
#define INTR_OPT__HIGH
Definition: intr.h:57
#define logme(msg)
Definition: logm.h:233
int sem_delete(sem_pt *sem_p)
int sem_create(sem_pt *sem_p)
stdlib (Standard Library) API
int task_create_noautodel(task_pt *task_p, taskfunc_ft func, void *arg, int priority, unsigned int stackdepth, const char *name)
int task_join_and_delete(task_pt *task_p, int *result_p, int count)
int task_getpriority(task_pt task)
#define NULL
Definition: type.h:42