Skip to content

Commit f4780f1

Browse files
committed
quectel: Clean up mpconfigport and Makefile.
1 parent 6ebc240 commit f4780f1

File tree

3 files changed

+14
-117
lines changed

3 files changed

+14
-117
lines changed

ports/quectel/Makefile

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ QSTR_DEFS = qstrdefsport.h
2727
# MicroPython feature configurations
2828
MICROPY_ROM_TEXT_COMPRESSION ?= 1
2929

30-
3130
FROZEN_MANIFEST = $(QUEC_PY_MOD)
3231

3332
ifeq ($(OS),Windows_NT)
@@ -66,7 +65,8 @@ CXXFLAGS += $(CXXFLAGS_MOD)
6665
CFLAGS += $(CFLAGS_MOD)
6766
LDFLAGS += $(LDFLAGS_MOD)
6867

69-
LIBS =
68+
LIBS = lib/littlefs/lfs2.c \
69+
lib/littlefs/lfs2_util.c
7070

7171
SHARED_SRC_C = shared/libc/printf.c \
7272
shared/readline/readline.c \
@@ -77,31 +77,18 @@ SHARED_SRC_C = shared/libc/printf.c \
7777
shared/runtime/interrupt_char.c \
7878
shared/timeutils/timeutils.c
7979

80-
EXTMOD_SRC_C = extmod/vfs.c \
81-
extmod/vfs_lfs.c \
82-
extmod/vfs_blockdev.c \
83-
extmod/modrandom.c \
84-
extmod/modjson.c \
85-
extmod/modbinascii.c \
86-
extmod/vfs_reader.c \
87-
extmod/modre.c \
88-
extmod/modhashlib.c \
89-
extmod/moductypes.c \
90-
extmod/modos.c
91-
92-
EXTMOD_SRC_C += $(SRC_THIRDPARTY_C)
93-
9480
SRC_MOD += $(QUEC_SRC_MOD)
9581

9682
SRC_C += $(SRC_MOD) \
9783
$(SHARED_SRC_C) \
98-
$(EXTMOD_SRC_C) \
84+
$(SRC_EXTMOD_C) \
85+
$(LIBS) \
9986
$(QUEC_SRC) \
10087
$(BUILD)/frozen_content.c
10188

10289
SRC_CXX += $(SRC_MOD_CXX)
10390

104-
SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX) $(SHARED_SRC_C) $(EXTMOD_SRC_C)
91+
SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX) $(SHARED_SRC_C) $(SRC_EXTMOD_C)
10592

10693
OBJ += $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
10794
OBJ += $(addprefix $(BUILD)/, $(SRC_CXX:.cpp=.o))

ports/quectel/mpconfigport.h

Lines changed: 9 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
/****************************** user define ************************************/
3232
// python grammar
3333
#define MICROPY_PY_ATTRTUPLE (1)
34-
#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
35-
#define MICROPY_CPYTHON_COMPAT (1)
34+
#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
35+
#define MICROPY_CPYTHON_COMPAT (1)
3636

3737
// builtin op
3838
#define MICROPY_PY_BUILTINS_STR_OP_MODULO (1)
@@ -42,10 +42,10 @@
4242

4343
// modules
4444
#define MICROPY_PY_IO (1)
45-
#define MICROPY_PY_JSON (1)
45+
#define MICROPY_PY_JSON (1)
4646
#define MICROPY_VFS (1)
47-
#define MICROPY_QPY_MODULE_UOS (0)
4847
#define MICROPY_PY_VFS (0)
48+
#define MICROPY_VFS_LFS2 (1)
4949
#define MICROPY_PY_TIME (0)
5050
#define MICROPY_PY_HEAPQ (0)
5151
#define MICROPY_PY_OS (1)
@@ -54,16 +54,12 @@
5454
#define MICROPY_PY_FRAMEBUF (0)
5555
#define MICROPY_PY_ASYNCIO (0)
5656
#define MICROPY_PY_BINASCII_CRC32 (0)
57-
58-
#define MICROPY_PY_UCTYPES (MICROPY_QPY_PY_UCTYPES)
59-
#define MICROPY_PY_DEFLATE (0)
60-
57+
#define MICROPY_PY_UCTYPES (0)
58+
#define MICROPY_PY_DEFLATE (0)
6159
#define MICROPY_OPT_COMPUTED_GOTO (1)
6260

