1 /* system / environment specific defines */
3 /* build for openpcd firmware */
4 //#define LIBRFID_FIRMWARE
6 /* build without dynamic allocations */
7 //#define LIBRFID_STATIC
11 #ifndef LIBRFID_STATIC
12 /* If we're not doing a firmware compile, then we just use the regular
13 * malloc()/free() functions as expected */
15 #define malloc_asic_handle(x) malloc(x)
16 #define free_asic_handle(x) free(x)
18 #define malloc_layer2_handle(x) malloc(x)
19 #define free_layer2_handle(x) free(x)
21 #define malloc_protocol_handle(x) malloc(x)
22 #define free_protocol_handle(x) free(x)
24 #define malloc_rat_handle(x) malloc(x)
25 #define free_rat_handle(x) free(x)
27 #define malloc_reader_handle(x) malloc(x)
28 #define free_reader_handle(x) free(x)
31 /* If we're actually doing a firmware compile, then we use pre-allocated
32 * handles in order to avoid dynamic memory allocation. */
34 #define EMPTY_STATEMENT do {} while(0)
35 extern struct rfid_asic_handle rfid_ah;
36 #define malloc_asic_handle(x) &rfid_ah
37 #define free_asic_handle(x) EMPTY_STATEMENT
39 extern struct rfid_layer2_handle rfid_l2h;
40 #define malloc_layer2_handle(x) &rfid_l2h
41 #define free_layer2_handle(x) EMPTY_STATEMENT
43 extern struct rfid_protocol_handle rfid_ph;
44 #define malloc_protocol_handle(x) &rfid_ph
45 #define free_protocol_handle(x) EMPTY_STATEMENT
47 extern struct rfid_asic_transport_handle rfid_ath;
48 #define malloc_rat_handle(x) &rfid_ath
49 #define free_rat_handle(x) EMPTY_STATEMENT
51 extern struct rfid_reader_handle rfid_rh;
52 #define malloc_reader_handle(x) &rfid_rh
53 #define free_reader_handle(x) EMPTY_STATEMENT
55 #endif /* LIBRFID_STATIC */
57 #endif /* __LIBRFID__ */