Rev 950 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
947 | trimarchi | 1 | // Header file that allows a general testing code to be used for calling |
2 | // the FSF primitives in both platforms: MaRTE_OS and SHARK |
||
3 | |||
4 | #ifndef _FSF_OS_COMPATIBILITY_H_ |
||
5 | #define _FSF_OS_COMPATIBILITY_H_ |
||
6 | #define SHARK_FSF |
||
7 | /////////////////////////////SHARK SECTION ///////////////////////////// |
||
8 | #ifdef SHARK_FSF |
||
9 | |||
10 | #define INITIALIZATION_CODE \ |
||
11 | { \ |
||
12 | fsf_init(); \ |
||
13 | calibrate_cycle(); \ |
||
14 | } |
||
15 | |||
16 | #define printf cprintf |
||
17 | /* |
||
18 | double |
||
19 | t2d(struct timespec time) |
||
20 | { |
||
21 | return time.tv_nsec*0.000000001 + (double)time.tv_sec; |
||
22 | } |
||
23 | */ |
||
24 | #define t2d( ts ) ((ts).tv_nsec*0.000000001 + (double)((ts).tv_sec)) |
||
25 | |||
26 | #define ERROR(nn, ss) { if(errno==0) errno=nn ; kern_printf(ss); exit(nn);} |
||
27 | |||
28 | #define STANDARD_CONSOLE_INIT { } |
||
29 | #define SERIAL_CONSOLE_INIT { } |
||
30 | #endif /* SHARK_FSF */ |
||
31 | //////////////////////////END OF SHARK SECTION ///////////////////////// |
||
32 | |||
33 | |||
34 | /////////////////////////////MARTE SECTION ///////////////////////////// |
||
35 | #ifdef MARTE_FSF |
||
36 | |||
37 | #include <misc/serial_console.h> |
||
38 | #include <misc/load.h> |
||
39 | |||
40 | //#include <debug_marte.h> |
||
41 | #include "fsf_contract.h" |
||
42 | #include "fsf_types.h" |
||
43 | |||
44 | |||
45 | #define INITIALIZATION_CODE \ |
||
46 | { \ |
||
47 | SERIAL_CONSOLE_INIT; /*marte1.26i+ */\ |
||
48 | /*init_serial_communication_with_gdb(SERIAL_PORT_1); */\ |
||
49 | /*printf("max_prio = %d\n", sched_get_priority_max(SCHED_FIFO));*/\ |
||
50 | /*printf("min_prio = %d\n", sched_get_priority_min(SCHED_FIFO));*/\ |
||
51 | \ |
||
52 | adjust(); \ |
||
53 | /*set_break_point_here; */\ |
||
54 | } |
||
55 | |||
56 | #define ERROR(nn, ss) {if(errno==0) errno=(nn); perror(ss); exit (nn);} |
||
57 | |||
58 | int |
||
59 | fsf_priority_map (unsigned long plevel) |
||
60 | { |
||
61 | return plevel; |
||
62 | } |
||
63 | |||
64 | #endif /* MARTE_FSF */ |
||
65 | //////////////////////////END OF MARTE SECTION ///////////////////////// |
||
66 | |||
67 | #endif /* _FSF_OS_COMPATIBILITY_H_ */ |