Subversion Repositories shark

Rev

Rev 947 | Go to most recent revision | Details | Compare with Previous | 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();           \
950 trimarchi 14
  init_network();              \
947 trimarchi 15
}
16
 
950 trimarchi 17
#define fsf_printf udp_print
947 trimarchi 18
#define printf cprintf
19
/*
20
double
21
t2d(struct timespec time)
22
{
23
          return time.tv_nsec*0.000000001 + (double)time.tv_sec;
24
}
25
*/
26
#define t2d( ts ) ((ts).tv_nsec*0.000000001 + (double)((ts).tv_sec))
27
 
28
#define ERROR(nn, ss) { if(errno==0) errno=nn ; kern_printf(ss); exit(nn);}
29
 
30
#define STANDARD_CONSOLE_INIT { }
31
#define SERIAL_CONSOLE_INIT { }
32
#endif /* SHARK_FSF */
33
//////////////////////////END OF SHARK SECTION /////////////////////////
34
 
35
 
36
/////////////////////////////MARTE SECTION /////////////////////////////
37
#ifdef MARTE_FSF
38
 
39
#include <misc/serial_console.h>
40
#include <misc/load.h>
41
 
42
//#include <debug_marte.h>
43
#include "fsf_contract.h"
44
#include "fsf_types.h"
45
 
46
 
47
#define  INITIALIZATION_CODE \
48
{                                                                         \
49
        SERIAL_CONSOLE_INIT; /*marte1.26i+                              */\
50
        /*init_serial_communication_with_gdb(SERIAL_PORT_1);            */\
51
        /*printf("max_prio = %d\n", sched_get_priority_max(SCHED_FIFO));*/\
52
        /*printf("min_prio = %d\n", sched_get_priority_min(SCHED_FIFO));*/\
53
                                                                          \
54
        adjust();                                                         \
55
        /*set_break_point_here;                                         */\
56
}
57
 
58
#define ERROR(nn, ss) {if(errno==0) errno=(nn); perror(ss); exit (nn);}
59
 
60
int
61
fsf_priority_map (unsigned long plevel)
62
{
63
        return plevel;
64
}
65
 
66
#endif /* MARTE_FSF */
67
//////////////////////////END OF MARTE SECTION /////////////////////////
68
 
69
#endif /* _FSF_OS_COMPATIBILITY_H_ */