Skip to content

Commit 5161eb2

Browse files
committed
quectel: Clean mpconfigport and makefiles.
1 parent 6ebc240 commit 5161eb2

File tree

4 files changed

+45
-174
lines changed

4 files changed

+45
-174
lines changed

ports/quectel/Makefile

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ ROOT := $(TOP)/../..
66
endif
77

88
include ../../py/mkenv.mk
9-
include mpconfigport.mk
109
include quectel.mk
1110

1211
CROSS = 1
@@ -27,7 +26,6 @@ QSTR_DEFS = qstrdefsport.h
2726
# MicroPython feature configurations
2827
MICROPY_ROM_TEXT_COMPRESSION ?= 1
2928

30-
3129
FROZEN_MANIFEST = $(QUEC_PY_MOD)
3230

3331
ifeq ($(OS),Windows_NT)
@@ -66,7 +64,8 @@ CXXFLAGS += $(CXXFLAGS_MOD)
6664
CFLAGS += $(CFLAGS_MOD)
6765
LDFLAGS += $(LDFLAGS_MOD)
6866

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

7170
SHARED_SRC_C = shared/libc/printf.c \
7271
shared/readline/readline.c \
@@ -77,31 +76,18 @@ SHARED_SRC_C = shared/libc/printf.c \
7776
shared/runtime/interrupt_char.c \
7877
shared/timeutils/timeutils.c
7978

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-
9479
SRC_MOD += $(QUEC_SRC_MOD)
9580

9681
SRC_C += $(SRC_MOD) \
9782
$(SHARED_SRC_C) \
98-
$(EXTMOD_SRC_C) \
83+
$(SRC_EXTMOD_C) \
84+
$(LIBS) \
9985
$(QUEC_SRC) \
10086
$(BUILD)/frozen_content.c
10187

10288
SRC_CXX += $(SRC_MOD_CXX)
10389

104-
SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX) $(SHARED_SRC_C) $(EXTMOD_SRC_C)
90+
SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX) $(SHARED_SRC_C) $(SRC_EXTMOD_C)
10591

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

ports/quectel/mpconfigport.h

Lines changed: 40 additions & 120 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,110 +54,53 @@
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
7066
// config option to 0. If you do this then you won't get a REPL prompt, but you
7167
// will still be able to execute pre-compiled scripts, compiled with mpy-cross.
72-
#define MICROPY_ENABLE_COMPILER (1)
73-
74-
#define MICROPY_ENABLE_GC (1)
75-
#define MICROPY_PY_GC (1)
76-
#define MICROPY_HELPER_REPL (1)
77-
#define MICROPY_ENABLE_EXTERNAL_IMPORT (1)
78-
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
79-
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) // decimal numbers support
80-
#define MICROPY_USE_INTERNAL_PRINTF (0)
81-
#define MPZ_DIG_SIZE (16)
82-
#define MICROPY_PY_SYS (1)
83-
84-
#define MICROPY_ALLOC_PATH_MAX (256)
85-
#define MICROPY_ALLOC_PARSE_CHUNK_INIT (16)
86-
87-
#define MICROPY_ERROR_REPORTING MICROPY_ERROR_REPORTING_NORMAL
88-
#define MICROPY_USE_INTERNAL_ERRNO (1)
89-
#define MICROPY_ENABLE_SCHEDULER (1)
90-
#define MICROPY_SCHEDULER_STATIC_NODES (0)
91-
#define MICROPY_SCHEDULER_DEPTH (64)// 8
92-
#define MICROPY_REPL_AUTO_INDENT (1)
93-
#define MICROPY_PY_UTIME_MP_HAL (1)
94-
95-
96-
#define MICROPY_PY_THREAD (1)
97-
#define MICROPY_PY_THREAD_GIL (1)
98-
#define MICROPY_ENABLE_CALLBACK_DEAL (0)
99-
#define MICROPY_READER_VFS (1)
100-
101-
#define MICROPY_KBD_EXCEPTION (1)
102-
#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-
120-
#define MICROPY_PERSISTENT_CODE_LOAD (1)
121-
#define MICROPY_PY_MICROPYTHON (1)
122-
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
68+
#define MICROPY_ENABLE_COMPILER (1)
69+
70+
#define MICROPY_ENABLE_GC (1)
71+
#define MICROPY_PY_GC (1)
72+
#define MICROPY_HELPER_REPL (1)
73+
#define MICROPY_ENABLE_EXTERNAL_IMPORT (1)
74+
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
75+
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) // decimal numbers support
76+
#define MICROPY_USE_INTERNAL_PRINTF (0)
77+
#define MPZ_DIG_SIZE (16)
78+
#define MICROPY_PY_SYS (1)
79+
80+
#define MICROPY_ALLOC_PATH_MAX (256)
81+
#define MICROPY_ALLOC_PARSE_CHUNK_INIT (16)
82+
83+
#define MICROPY_ERROR_REPORTING MICROPY_ERROR_REPORTING_NORMAL
84+
#define MICROPY_USE_INTERNAL_ERRNO (1)
85+
#define MICROPY_ENABLE_SCHEDULER (1)
86+
#define MICROPY_SCHEDULER_STATIC_NODES (0)
87+
#define MICROPY_SCHEDULER_DEPTH (64)// 8
88+
#define MICROPY_REPL_AUTO_INDENT (1)
89+
#define MICROPY_PY_UTIME_MP_HAL (1)
90+
#define MICROPY_PY_THREAD (1)
91+
#define MICROPY_READER_VFS (1)
92+
#define MICROPY_KBD_EXCEPTION (1)
93+
#define MICROPY_PY_SOFT_RESET (0)
94+
#define MICROPY_PERSISTENT_CODE_LOAD (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)
134-
#define MICROPY_PY_REPL_PASSWORD_PROTECT (1)
100+
#if defined(PLAT_Unisoc)
101+
#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
156-
#define mp_type_fileio mp_type_vfs_lfs1_fileio
157-
#define mp_type_textio mp_type_vfs_lfs1_textio
158-
#endif
159-
160-
161104
// type definitions for the specific machine
162105

