2 * @file frecan_config.h
4 * @brief constants to configure the frescan protocol
15 * This module contains some constants and macros to configure the
16 * frescan protocol. For example, the size of the packets pool, etc...
20 * See MaRTE OS license
24 #ifndef _MARTE_FRESCAN_CONFIG_H_
25 #define _MARTE_FRESCAN_CONFIG_H_
27 #include "fosa_threads_and_signals.h" // FOSA_SIGNAL_MIN
28 #include <sys/kernel.h> // kernel_enter_critic_section
30 #define FRESCAN_MX_PACKETS 200
31 #define FRESCAN_MX_NETWORKS 2
32 #define FRESCAN_BROADCAST_ADDR 0xF
33 #define FRESCAN_MX_IDS 255
34 #define FRESCAN_MX_PRIOS 32
35 #define FRESCAN_REPL_SIGNAL_NUM FOSA_SIGNAL_MIN + 10 // real-time signal
36 #define FRESCAN_BACKGROUND_PRIO 0
37 #define FRESCAN_MX_REPLY_OBJECTS 40
38 #define FRESCAN_REPL_THREAD_PRIO 60
39 #define FRESCAN_NEG_THREAD_PRIO 50
40 #define FRESCAN_MX_REQUESTS 40
41 #define FRESCAN_NEG_MASTER_NODE 0
42 #define FRESCAN_REPLY_OBJECTS_MX_CEILING 90
43 #define FRESCAN_REQUESTS_MX_CEILING 90
44 #define FRESCAN_BWRES_MX_PRIO 60
45 #define FRESCAN_ACCEPTOR_THREAD_PRIO FRESCAN_NEG_THREAD_PRIO - 1
46 #define FRESCAN_BWRES_NEG_MESSAGES_PRIO 8
47 #define FRESCAN_NEG_CHANNEL 0
48 #define FRESCAN_MX_NODES 2
49 #define FRESCAN_MX_CONTRACTS (FRESCAN_MX_NODES*FRESCAN_MX_IDS)
50 #define FRESCAN_MX_REPL_OPS FRESCAN_MX_IDS*10
51 #define FRESCAN_FRAME_TX_TIME 0.000200 // measured transmission time of an 8byte frame
53 #define FRESCAN_MLOCK_T unsigned
54 #define FRESCAN_CREATE_LOCK(l)
55 #define FRESCAN_DESTROY_LOCK(l)
56 #define FRESCAN_ACQUIRE_LOCK(l) kernel_enter_critic_section(l)
57 #define FRESCAN_RELEASE_LOCK(l) kernel_leave_critic_section(*(l))
59 #endif // _MARTE_FRESCAN_CONFIG_H_