6361
/******************************** base define **********************************/
6462
// options to control how MicroPython is built
65-
66-
// Use the minimal starting configuration (disables all optional features).
6763
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
6864

6965
// You can disable the built-in MicroPython compiler by setting the following
@@ -90,73 +86,23 @@
9086
#define MICROPY_SCHEDULER_STATIC_NODES (0)
9187
#define MICROPY_SCHEDULER_DEPTH (64)// 8
9288
#define MICROPY_REPL_AUTO_INDENT (1)
93-
#define MICROPY_PY_UTIME_MP_HAL (1)
94-
95-
89+
#define MICROPY_PY_UTIME_MP_HAL (1)
9690
#define MICROPY_PY_THREAD (1)
97-
#define MICROPY_PY_THREAD_GIL (1)
98-
#define MICROPY_ENABLE_CALLBACK_DEAL (0)
9991
#define MICROPY_READER_VFS (1)
100-
10192
#define MICROPY_KBD_EXCEPTION (1)
10293
#define MICROPY_PY_SOFT_RESET (0)
103-
#define MICROPY_PY_IO_FILEIO (1)
104-
#define MICROPY_PY_BUILTINS_SLICE (1)
105-
#define MICROPY_PY_BUILTINS_PROPERTY (1)
106-
#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
107-
#define MICROPY_PY_BUILTINS_SET (1)
108-
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
109-
#define MICROPY_PY_SYS_STDFILES (1)
110-
#define MICROPY_PY_SYS_STDIO_BUFFER (1)
111-
#define MICROPY_PY_STRUCT (1)
112-
#define MICROPY_ENABLE_FINALISER (1)
113-
#define MICROPY_PY_BUILTINS_ENUMERATE (1)
114-
#define MICROPY_PY_BUILTINS_MIN_MAX (1)
115-
#if defined(PLAT_EIGEN) || defined(PLAT_EIGEN_718)
116-
#define MICROPY_PY_URANDOM (1)
117-
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (1)
118-
#endif
119-
12094
#define MICROPY_PERSISTENT_CODE_LOAD (1)
121-
#define MICROPY_PY_MICROPYTHON (1)
122-
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
12395

12496
#ifndef SSIZE_MAX
12597
#define SSIZE_MAX 0xFFFFFFFF
12698
#endif
12799

128-
#if defined(PLAT_Unisoc) \
129-
|| defined(PLAT_Unisoc_8850) \
130-
|| defined(PLAT_ASR_1803s) \
131-
|| defined(PLAT_RDA) \
132-
|| defined(PLAT_Qualcomm) \
133-
|| defined(PLAT_ASR)
100+
#if defined(PLAT_Unisoc)
134101
#define MICROPY_PY_REPL_PASSWORD_PROTECT (1)
135102
#endif
136103

137-
#if defined(PLAT_SONY_ALT1350)
138-
#define MICROPY_PY_USOCKET_EVENTS (1)
139-
#endif
140-
141-
#if defined(PLAT_SONY_ALT1350)
142-
#define MICROPY_PY_USSL (1)
143-
#define MICROPY_SSL_MBEDTLS (1)
144-
#endif
145-
146-
#if defined(PLAT_Qualcomm)
147-
#define mp_type_fileio mp_type_vfs_efs_fileio
148-
#define mp_type_textio mp_type_vfs_efs_textio
149-
#elif defined(PLAT_EIGEN)
150-
#define mp_type_fileio mp_type_vfs_lfs2_fileio
151-
#define mp_type_textio mp_type_vfs_lfs2_textio
152-
#elif defined(PLAT_EIGEN_718)
153-
#define mp_type_fileio mp_type_vfs_lfs2_fileio
154-
#define mp_type_textio mp_type_vfs_lfs2_textio
155-
#else
156104
#define mp_type_fileio mp_type_vfs_lfs1_fileio
157105
#define mp_type_textio mp_type_vfs_lfs1_textio
158-
#endif
159-
160106

