OpenCores
URL https://opencores.org/ocsvn/de1_olpcl2294_system/de1_olpcl2294_system/trunk

Subversion Repositories de1_olpcl2294_system

[/] [de1_olpcl2294_system/] [trunk/] [sw/] [ecos/] [debug/] [main.c] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 qaztronic
//
2
//
3
//
4
 
5
#include <stdio.h>
6
#include <math.h>
7
#include <stdlib.h>
8
 
9
#include <cyg/kernel/kapi.h>
10
 
11
#include "LPC22xx.h"
12
#include "lib_dbg_sh.h"
13
 
14
extern void dbg_sh(void);
15
 
16
 
17
/* now declare (and allocate space for) some kernel objects,
18
   like the two threads we will use */
19
cyg_thread thread_s[2];         /* space for two thread objects */
20
 
21
char stack[2][4096];            /* space for two 4K stacks */
22
 
23
/* now the handles for the threads */
24
cyg_handle_t simple_threadA, simple_threadB;
25
 
26
/* and now variables for the procedure which is the thread */
27
cyg_thread_entry_t simple_program;
28
 
29
/* and now a mutex to protect calls to the C library */
30
cyg_mutex_t cliblock;
31
 
32
/* we install our own startup routine which sets up threads */
33
void cyg_user_start(void)
34
{
35
//   printf("Entering twothreads' cyg_user_start() function\n");
36
 
37
  // enable cs3
38
  PINSEL2 = 0x0f814924;
39
 
40
  // configure BCFG3
41
  *((unsigned int *)0xFFE0000C) = 0x20007de7;
42
 
43
 
44
  cyg_mutex_init(&cliblock);
45
 
46
  cyg_thread_create(4, simple_program, (cyg_addrword_t) 0,
47
                    "Thread A", (void *) stack[0], 4096,
48
                    &simple_threadA, &thread_s[0]);
49
//   cyg_thread_create(4, simple_program, (cyg_addrword_t) 1,
50
//                  "Thread B", (void *) stack[1], 4096,
51
//                  &simple_threadB, &thread_s[1]);
52
 
53
  cyg_thread_resume(simple_threadA);
54
//   cyg_thread_resume(simple_threadB);
55
}
56
 
57
/* this is a simple program which runs in a thread */
58
void simple_program(cyg_addrword_t data)
59
{
60
  int message = (int) data;
61
  int delay;
62
 
63
  printf("Beginning execution; thread data is %d\n", message);
64
 
65
  dbg_sh();
66
 
67
}
68
 
69
 
70
int main(void)
71
{
72
 
73
 
74
 
75
  return( -1 );
76
}
77
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.