Commit Graph

37 Commits

Author SHA1 Message Date
raiden00pl 5b87fdfb9d Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
xuxin19 b3678b1454 cmake:support nxlib cmake compilation
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-10 23:18:56 +08:00
Xiang Xiao abfe082a6f Kconfig: Simplify the conditional default statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:39:20 -03:00
chao an 6ee9ec7656 build: add initial cmake build system
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)

------------------

How to test

From within nuttx/. Configure:

cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja

(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja

This uses ninja generator (install with sudo apt install ninja-build). To build:

$ cmake --build build

menuconfig:

$ cmake --build build -t menuconfig

--------------------------

2. cmake/build: reformat the cmake style by cmake-format

https://github.com/cheshirekow/cmake_format

$ pip install cmakelang

$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done

Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:50:48 +08:00
Xiang Xiao 7990f90915 Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 09:52:08 -03:00
anjiahao d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Nathan Hartman 849f760b77 Fix various typos 2022-07-08 02:15:54 +08:00
Petro Karashchenko 8d3bf05fd2 include: fix double include pre-processor guards
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-16 11:11:14 -03:00
SPRESENSE f75437d3f3 libs: libnx: nxfonts: Fix prefix of generated fonts data
This commit fixes a compile error caused by the following commit.
fe9ccff libs: libnx: nxfonts: fix Mixed case identifier
Change the prefix of generated font data to lower case.
2021-07-03 23:14:19 -05:00
Nathan Hartman 8af9d39667 Documentation, comments: Minor improvements and typos fixed 2021-05-09 19:12:13 -07:00
Alin Jerpelea 7c8c6785ca NuttX: NX Engineering, S.A: update licenses to Apache
NX Engineering, S.A has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-05 06:07:48 -05:00
Alin Jerpelea 0f41c3c555 NuttX: Pierre-Noel Bouteville: update licenses to Apache
Pierre-Noel Bouteville has submitted the ICLA and we can migrate the licenses
 to Apache.

David Sidrane has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-01 12:13:12 -05:00
Alin Jerpelea ce28c6c06c libs: Alan Carvalho de Assis: update licenses to Apache
Alan Carvalho de Assis has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-13 05:56:43 -08:00
Gustavo Henrique Nihei 330eff36d7 sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Alin Jerpelea 561428fb84 libs: nxstyle fixes
nxstyle fixes to pass the CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-25 01:44:30 -08:00
Alin Jerpelea 88fa869a04 libnx: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-25 01:44:30 -08:00
Alin Jerpelea fe9ccffe2b libs: libnx: nxfonts: fix Mixed case identifier
Fix Mixed case identifier to pass nxstyle CI check

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-25 01:44:30 -08:00
YAMAMOTO Takashi a2a30c8813 libs/libnx/nxfonts/nxfonts_cache.c: Fix syslog formats
Note: the width of nxgl_mxpixel_t depends on configuration.
2020-11-27 05:18:57 -06:00
YAMAMOTO Takashi 8a70c6bf47 libs/libnx/nxfonts/nxfonts_cache.c: Fix syslog formats 2020-11-20 22:22:53 -08:00
Matias N 166242c171 use "export" to expose TOPDIR to all child make instead of passing it around every time 2020-09-15 21:11:33 -07: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
liuhaitao 23389215bb libnx/nxfonts: change the generated file nxfonts_tom-thumb-4x6.c to nxfonts_bitmap_tom-thumb-4x6.c
Align the generated files name, so make distclean could also remove all nxfonts_bitmaps_*.c files, no
need to add one more extra DELFILE for nxfonts_tom-thumb-4x6.c.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-28 21:28:15 -07:00
Gregory Nutt 759d8c1bfa Run nxstyle against files modified in previous commit. 2020-04-13 02:09:34 +08:00
Gregory Nutt ca2b0a3657 Fix more warnings noted in PR checks
arp/arp_notify.c:132:43: warning: for loop has empty body [-Wempty-body]
           prev = curr, curr = curr->nt_flink);
                                              ^

    sixlowpan/sixlowpan_tcpsend.c:806:31: warning: implicit conversion from 'unsigned int' to 'uint16_t' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Wconstant-conversion]
                                  _SO_TIMEOUT(psock->s_sndtimeo));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Numerous warnings like:

    ieee802154_getreq.c:93:3: warning: implicit declaration of function 'memcpy' is invalid in C99 [-Wimplicit-function-declaration]
      IEEE802154_EADDRCOPY(eaddr, req.attrval.mac.eaddr);
      ^

    nxfonts/nxfonts_cache.c:839:35: warning: for loop has empty body [-Wempty-body]
               fcache = fcache->flink);

    bluetooth/bluetooth_finddev.c💯11: warning: implicit declaration of function 'memcmp' is invalid in C99 [-Wimplicit-function-declaration]
          if (BLUETOOTH_ADDRCMP(dev->d_mac.radio.nv_addr, match->bf_addr))
              ^

    rwbuffer.c:559:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (rwb->rhmaxblocks > 0 && rwb->rhnblocks > 0)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-04-13 02:09:34 +08: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