161107
// type definitions for the specific machine
162108

@@ -166,7 +112,6 @@ typedef long mp_off_t;
166112
#define UINT_FMT "%lu"
167113
#define INT_FMT "%ld"
168114

169-
170115
#if MICROPY_ENABLE_GC
171116
#ifndef MICROPY_QPY_GC_HEAP_SIZE
172117
#define MICROPY_QPY_GC_HEAP_SIZE (512 * 1024)
@@ -177,29 +122,8 @@ typedef long mp_off_t;
177122
#ifdef MICROPY_QPY_MAIN_TASK_STACK_SIZE
178123
#define MP_QPY_TASK_STACK_SIZE (MICROPY_QPY_MAIN_TASK_STACK_SIZE)
179124
#else
180-
#if defined(PLAT_RDA)
181-
#define MP_QPY_TASK_STACK_SIZE (32 * 1024)
182-
#elif defined(PLAT_EIGEN)
183-
#define MP_QPY_TASK_STACK_SIZE (32 * 1024)
184-
#elif defined(PLAT_EIGEN_718)
185-
#define MP_QPY_TASK_STACK_SIZE (8 * 1024)
186-
#elif defined(PLAT_ECR6600)
187-
#define MP_QPY_TASK_STACK_SIZE (8 * 1024)
188-
#elif defined(PLAT_aic8800m40)
189-
#define MP_QPY_TASK_STACK_SIZE (10 * 1024)
190-
#elif defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8850_R02)
191-
#if defined(BOARD_EC600GCN_LD) || defined(BOARD_EC800GCN_LD) || defined(BOARD_EC800GCN_LD_XBND) \
192-
|| defined(BOARD_EC800GCN_LD_HRXM) || defined(BOARD_EC600GCN_LD_YM) || defined(BOARD_EC800GCN_TT) \
193-
|| defined(BOARD_EG800GLA_LD)
194-
#define MP_QPY_TASK_STACK_SIZE (16 * 1024)
195-
#else
196-
#define MP_QPY_TASK_STACK_SIZE (64 * 1024)
197-
#endif
198-
#else
199125
#define MP_QPY_TASK_STACK_SIZE (64 * 1024)
200126
#endif
201-
#endif
202-
203127

204128
// We need to provide a declaration/definition of alloca()
205129
#include <alloca.h>
@@ -223,7 +147,6 @@ typedef long mp_off_t;
223147

224148
#define MP_STATE_PORT MP_STATE_VM
225149

226-
227150
#if MICROPY_PY_THREAD
228151
#define MICROPY_EVENT_POLL_HOOK \
229152
do { \
@@ -235,7 +158,7 @@ typedef long mp_off_t;
235158
#else
236159
#define MICROPY_EVENT_POLL_HOOK \
237160
do { \
238-
extern void mp_handle_pending(bool); \
161+
extern void mp_handle_pending(mp_handle_pending_behaviour_t behavior); \
239162
mp_handle_pending(true); \
240163
asm ("waiti 0"); \
241164
} while (0);

ports/quectel/quectel.mk

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,6 @@ INC += -I$(ROOT)/system/at
3333
INC += -I$(ROOT)/system/aliiot
3434

3535
ifeq ($(strip $(PLAT)),Unisoc)
36-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))
37-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/include
38-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include
39-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/lwip
40-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/lwip/apps
41-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/lwip/priv
42-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/lwip/prot
43-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/netif
44-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/posix
45-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/posix/arpa
46-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/posix/net
47-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/posix/netinet
48-
INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/posix/sys
4936
INC += -I$(ROOT)/system/at
5037
INC += -I$(ROOT)/system/esim
5138
endif

0 commit comments

Comments
 (0)