Revision fdf47c5d

View differences:

apps/HelloWorld/helloworld.c
20 20

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

  
23
void hello(int i) {
24
   /* urt_node_t* node;
25
    urt_osThread_t* thread;
26
    urt_nodeSetupCallback_t* setupcallback;
27
    void* setupparams;
28
    urt_nodeLoopCallback_t* loopcallback;
29
    void* loopparams;
30
    urt_nodeShutdownCallback_t* shutdowncallback;
31
    void* shutdownparams;
32
    urtNodeInit(node, thread, setupcallback, setupparams, loopcallback, loopparams, shutdowncallback, shutdownparams);  */
33
    return;
23
urt_osEventMask_t hello(urt_node_t* node, urt_osEventMask_t events, void* arg)
24
{
25
    urtPrintf("Hello World!\n");
26
    return URT_EVENTMASK_ALL;
27
}
28

  
29
void helloWorldInit(urt_node_t* node, urt_osThread_t* thread)
30
{
31
    urtNodeInit(node, thread, URT_THREAD_PRIO_LOW_MIN, NULL, NULL, &hello, NULL, NULL, NULL);
34 32
}
apps/HelloWorld/helloworld.h
19 19
#ifndef HELLOWORLD_H
20 20
#define HELLOWORLD_H
21 21

  
22
//#include <urtware.h>
22
#include <urtware.h>
23 23

  
24 24
#pragma message "Hello World! (.h)"
25 25

  
26
typedef void (*helloFunction)(int);
27
void hello(int arg);
26
#if defined(__cplusplus)
27
extern "C" {
28
#endif /* defined(__cplusplus) */
29

  
30
urt_osEventMask_t hello(urt_node_t* node, urt_osEventMask_t events, void* arg);
31
void helloWorldInit(urt_node_t* node, urt_osThread_t* thread);
32

  
33
#if defined(__cplusplus)
34
}
35
#endif /* defined(__cplusplus) */
28 36

  
29 37
#endif /* HELLOWORLD_H */
configurations/HelloWorld/modules/NUCLEO-F401RE/mainincludes.hpp
22 22
#include <urtware.h>
23 23
#include <helloworld.h>
24 24

  
25
#define AMIROOS_CFG_MAIN_INIT_HOOK_4() {                        \
26
    aosprintf("HELLO WORLD!\n");                                \
27
    urtCoreInit();                                              \
28
    helloFunction helloWorld = &hello;                          \
29
    helloFunction helloSvenja = &hello;                         \
25
static URT_THREAD_MEMORY(hellosvenja_thread, 256);
26
static URT_THREAD_MEMORY(hellothomas_thread, 256);
27
static urt_node_t hellosvenja_node;
28
static urt_node_t hellothomas_node;
29

  
30
#define AMIROOS_CFG_MAIN_INIT_HOOK_4() {                                \
31
    urtCoreInit();                                                      \
32
    helloWorldInit(&hellosvenja_node, (urt_osThread_t*)hellosvenja_thread);             \
33
    helloWorldInit(&hellothomas_node, (urt_osThread_t*)hellothomas_thread);             \
30 34
}
31
/*hellowInit(helloSvenja(3));*/
32 35

  
33 36

  
34 37
#endif /* MAININCLUDES_HPP */
middleware/apps_urtosal.h
81 81
 * @brief   Type representing event masks.
82 82
 * @details Event masks can be used to distinguish and filter events.
83 83
 */
84
typedef eventmask_t urt_osEventMask_t;
84
typedef eventmask_t  urt_osEventMask_t;
85 85

  
86 86
/**
87 87
 * @brief   Type representing event flags.
......
94 94
 */
95 95
#define URT_EVENTMASK_MAXPRIO                   EVENT_MASK(0)
96 96

  
97
/**
98
 * @brief   Event mask to select all events,
99
 */
100
#define URT_EVENTMASK_ALL                       ALL_EVENTS
101

  
97 102
#define urtEventSourceInit(source)              chEvtObjectInit(source)
98 103

  
99 104
#define urtEventSourceBroadcast(source, flags)  chEvtBroadcastFlags(source, flags)
middleware/uRtWare
1
Subproject commit f6e5368ee3663579507904074df6f96f77fc5f84
1
Subproject commit 4ea18a07d5e39ca20993e9b7ec61f20f1777757b

Also available in: Unified diff