Paul Sokolovsky | b372bfc | 2014-01-03 17:15:53 +0200 | [diff] [blame] | 1 | // This file contains default configuration settings for MicroPython. |
| 2 | // You can override any of these options using mpconfigport.h file located |
| 3 | // in a directory of your port. |
| 4 | |
| 5 | #include <mpconfigport.h> |
| 6 | |
Damien George | 136f675 | 2014-01-07 14:54:15 +0000 | [diff] [blame] | 7 | // Any options not explicitly set in mpconfigport.h will get default |
| 8 | // values below. |
| 9 | |
| 10 | /*****************************************************************************/ |
| 11 | /* Micro Python emitters */ |
| 12 | |
| 13 | // Whether to emit CPython byte codes (for debugging/testing) |
| 14 | // Enabling this overrides all other emitters |
| 15 | #ifndef MICROPY_EMIT_CPYTHON |
| 16 | #define MICROPY_EMIT_CPYTHON (0) |
| 17 | #endif |
| 18 | |
| 19 | // Whether to emit x64 native code |
| 20 | #ifndef MICROPY_EMIT_X64 |
| 21 | #define MICROPY_EMIT_X64 (0) |
| 22 | #endif |
| 23 | |
| 24 | // Whether to emit thumb native code |
| 25 | #ifndef MICROPY_EMIT_THUMB |
| 26 | #define MICROPY_EMIT_THUMB (0) |
| 27 | #endif |
| 28 | |
| 29 | // Whether to enable the thumb inline assembler |
| 30 | #ifndef MICROPY_EMIT_INLINE_THUMB |
| 31 | #define MICROPY_EMIT_INLINE_THUMB (0) |
| 32 | #endif |
| 33 | |
| 34 | /*****************************************************************************/ |
| 35 | /* Internal debugging stuff */ |
| 36 | |
| 37 | // Whether to collect memory allocation stats |
| 38 | #ifndef MICROPY_MEM_STATS |
| 39 | #define MICROPY_MEM_STATS (0) |
| 40 | #endif |
| 41 | |
Damien George | d3ebe48 | 2014-01-07 15:20:33 +0000 | [diff] [blame] | 42 | // Whether to build code to show byte code |
| 43 | #ifndef MICROPY_SHOW_BC |
| 44 | #define MICROPY_SHOW_BC (0) |
| 45 | #endif |
| 46 | |
Damien George | 136f675 | 2014-01-07 14:54:15 +0000 | [diff] [blame] | 47 | /*****************************************************************************/ |
| 48 | /* Fine control over Python features */ |
| 49 | |
Damien George | d3ebe48 | 2014-01-07 15:20:33 +0000 | [diff] [blame] | 50 | // Whether to include the garbage collector |
| 51 | #ifndef MICROPY_ENABLE_GC |
| 52 | #define MICROPY_ENABLE_GC (0) |
| 53 | #endif |
| 54 | |
Damien George | 136f675 | 2014-01-07 14:54:15 +0000 | [diff] [blame] | 55 | // Whether to include REPL helper function |
| 56 | #ifndef MICROPY_ENABLE_REPL_HELPERS |
| 57 | #define MICROPY_ENABLE_REPL_HELPERS (0) |
| 58 | #endif |
| 59 | |
Damien George | d3ebe48 | 2014-01-07 15:20:33 +0000 | [diff] [blame] | 60 | // Whether to include lexer helper function for unix |
| 61 | #ifndef MICROPY_ENABLE_LEXER_UNIX |
| 62 | #define MICROPY_ENABLE_LEXER_UNIX (0) |
| 63 | #endif |
| 64 | |
Damien George | 136f675 | 2014-01-07 14:54:15 +0000 | [diff] [blame] | 65 | // Whether to support float and complex types |
| 66 | #ifndef MICROPY_ENABLE_FLOAT |
| 67 | #define MICROPY_ENABLE_FLOAT (0) |
| 68 | #endif |
| 69 | |
| 70 | // Whether to support slice object and correspondingly |
| 71 | // slice subscript operators |
| 72 | #ifndef MICROPY_ENABLE_SLICE |
| 73 | #define MICROPY_ENABLE_SLICE (1) |
| 74 | #endif |
| 75 | |
| 76 | /*****************************************************************************/ |
| 77 | /* Miscellaneous settings */ |
| 78 | |
Paul Sokolovsky | fc5aac8 | 2014-01-12 16:10:19 +0200 | [diff] [blame] | 79 | #define BITS_PER_BYTE (8) |
| 80 | #define BITS_PER_WORD (BITS_PER_BYTE * BYTES_PER_WORD) |
Paul Sokolovsky | c260bc5 | 2014-01-12 16:15:47 +0200 | [diff] [blame^] | 81 | // machine_int_t value with most significant bit set |
| 82 | #define WORD_MSBIT_HIGH (1 << (BYTES_PER_WORD * 8 - 1)) |
Paul Sokolovsky | fc5aac8 | 2014-01-12 16:10:19 +0200 | [diff] [blame] | 83 | |
Paul Sokolovsky | c90c0f6 | 2014-01-04 01:57:00 +0200 | [diff] [blame] | 84 | // printf format spec to use for machine_int_t and friends |
Damien George | 136f675 | 2014-01-07 14:54:15 +0000 | [diff] [blame] | 85 | #ifndef INT_FMT |
Paul Sokolovsky | c90c0f6 | 2014-01-04 01:57:00 +0200 | [diff] [blame] | 86 | #ifdef __LP64__ |
| 87 | // Archs where machine_int_t == long, long != int |
| 88 | #define UINT_FMT "%lu" |
| 89 | #define INT_FMT "%ld" |
| 90 | #else |
| 91 | // Archs where machine_int_t == int |
| 92 | #define UINT_FMT "%u" |
| 93 | #define INT_FMT "%d" |
| 94 | #endif |
| 95 | #endif //INT_FMT |