Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 2064cbd

Browse files
authored
Merge pull request #174 from pycom/float_option
Float option
2 parents da9f545 + a06c014 commit 2064cbd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

esp32/Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,19 @@ CFLAGS_XTENSA_PSRAM = -mfix-esp32-psram-cache-issue
123123
CFLAGS = $(CFLAGS_XTENSA) $(CFLAGS_XTENSA_PSRAM) $(CFLAGS_XTENSA_OPT) -nostdlib -std=gnu99 -g3 -ggdb -fstrict-volatile-bitfields -Iboards/$(BOARD)
124124
CFLAGS_SIGFOX = $(CFLAGS_XTENSA) -O2 -nostdlib -std=gnu99 -g3 -ggdb -fstrict-volatile-bitfields -Iboards/$(BOARD)
125125

126+
# Configure floating point support
127+
ifeq ($(MICROPY_FLOAT_IMPL),double)
128+
CFLAGS += -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_DOUBLE
129+
else
130+
ifeq ($(MICROPY_FLOAT_IMPL),none)
131+
CFLAGS += -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_NONE
132+
else
133+
ifeq ($(MICROPY_FLOAT_IMPL),single)
134+
CFLAGS += -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT
135+
endif
136+
endif
137+
endif
138+
126139
LDFLAGS = -nostdlib -Wl,-Map=$(@:.elf=.map) -Wl,--no-check-sections -u call_user_start_cpu0
127140
LDFLAGS += -Wl,-static -Wl,--undefined=uxTopUsedPriority -Wl,--gc-sections
128141

esp32/mpconfigport.h

+2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@
101101
#define MICROPY_PY_UTIMEQ (1)
102102
#define MICROPY_CPYTHON_COMPAT (1)
103103
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
104+
#ifndef MICROPY_FLOAT_IMPL // can be configured by make option
104105
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
106+
#endif
105107
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)
106108
#define MICROPY_OPT_COMPUTED_GOTO (1)
107109
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)

0 commit comments

Comments
 (0)