Xiang Xiao bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Xiang Xiao 5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -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 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
Nathan Hartman 46aaec7ba0 Fix minor typos in docs and comments. 2019-09-29 12:52:20 -06:00
Gregory Nutt 1f22ebfac3 libs/libnx/nxfonts: Fix a memory leak in the font cache. With a busy NxTerm display, this could drain off all the memory pretty quickly! 2019-03-08 11:52:49 -06:00
Gregory Nutt aefacb05ca Minor NxTerm-related clean-up 2019-03-08 08:43:16 -06:00
Petteri Aimonen fe0532c226 Merged in paimonen/nuttx/pullreq_libc_libnx_updates (pull request #757)
Pullreq libc libnx updates

* NuttX: make strerror() return 'Success' for 0

* NuttX: fix strrchr() so that it considers null terminator as part of string

    From strrchr(3) man page:
    "The terminating null byte is considered part of the string, so that if c
    is specified as '\0', these functions return a pointer to the terminator."

* NuttX: mm_free(): Add DEBUGASSERT()'s to catch memory corruption early.

    It's easier to find the source when asserts fail already when freeing
    an overflowed buffer, than if the corruption is only detected on next
    malloc().

* MM_FILL_ALLOCATIONS: Add debug option to fill all mallocs()

    This is helpful for detecting uninitialized variables,
    especially in C++ code. I seem to be forgetting to initialize
    member variables and then they just get random values..

* NuttX: nxtk_bitmapwindow: Fix warning message when bitmap is fully off-screen.

* nxfonts_getfont: Avoid unnecessary warnings for other whitespace chars also.

* NuttX: Fix kerning of 'I' in Sans17x22 font

    The I character was running together with some other
    characters, e.g. in sequence "IMI".

* NXMU: Revalidate window pointer for mouse events.

    NXMU caches the previous window pointer so that further mouse
    events can be sent to the same window. However, if the window
    is destroyed while mouse button is held down, the pointer may
    become invalid and cause a crash. This patch revalidates the
    pointer before using it.

Approved-by: GregoryN <gnutt@nuttx.org>
2018-11-12 15:36:35 +00:00
Xiang Xiao e1202d2ed3 Replace all ASSERT with DEBUGASSERT to save the code space 2018-08-24 06:58:30 -06:00
Xiang Xiao 467d2a58ea Replace non critical PANIC with DEBUGPANIC to save the code space 2018-08-24 06:21:15 -06:00
Gregory Nutt cf99fb40c9 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now.
Squashed commit of the following:

    libs/libxx:  Fix some confusing in naming.  If the directory is called libxx, then the library must be libxx.a (unless perhaps LIBCXX is selected).
    libs/:  Fix paths in moved library directories.
    libs:  Brute force move of libc, libnx, and libxx to libs.  Cannot yet build it in that configuration.
2018-05-29 13:21:26 -06:00