Commit Graph

65 Commits

Author SHA1 Message Date
Xiang Xiao 9208176f60 build: Move __NuttX__ definition to tools/Config.mk
ensure this critical macro get defined in all projects

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-02 13:22:39 -03:00
chao.an b88561299b make/expression: improving up asm/C/C++ compile times
In the current compilation environment, the recursive assignment(=) for compile
flags will be delayed until every file is actually need to be compile.

For example:
--------------------------------------------------------------------------------
arch/arm/src/Makefile:

INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip}
INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)common}
INCLUDES += ${shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)$(ARCH_SUBDIR)}
INCLUDES += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)sched}

CPPFLAGS += $(INCLUDES) $(EXTRAFLAGS)
CFLAGS += $(INCLUDES) $(EXTRAFLAGS)
CXXFLAGS += $(INCLUDES) $(EXTRAFLAGS)
AFLAGS += $(INCLUDES) $(EXTRAFLAGS)
--------------------------------------------------------------------------------

All compilation options will be included recursively,
which will be delayed until the compilation options are actually used:

tools/Config.mk:

--------------------------------------------------------------------------------
define COMPILE
  @echo "CC: $1"
  $(Q) $(CC) -c $(CFLAGS) $($(strip $1)_CFLAGS) $1 -o $2
endef
--------------------------------------------------------------------------------

All compile flags to be reexecuted $(INCDIR) as long as one file needs to be compiled,
but in fact, the compilation options have not changed in the current directory.

So the we recommand to change the syntax of assignment
From
    Recursive (=)
To
    Simple    (:=)

In this way, we can ensure that all compilation options are expanded only once and reducing repeated works.

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-02 07:53:53 -08:00
David Sidrane 06d1ea1a67 imxrt:imxrt10x0-evk Add KEEP on init_section 2020-09-29 10:26:59 +08:00
Xiang Xiao b0797263ca libc/stdio: Allocate file_struct dynamically
1.Reduce the default size of task_group_s(~512B each task)
2.Scale better between simple and complex application

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia872137504fddcf64d89c48d6f0593d76d582710
2020-09-11 17:58:17 +08:00
Xiang Xiao a0ce81d659 sched/wdog: Don't dynamically allocate wdog_s
to save the preserved space(1KB) and also avoid the heap overhead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
2020-08-11 12:28:55 -06:00
Xiang Xiao 154852acb5 sched/mqueue: Reduce the initial memory consumption
Change the preallocated message and descriptor from 32/24 to 4.
The total size is reduce from 1892 to 532

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I79d199465daef678986868f773876289859f42fc
2020-08-10 08:07:50 +02:00
Xiang Xiao e1d3627bb1 sched/wdog: Change the default value of MAX_WDOGPARMS from 4 to 2
since the maximum number of argument pass to wd_start in the whole
code base is 2 and change CONFIG_MAX_WDOGPARMS in some defconfig
from 1 to 2 oherwise pthread_condclockwait will fail

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib6cb28b8c0722058849e7be916e164513431d21c
2020-08-06 10:36:22 -06:00
Xiang Xiao b329e2377d boards: Move toolchain related variables to Toolchain.defs
1.It make sense to let Toolchain.defs give the default value
2.The board can still change if the default isn't suitable
3.Avoid the same definition spread more than 200 Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic2649f1c7689bcf59c105ca8db61cad45b6e0e64
2020-07-20 17:10:37 +01:00
Xiang Xiao 4910d43ab0 build: Move the toolchain library setting to the common place
so all boards support C++ automatically
2020-07-16 15:38:08 -03:00
Xiang Xiao f5311de6b4 boards: Remove the unused ARCHCCVERSION and ARCHCCMAJOR
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I22d546693139c59c8c899479887a5f04d65edbd6
2020-07-16 11:03:53 -07:00
Xiang Xiao ee875b2a26 boards: Move HOSTCC/HOSTCFLAGS to tools/Config.mk
Make.defs under board folder can still overwrite the default as needed

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1c300a8ace4b54d475ef8d398661ed65ca273a2e
2020-07-15 19:14:58 +01:00
Xiang Xiao d32e9c38df boards: Move the C/C++ search path to the common place
so all boards support uClibc++/libc++ automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ibe6fafbec57f7acb26ea6188a3e9923ea82295c5
2020-07-13 15:11:12 -03:00
Xiang Xiao 6abd03d53f libxx: Unify uClibc++ and libc++ config
code just need check CONFIG_CXX_EXCEPTION/CONFIG_CXX_LIBSUPCXX now,
instead uClibc++/libc++ specific config

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3b00a5a6701b8bf1c70de89f2d924592ca3e38b0
2020-07-13 15:08:13 -03:00
Dave Marples 3cbf6d58a5 Fix LCD pins to work correctly 2020-07-09 14:03:13 +01:00
Xiang Xiao 5da9cb3ae6 libxx: Eanble HAVE_CXXINITIALIZE automatically if LIBCXX or UCLIBCXX enable
otherwise the user is shocked that using cin/cout/cerr will crash the system

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I453427261f3e2a6e60f7dd2398f7d3bd1043a0d5
2020-07-09 13:19:54 +01:00
Xiang Xiao 49020acfdc boards: Remove the unused CONFIG_xxx_CXXINITIALIZE=y
since cxx initialization is controlled by CONFIG_HAVE_CXXINITIALIZE now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I39438dc3006d0a0b810052ecef50cd3c92f09d83
2020-07-01 10:41:37 -06:00
Xiang Xiao e9c7df4769 sched: Rename task_startup to nxtask_startup
to follow the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3594d12a65e8cacea99bc295d622628304c3f9f8
2020-07-01 07:55:33 -06:00
Xiang Xiao 7a18ebe459 drivers/led: Extend userled_set_t from 8bits to 32bits
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5701b42ff930998198b1d915316cc4f2d085d4eb
2020-06-07 19:28:10 +01:00
Xiang Xiao 76965474ac drivers/led: Let board_userled_initialize return the led number
so the lower half driver don't need include the specific board.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icf6638a6865bac42150b5957376e55909f041d40
2020-06-07 19:28:10 +01:00
Xiang Xiao 1b47aa1cb2 drivers/button: Let board_button_initialize return the button number
so the lower half driver don't need include the specific board.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2ff5c30049a5c5e8ee90baea56e9f4cb1a8a4f87
2020-06-07 19:28:10 +01:00
Gregory Nutt 1414c55c45 boards/arm: Leverage PR 1150 to other ARM Make.defs 2020-05-30 20:09:02 +01:00
Xiang Xiao e83c1400b6 build: Move BOARD_DIR definition to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao 7e5b0f81e9 build: Replace -I with INCDIR
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao 23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao 1caf21b187 build: Remove the unused BOARD_INCLUDE variable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao dd61d3d9f9 build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 18:00:40 +01:00
Xiang Xiao 1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Xiang Xiao 7faf3c0254 build: replace ${TOPDIR} with $(TOPDIR) in Makefile
make the usage consistence

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao 567962bd62 build: Move the extension definition to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao 8b42ee421a build: Move MKDEP definition to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao 9ec9431706 build: Move DIRLINK/DIRUNLINK definition to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao bd656888f2 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Nathan Hartman 8d985819b3 Fix typos
Comments only. No functional changes.
2020-05-14 10:49:44 -06:00
Gregory Nutt 037c9ea0a4 arch/arm: Rename all up_*.h files to arm_*.h
Summary

