Revision a33cec74

View differences:

apps/HelloWorld/helloworld.c
20 20

  
21 21
#pragma message "Hello World! (.c)"
22 22

  
23
//Parameter (und rückgabewert) immer anpassen an shutdown, loop, setup
24 23
void helloShutdown(urt_node_t* node, urt_status_t cause, void* arg)
25 24
{
26
    urtPrintf("Hello World shutdown!\n");
25
    urtPrintf("Hello %p shutdown!\n", arg);
27 26
    return;
28 27
}
29 28

  
30 29
urt_osEventMask_t helloSetup(urt_node_t* node, void* arg)
31 30
{
32
  urtPrintf("Hello World setup!\n");
31
  urtPrintf("Hello %p setup!\n", arg);
33 32
  return URT_EVENTMASK_ALL;
34 33
}
35 34

  
36 35
urt_osEventMask_t helloLoop(urt_node_t* node, urt_osEventMask_t events, void* arg)
37 36
{
38
  urtPrintf("Hello World loop!\n");
37
  urtPrintf("Hello %p loop!\n", arg);
39 38
  return URT_EVENTMASK_ALL;
40 39
}
41 40

  
42
void helloWorldInit(urt_node_t* node, urt_osThread_t* thread)
41
void helloWorldInit(urt_node_t* node, urt_osThread_t* thread, void* arg)
43 42
{
44
    urtNodeInit(node, thread, URT_THREAD_PRIO_LOW_MIN, &helloSetup, NULL, &helloLoop, NULL, &helloShutdown, NULL);
43
    urtNodeInit(node, thread, URT_THREAD_PRIO_LOW_MIN, &helloSetup, arg, &helloLoop, arg, &helloShutdown, arg);
44
    //urtNodeInit(node, thread, URT_THREAD_PRIO_LOW_MIN, NULL, NULL, NULL, NULL, NULL, NULL);
45 45
}
apps/HelloWorld/helloworld.h
30 30
void helloShutdown(urt_node_t* node, urt_status_t cause, void* arg);
31 31
urt_osEventMask_t helloSetup(urt_node_t* node, void* arg);
32 32
urt_osEventMask_t helloLoop(urt_node_t* node, urt_osEventMask_t events, void* arg);
33
void helloWorldInit(urt_node_t* node, urt_osThread_t* thread);
33
void helloWorldInit(urt_node_t* node, urt_osThread_t* thread, void* arg);
34 34

  
35 35
#if defined(__cplusplus)
36 36
}
configurations/HelloWorld/modules/NUCLEO-F401RE/mainincludes.hpp
23 23
#include <helloworld.h>
24 24

  
25 25
static URT_THREAD_MEMORY(hellosvenja_thread, 512);
26
//static URT_THREAD_MEMORY(hellothomas_thread, 256);
26
static URT_THREAD_MEMORY(hellothomas_thread, 256);
27 27
static urt_node_t hellosvenja_node;
28
//static urt_node_t hellothomas_node;
28
static urt_node_t hellothomas_node;
29 29

  
30
#define AMIROOS_CFG_MAIN_INIT_HOOK_3() {                                                \
31
    urtCoreInit();                                                                      \
32
    helloWorldInit(&hellosvenja_node, (urt_osThread_t*)hellosvenja_thread);             \
30
#define AMIROOS_CFG_MAIN_INIT_HOOK_3() {                                              \
31
    urtCoreInit();                                                                    \
32
    helloWorldInit(&hellosvenja_node, (urt_osThread_t*)hellosvenja_thread, NULL);     \
33
    helloWorldInit(&hellothomas_node, (urt_osThread_t*)hellothomas_thread, NULL);     \
34
}
35

  
36
#define AMIROOS_CFG_MAIN_INIT_HOOK_4() {                                                \
33 37
    urtCoreStartNodes();                                                                \
34 38
}
35 39

  
36 40

  
41

  
42

  
37 43
#endif /* MAININCLUDES_HPP */
middleware/apps_urtosal.c
137 137
    /* pointer to the parent thread */ chThdGetSelfX(),
138 138
  };
139 139

  
140
  urtPrintf("Test before chThdCreateSuspended in threadInit\n");
141
  urtThreadMSleep(10);
142

  
143
  urtPrintf("memory: 0x%08X\n", memory);
140
 /* urtPrintf("memory: 0x%08X\n", memory);
144 141
  urtPrintf("size: %u\n", size);
145 142
  urtPrintf("prio: %u\n", prio);
146 143
  urtPrintf("func: 0x%08X\n", func);
147 144
  urtPrintf("arg: 0x%08X\n", arg);
148 145
  urtPrintf("parent: 0x%08X\n", chThdGetSelfX());
149
  urtThreadMSleep(10);
150

  
151
  urt_osThread_t* temp= chThdCreateSuspended(&descriptor);
152

  
153
  urtPrintf("Test after chThdCreateSuspended in threadInit\n");
154
  urtThreadMSleep(10);
146
  urtThreadMSleep(10); */
155 147

  
156
  return temp;
148
  return chThdCreateSuspended(&descriptor);
157 149
}
158 150

  
159 151
void urtThreadTerminate(urt_osThread_t* thread, urt_osThreadTerminateSignal_t sig)
middleware/uRtWare
1
Subproject commit 6882b76ce8acc0f026b66edc41e69691b269dae1
1
Subproject commit e360ce71dd8d041fa9011398d8fdec2d3be6f078

Also available in: Unified diff