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