]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_GCC_CR/TARGET_LPC11U68/mtb.c
1 //*****************************************************************************
8 // +----+ Copyright (c) 2013 Code Red Technologies Ltd.
12 // Optionally defines an array to be used as a buffer for Micro Trace
13 // Buffer (MTB) instruction trace on Cortex-M0+ parts
17 // Software License Agreement
19 // The software is owned by Code Red Technologies and/or its suppliers, and is
20 // protected under applicable copyright laws. All rights are reserved. Any
21 // use in violation of the foregoing restrictions may subject the user to criminal
22 // sanctions under applicable laws, as well as to civil liability for the breach
23 // of the terms and conditions of this license.
25 // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
26 // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
27 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
28 // USE OF THIS SOFTWARE FOR COMMERCIAL DEVELOPMENT AND/OR EDUCATION IS SUBJECT
29 // TO A CURRENT END USER LICENSE AGREEMENT (COMMERCIAL OR EDUCATIONAL) WITH
30 // CODE RED TECHNOLOGIES LTD.
32 //*****************************************************************************
34 /*******************************************************************
35 * Symbols controlling behavior of this code...
38 * If this symbol is defined, then the buffer array for the MTB
39 * will not be created.
42 * Symbol specifying the sizer of the buffer array for the MTB.
43 * This must be a power of 2 in size, and fit into the available
44 * RAM. The MTB buffer will also be aligned to its 'size'
45 * boundary and be placed at the start of a RAM bank (which
46 * should ensure minimal or zero padding due to alignment).
49 * Allows MTB Buffer to be placed into specific RAM bank. When
50 * this is not defined, the "default" (first if there are
51 * several) RAM bank is used.
52 *******************************************************************/
54 // Ignore with none Code Red tools
55 #if defined (__CODE_RED)
57 // Allow MTB to be removed by setting a define (via command line)
58 #if !defined (__MTB_DISABLE)
60 // Allow for MTB buffer size being set by define set via command line
61 // Otherwise provide small default buffer
62 #if !defined (__MTB_BUFFER_SIZE)
63 #define __MTB_BUFFER_SIZE 128
66 // Check that buffer size requested is >0 bytes in size
67 #if (__MTB_BUFFER_SIZE > 0)
68 // Pull in MTB related macros
69 #include <cr_mtb_buffer.h>
71 // Check if MYTB buffer is to be placed in specific RAM bank
72 #if defined(__MTB_RAM_BANK)
73 // Place MTB buffer into explicit bank of RAM
74 __CR_MTB_BUFFER_EXT(__MTB_BUFFER_SIZE
,__MTB_RAM_BANK
);
76 // Place MTB buffer into 'default' bank of RAM
77 __CR_MTB_BUFFER(__MTB_BUFFER_SIZE
);
79 #endif // defined(__MTB_RAM_BANK)
81 #endif // (__MTB_BUFFER_SIZE > 0)
83 #endif // !defined (__MTB_DISABLE)
85 #endif // defined (__CODE_RED)