FreeCalypso > hg > tcs211-fcmodem
comparison chipsetsw/layer1/include/l1_macro.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /************* Revision Controle System Header ************* | |
2 * GSM Layer 1 software | |
3 * L1_MACRO.H | |
4 * | |
5 * Filename l1_macro.h | |
6 * Copyright 2003 (C) Texas Instruments | |
7 * | |
8 ************* Revision Controle System Header *************/ | |
9 | |
10 #include "l1_confg.h" | |
11 | |
12 #if(L1_DYN_DSP_DWNLD == 1) | |
13 #include "l1_dyn_dwl_const.h" | |
14 #endif | |
15 | |
16 #if (TRACE_TYPE==5) && NUCLEUS_TRACE | |
17 //WARNING : this type of trace takes a lot of space in data RAM (~16kB) | |
18 | |
19 // switch for Nucleus debugging messages. | |
20 #define NU_ALLOC_ERR 0 | |
21 #define NU_DEALLOC_ERR 1 | |
22 #define NU_RCVE_QUEUE_ERR 2 | |
23 #define NU_SEND_QUEUE_ERR 3 | |
24 #define NU_OBTA_SEMA_ERR 4 | |
25 #define NU_RLSE_SEMA_ERR 5 | |
26 | |
27 // Nucleus debug function. | |
28 #define DEBUGMSG(status,type) \ | |
29 if(status) switch(type) \ | |
30 { \ | |
31 case NU_ALLOC_ERR: \ | |
32 printf("NU mem. allocation error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
33 exit(0); \ | |
34 break; \ | |
35 \ | |
36 case NU_DEALLOC_ERR: \ | |
37 printf("NU mem. deallocation error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
38 exit(0); \ | |
39 break; \ | |
40 \ | |
41 case NU_RCVE_QUEUE_ERR: \ | |
42 printf("NU rcve queue error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
43 exit(0); \ | |
44 break; \ | |
45 \ | |
46 case NU_SEND_QUEUE_ERR: \ | |
47 printf("NU send queue error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
48 exit(0); \ | |
49 break; \ | |
50 \ | |
51 case NU_OBTA_SEMA_ERR: \ | |
52 printf("NU obtain semaph. error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
53 exit(0); \ | |
54 break; \ | |
55 \ | |
56 case NU_RLSE_SEMA_ERR: \ | |
57 printf("NU release semaph. error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
58 exit(0); \ | |
59 break; \ | |
60 \ | |
61 default: \ | |
62 printf("Unknown error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
63 exit(0); \ | |
64 break; \ | |
65 } | |
66 #else | |
67 #define DEBUGMSG(status,type) | |
68 #endif | |
69 | |
70 /************************************************************/ | |
71 /* Macros for FAST INTEGER MODULO implementation. */ | |
72 /************************************************************/ | |
73 #define IncMod(operand, increment, modulo) \ | |
74 if( (operand += increment) >= modulo ) operand -= modulo | |
75 | |
76 | |
77 // Define MACRO for selecting the min. time to next task. | |
78 #define Select_min_time(Task_Time, Min_Time) \ | |
79 if(Task_Time < Min_Time) Min_Time = Task_Time; | |
80 | |
81 | |
82 /************************************************************/ | |
83 /* Macros for MCU/DSP API address conversion . */ | |
84 /************************************************************/ | |
85 #if(L1_DYN_DSP_DWNLD == 1) | |
86 | |
87 #define API_address_dsp2mcu(dsp_address) \ | |
88 (MCU_API_BASE_ADDRESS + ((API)((dsp_address) - DSP_API_BASE_ADDRESS) * 2)) | |
89 | |
90 #define API_address_mcu2dsp(mcu_address) \ | |
91 (DSP_API_BASE_ADDRESS + ((UWORD32)((mcu_address) - MCU_API_BASE_ADDRESS) / 2)) | |
92 #endif | |
93 |