Skip to content

Commit 7860c2a

Browse files
committed
py: Fix some macros defines; cleanup some includes.
1 parent be8e99c commit 7860c2a

11 files changed

Lines changed: 14 additions & 14 deletions

File tree

py/bc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#if 0 // print debugging info
4545
#define DEBUG_PRINT (1)
4646
#else // don't print debugging info
47+
#define DEBUG_PRINT (0)
4748
#define DEBUG_printf(...) (void)0
4849
#endif
4950

py/builtinimport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#define DEBUG_PRINT (1)
5151
#define DEBUG_printf DEBUG_printf
5252
#else // don't print debugging info
53+
#define DEBUG_PRINT (0)
5354
#define DEBUG_printf(...) (void)0
5455
#endif
5556

py/gc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#define DEBUG_PRINT (1)
4545
#define DEBUG_printf DEBUG_printf
4646
#else // don't print debugging info
47+
#define DEBUG_PRINT (0)
4748
#define DEBUG_printf(...) (void)0
4849
#endif
4950

@@ -746,7 +747,9 @@ void gc_dump_alloc_table(void) {
746747
if (*ptr == (mp_uint_t)&mp_type_tuple) { c = 'T'; }
747748
else if (*ptr == (mp_uint_t)&mp_type_list) { c = 'L'; }
748749
else if (*ptr == (mp_uint_t)&mp_type_dict) { c = 'D'; }
750+
#if MICROPY_PY_BUILTINS_FLOAT
749751
else if (*ptr == (mp_uint_t)&mp_type_float) { c = 'F'; }
752+
#endif
750753
else if (*ptr == (mp_uint_t)&mp_type_fun_bc) { c = 'B'; }
751754
else if (*ptr == (mp_uint_t)&mp_type_module) { c = 'M'; }
752755
else { c = 'h'; }

py/map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ void mp_set_clear(mp_set_t *set) {
358358
set->table = NULL;
359359
}
360360

361-
#if DEBUG_PRINT
361+
#if defined(DEBUG_PRINT) && DEBUG_PRINT
362362
void mp_map_dump(mp_map_t *map) {
363363
for (mp_uint_t i = 0; i < map->alloc; i++) {
364364
if (map->table[i].key != NULL) {

py/mpconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@
184184
#endif
185185

186186
// Whether to enable finalisers in the garbage collector (ie call __del__)
187-
#ifndef MICROPY_ENABLE_GC_FINALISER
188-
#define MICROPY_ENABLE_GC_FINALISER (0)
187+
#ifndef MICROPY_ENABLE_FINALISER
188+
#define MICROPY_ENABLE_FINALISER (0)
189189
#endif
190190

191191
// Whether to check C stack usage. C stack used for calling Python functions,

py/nlr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct _nlr_buf_t {
3636
// the entries here must all be machine word size
3737
nlr_buf_t *prev;
3838
void *ret_val;
39-
#if !MICROPY_NLR_SETJMP
39+
#if !defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP
4040
#if defined(__i386__)
4141
void *regs[6];
4242
#elif defined(__x86_64__)

py/nlrthumb.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#if !MICROPY_NLR_SETJMP && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__))
27+
#if (!defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP) && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__))
2828

2929
// We only need the functions here if we are on arm/thumb, and we are not
3030
// using setjmp/longjmp.
@@ -138,4 +138,4 @@ nlr_jump:
138138
nlr_top:
139139
.space 4
140140

141-
#endif // !MICROPY_NLR_SETJMP && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__))
141+
#endif // (!defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP) && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__))

py/objfun.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#if 0 // print debugging info
4545
#define DEBUG_PRINT (1)
4646
#else // don't print debugging info
47+
#define DEBUG_PRINT (0)
4748
#define DEBUG_printf(...) (void)0
4849
#endif
4950

py/objtype.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#define DEBUG_PRINT (1)
4444
#define DEBUG_printf DEBUG_printf
4545
#else // don't print debugging info
46+
#define DEBUG_PRINT (0)
4647
#define DEBUG_printf(...) (void)0
4748
#endif
4849

stmhal/printf.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,10 @@
2929
#include <stdarg.h>
3030

3131
#include "mpconfig.h"
32-
#include "std.h"
3332
#include "misc.h"
34-
#include "systick.h"
3533
#include "qstr.h"
3634
#include "obj.h"
3735
#include "pfenv.h"
38-
#if 0
39-
#include "lcd.h"
40-
#endif
41-
#include "uart.h"
42-
#include "usb.h"
4336
#include "pybstdio.h"
4437

4538
#if MICROPY_PY_BUILTINS_FLOAT

0 commit comments

Comments
 (0)