The naming standard at https://cwiki.apache.org/confluence/display/NUTTX/Naming+FAQ requires that all MCU-private files begin with the name of the architecture, not up_.

This PR addresses only these name changes for the up_*.h files.  There are only three, but almost 1680 files that include them:

    up_arch.h
    up_internal.h
    up_vfork.h

The only change to the files is from including up_arch.h to arm_arch.h (for example).

The entire job required to be compatible with that Naming Convention will also require changing the naming of the up_() functions that are used only within arch/arm and board/arm.

Impact

There should be not impact of this change (other that one step toward more consistent naming).

Testing

stm32f4discovery:netnsh
2020-05-01 03:43:44 +01:00
liuhaitao 459ad99373 Use EXTRAFLAGS instead of EXTRADEFINES to be used by make via command line
So call 'make EXTRAFLAGS=-Wno-cpp' could suppress the warnings with pre-processor
directive #warning in GCC.

Change-Id: Iaa618238924c9969bf91db22117b39e6d2fc9bb6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-11 08:31:08 -06:00
hartmannathan bfc153ca27
Fix typos in comments and documentation (#750)
* Fix typos in comments and documentation
2020-04-08 06:45:35 -06:00
YAMAMOTO Takashi 1ffa009c8b Revert "Don't generate .depend anymore"
This reverts commit 79af7fbf4e.

Because:

* btashton reported some issues in local builds:

  https://github.com/apache/incubator-nuttx/pull/603#issuecomment-602264860

* this might be related to the current CI breakage:

  > /bin/sh: 1: /__w/incubator-nuttx/incubator-nuttx/nuttx/tools/mkdeps: not found
2020-03-22 23:07:29 -05:00
Xiang Xiao 79af7fbf4e
Don't generate .depend anymore 2020-03-22 18:15:29 +00:00
Xiang Xiao cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Xiang Xiao bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Xiang Xiao a8de37fbec Ensure all source code end with one and only one newline
by this command:
git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
2020-02-08 07:25:56 -06:00
Xiang Xiao 68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Xiang Xiao 540e947c0c Run ./tools/refresh.sh --silent all 2020-01-22 20:47:18 -06:00
patacongo e507ca4696 imxrt1050-evk/include/board.h: Add missing definitions. Recent i.MXRT changes added the definition IMXRT_USB1_PLL_DIV_SELECT to the imxrt1020-evk and imxrt1060-evk board.h header files but NOT to the imxrt10%0-evk. As a result EVERY i.MXR 1050 board configuration with USB enabled failed to compile during build testing. Another day without a successfull build test 8( (#93) 2020-01-13 21:34:17 +01:00
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
David Sidrane 2cbcb8fd00 arch/arm/src/imxrt/imxrt_clockconfig.c and board.h: Allow clock setting for SPI and I2C from board.h. 2019-12-12 08:33:05 -06:00
Gregory Nutt 3e85a7e53d boards/arm/imxrt/imxrt10x0-evk/include/board.h and src/imxrt10x0-evk.h: Board internal GPIO definitions were erroneously moved to board.h in a previous comment. This restores them to where they belong in the private imxrt10x0-evk.h header file. 2019-12-08 08:02:31 -06:00
Dave Marples f410d9711a boards/arm/imxrt/imxrt10x0-evk/include/board.h: Set up TRACE clocking correctly. This also reverts 7dcd57aa4a. 2019-11-29 14:54:08 -06:00
Gregory Nutt 7dcd57aa4a boars/arm/imxrt/imxrt10x0-evk/include/board.h: Define IMXRT_TRACE_CLK_SELECT with arbitrary value just to get through build testing. 2019-11-28 11:18:42 -06:00
Gregory Nutt 5b47b535a0 boards/arm/imxrt/imxrt10*0-evk/include/board.h: Put all LCD definitions together. 2019-11-09 12:18:13 -06:00