163106
typedef intptr_t mp_int_t; // must be pointer size
@@ -166,40 +109,18 @@ typedef long mp_off_t;
166109
#define UINT_FMT "%lu"
167110
#define INT_FMT "%ld"
168111

169-
170112
#if MICROPY_ENABLE_GC
171113
#ifndef MICROPY_QPY_GC_HEAP_SIZE
172-
#define MICROPY_QPY_GC_HEAP_SIZE (512 * 1024)
114+
#define MICROPY_QPY_GC_HEAP_SIZE (512 * 1024)
173115
#endif
174-
#define MICROPY_GC_HEAP_SIZE (MICROPY_QPY_GC_HEAP_SIZE)
116+
#define MICROPY_GC_HEAP_SIZE (MICROPY_QPY_GC_HEAP_SIZE)
175117
#endif
176118

177119
#ifdef MICROPY_QPY_MAIN_TASK_STACK_SIZE
178-
#define MP_QPY_TASK_STACK_SIZE (MICROPY_QPY_MAIN_TASK_STACK_SIZE)
179-
#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
120+
#define MP_QPY_TASK_STACK_SIZE (MICROPY_QPY_MAIN_TASK_STACK_SIZE)
198121
#else
199-
#define MP_QPY_TASK_STACK_SIZE (64 * 1024)
122+
#define MP_QPY_TASK_STACK_SIZE (64 * 1024)
200123
#endif
201-
#endif
202-
203124

204125
// We need to provide a declaration/definition of alloca()
205126
#include <alloca.h>
@@ -223,7 +144,6 @@ typedef long mp_off_t;
223144

224145
#define MP_STATE_PORT MP_STATE_VM
225146

226-
227147
#if MICROPY_PY_THREAD
228148
#define MICROPY_EVENT_POLL_HOOK \
229149
do { \
@@ -235,7 +155,7 @@ typedef long mp_off_t;
235155
#else
236156
#define MICROPY_EVENT_POLL_HOOK \
237157
do { \
238-
extern void mp_handle_pending(bool); \
158+
extern void mp_handle_pending(mp_handle_pending_behaviour_t behavior); \
239159
mp_handle_pending(true); \
240160
asm ("waiti 0"); \
241161
} while (0);

ports/quectel/mpconfigport.mk

Lines changed: 0 additions & 21 deletions
This file was deleted.

ports/quectel/quectel.mk

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
PLAT_DFLAGS = $(addprefix -D,$(DFLAGS))
32
PLAT_CFLAGS = $(QUEC_CFLAGS)
43
PLAT_CFLAGS += -Wno-unused-parameter -Wformat=0 -Wno-unused-function
@@ -33,19 +32,6 @@ INC += -I$(ROOT)/system/at
3332
INC += -I$(ROOT)/system/aliiot
3433

3534
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
4935
INC += -I$(ROOT)/system/at
5036
INC += -I$(ROOT)/system/esim
5137
endif

0 commit comments

Comments
 (0)