You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/07/14 14:04:41 UTC

[nuttx-apps] branch master updated: cmake: port nxscope and foc and add missing directories

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new ed370ec67 cmake: port nxscope and foc and add missing directories
ed370ec67 is described below

commit ed370ec6740f6c3744c355cff37fb960a0c3d1cb
Author: raiden00pl <ra...@railab.me>
AuthorDate: Fri Jul 14 12:33:49 2023 +0200

    cmake: port nxscope and foc and add missing directories
---
 CMakeLists.txt                                |   4 +
 {industry => benchmarks}/CMakeLists.txt       |   6 +-
 examples/foc/CMakeLists.txt                   |  62 ++++++++++
 examples/nxscope/CMakeLists.txt               |  31 +++++
 industry/CMakeLists.txt                       |   2 +
 industry/foc/CMakeLists.txt                   | 156 ++++++++++++++++++++++++++
 {industry => logging}/CMakeLists.txt          |   6 +-
 {industry => logging/embedlog}/CMakeLists.txt |   4 +-
 {industry => logging/nxscope}/CMakeLists.txt  |  20 +++-
 {industry => lte}/CMakeLists.txt              |   6 +-
 {industry => sdr}/CMakeLists.txt              |   6 +-
 11 files changed, 291 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2b54a3fcb..ead8b8bc9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,7 @@ include_directories(include)
 include_directories(${NUTTX_APPS_BINDIR}/include)
 
 add_subdirectory(audioutils)
+add_subdirectory(benchmarks)
 add_subdirectory(boot)
 add_subdirectory(canutils)
 add_subdirectory(crypto)
@@ -49,12 +50,15 @@ add_subdirectory(gpsutils)
 add_subdirectory(graphics)
 add_subdirectory(industry)
 add_subdirectory(interpreters)
+add_subdirectory(logging)
+add_subdirectory(lte)
 add_subdirectory(math)
 add_subdirectory(mlearning)
 add_subdirectory(modbus)
 add_subdirectory(netutils)
 add_subdirectory(nshlib)
 add_subdirectory(platform)
+add_subdirectory(sdr)
 add_subdirectory(system)
 add_subdirectory(testing)
 add_subdirectory(wireless)
diff --git a/industry/CMakeLists.txt b/benchmarks/CMakeLists.txt
similarity index 88%
copy from industry/CMakeLists.txt
copy to benchmarks/CMakeLists.txt
index 695c6dd3f..3954bb7c1 100644
--- a/industry/CMakeLists.txt
+++ b/benchmarks/CMakeLists.txt
@@ -1,5 +1,5 @@
 # ##############################################################################
-# apps/industry/CMakeLists.txt
+# apps/benchmarks/CMakeLists.txt
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more contributor
 # license agreements.  See the NOTICE file distributed with this work for
@@ -18,4 +18,6 @@
 #
 # ##############################################################################
 
-nuttx_generate_kconfig(MENUDESC "Industrial Applications")
+nuttx_add_subdirectory()
+
+nuttx_generate_kconfig(MENUDESC "Benchmark Applications")
diff --git a/examples/foc/CMakeLists.txt b/examples/foc/CMakeLists.txt
new file mode 100644
index 000000000..6ef888605
--- /dev/null
+++ b/examples/foc/CMakeLists.txt
@@ -0,0 +1,62 @@
+############################################################################
+# apps/examples/foc/CMakeLists.txt
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+if(CONFIG_EXAMPLES_FOC)
+  nuttx_add_application(
+    NAME
+    foc
+    SRCS
+    foc_main.c
+    STACKSIZE
+    ${CONFIG_EXAMPLES_FOC_STACKSIZE}
+    PRIORITY
+    ${CONFIG_EXAMPLES_FOC_PRIORITY})
+
+set(CSRCS
+  foc_device.c
+  foc_mq.c
+  foc_thr.c
+  foc_intf.c)
+
+if(CONFIG_BUILTIN)
+  list(APPEND CSRCS foc_parseargs.c)
+endif()
+
+# fixed16 support
+
+if(CONFIG_INDUSTRY_FOC_FIXED16)
+  list(APPEND CSRCS foc_fixed16_thr.c foc_motor_b16.c)
+endif()
+
+# float32 support
+
+if(CONFIG_INDUSTRY_FOC_FLOAT)
+  list(APPEND CSRCS foc_float_thr.c foc_motor_f32.c)
+endif()
+
+# NxScope support
+
+if(CONFIG_EXAMPLES_FOC_NXSCOPE)
+  list(APPEND CSRCS foc_nxscope.c)
+endif()
+
+target_sources(apps PRIVATE ${CSRCS})
+
+endif()
diff --git a/examples/nxscope/CMakeLists.txt b/examples/nxscope/CMakeLists.txt
new file mode 100644
index 000000000..56e19d76c
--- /dev/null
+++ b/examples/nxscope/CMakeLists.txt
@@ -0,0 +1,31 @@
+############################################################################
+# apps/examples/nxscope/CMakeLists.txt
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+if(CONFIG_EXAMPLES_NXSCOPE)
+  nuttx_add_application(
+    NAME
+    ${CONFIG_EXAMPLES_NXSCOPE_PROGNAME}
+    SRCS
+    nxscope_main.c
+    STACKSIZE
+    ${CONFIG_EXAMPLES_NXSCOPE_STACKSIZE}
+    PRIORITY
+    ${CONFIG_EXAMPLES_NXSCOPE_PRIORITY})
+endif()
diff --git a/industry/CMakeLists.txt b/industry/CMakeLists.txt
index 695c6dd3f..6d64c3272 100644
--- a/industry/CMakeLists.txt
+++ b/industry/CMakeLists.txt
@@ -18,4 +18,6 @@
 #
 # ##############################################################################
 
+nuttx_add_subdirectory()
+
 nuttx_generate_kconfig(MENUDESC "Industrial Applications")
diff --git a/industry/foc/CMakeLists.txt b/industry/foc/CMakeLists.txt
new file mode 100644
index 000000000..3d5402dca
--- /dev/null
+++ b/industry/foc/CMakeLists.txt
@@ -0,0 +1,156 @@
+# ##############################################################################
+# apps/industry/foc/CMakeLists.txt
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership.  The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License.  You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations under
+# the License.
+#
+# ##############################################################################
+
+if(CONFIG_INDUSTRY_FOC)
+
+  set(CSRCS foc_utils.c)
+
+  if(CONFIG_INDUSTRY_FOC_FLOAT)
+    list(APPEND CSRCS
+      float/foc_ramp.c
+      float/foc_handler.c
+      float/foc_angle.c
+      float/foc_velocity.c
+      float/foc_routine.c)
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_OPENLOOP)
+      list(APPEND CSRCS float/foc_ang_openloop.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_ONFO)
+      list(APPEND CSRCS float/foc_ang_onfo.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_OSMO)
+      list(APPEND CSRCS float/foc_ang_osmo.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_QENCO)
+      list(APPEND CSRCS float/foc_ang_qenco.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_HALL)
+      list(APPEND CSRCS float/foc_ang_hall.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_CORDIC)
+      list(APPEND CSRCS float/foc_cordic.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_CONTROL_PI)
+      list(APPEND CSRCS float/foc_picontrol.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_MODULATION_SVM3)
+      list(APPEND CSRCS float/foc_svm3.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_HAVE_MODEL)
+      list(APPEND CSRCS float/foc_model.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_MODEL_PMSM)
+      list(APPEND CSRCS float/foc_model_pmsm.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ALIGN)
+      list(APPEND CSRCS float/foc_align.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_IDENT)
+      list(APPEND CSRCS float/foc_ident.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_VELOCITY_ODIV)
+      list(APPEND CSRCS float/foc_vel_odiv.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_VELOCITY_OPLL)
+      list(APPEND CSRCS float/foc_vel_opll.c)
+    endif()
+  endif()
+
+  if(CONFIG_INDUSTRY_FOC_FIXED16)
+    list(APPEND CSRCS
+      fixed16/foc_ramp.c
+      fixed16/foc_handler.c
+      fixed16/foc_angle.c
+      fixed16/foc_velocity.c
+      fixed16/foc_routine.c)
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_OPENLOOP)
+      list(APPEND CSRCS fixed16/foc_ang_openloop.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_ONFO)
+      list(APPEND CSRCS fixed16/foc_ang_onfo.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_OSMO)
+      list(APPEND CSRCS fixed16/foc_ang_osmo.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_QENCO)
+      list(APPEND CSRCS fixed16/foc_ang_qenco.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ANGLE_HALL)
+      list(APPEND CSRCS fixed16/foc_ang_hall.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_CORDIC)
+      list(APPEND CSRCS fixed16/foc_cordic.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_CONTROL_PI)
+      list(APPEND CSRCS fixed16/foc_picontrol.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_MODULATION_SVM3)
+      list(APPEND CSRCS fixed16/foc_svm3.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_HAVE_MODEL)
+      list(APPEND CSRCS fixed16/foc_model.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_MODEL_PMSM)
+      list(APPEND CSRCS fixed16/foc_model_pmsm.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_ALIGN)
+      list(APPEND CSRCS fixed16/foc_align.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_IDENT)
+      list(APPEND CSRCS fixed16/foc_ident.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_VELOCITY_ODIV)
+      list(APPEND CSRCS fixed16/foc_vel_odiv.c)
+    endif()
+
+    if(CONFIG_INDUSTRY_FOC_VELOCITY_OPLL)
+      list(APPEND CSRCS fixed16/foc_vel_opll.c)
+    endif()
+  endif()
+
+  target_sources(apps PRIVATE ${CSRCS})
+endif()
diff --git a/industry/CMakeLists.txt b/logging/CMakeLists.txt
similarity index 89%
copy from industry/CMakeLists.txt
copy to logging/CMakeLists.txt
index 695c6dd3f..4591b75c4 100644
--- a/industry/CMakeLists.txt
+++ b/logging/CMakeLists.txt
@@ -1,5 +1,5 @@
 # ##############################################################################
-# apps/industry/CMakeLists.txt
+# apps/logging/CMakeLists.txt
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more contributor
 # license agreements.  See the NOTICE file distributed with this work for
@@ -18,4 +18,6 @@
 #
 # ##############################################################################
 
-nuttx_generate_kconfig(MENUDESC "Industrial Applications")
+nuttx_add_subdirectory()
+
+nuttx_generate_kconfig(MENUDESC "Logging Utilities")
diff --git a/industry/CMakeLists.txt b/logging/embedlog/CMakeLists.txt
similarity index 91%
copy from industry/CMakeLists.txt
copy to logging/embedlog/CMakeLists.txt
index 695c6dd3f..edef25f12 100644
--- a/industry/CMakeLists.txt
+++ b/logging/embedlog/CMakeLists.txt
@@ -1,5 +1,5 @@
 # ##############################################################################
-# apps/industry/CMakeLists.txt
+# apps/logging/embedlog/CMakeLists.txt
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more contributor
 # license agreements.  See the NOTICE file distributed with this work for
@@ -18,4 +18,4 @@
 #
 # ##############################################################################
 
-nuttx_generate_kconfig(MENUDESC "Industrial Applications")
+# TODO
diff --git a/industry/CMakeLists.txt b/logging/nxscope/CMakeLists.txt
similarity index 68%
copy from industry/CMakeLists.txt
copy to logging/nxscope/CMakeLists.txt
index 695c6dd3f..7a277e6a8 100644
--- a/industry/CMakeLists.txt
+++ b/logging/nxscope/CMakeLists.txt
@@ -1,5 +1,5 @@
 # ##############################################################################
-# apps/industry/CMakeLists.txt
+# apps/logging/nxscope/CMakeLists.txt
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more contributor
 # license agreements.  See the NOTICE file distributed with this work for
@@ -18,4 +18,20 @@
 #
 # ##############################################################################
 
-nuttx_generate_kconfig(MENUDESC "Industrial Applications")
+if(CONFIG_LOGGING_NXSCOPE)
+  set(CSRCS nxscope.c nxscope_chan.c nxscope_internals.c)
+
+  if(CONFIG_LOGGING_NXSCOPE_INTF_SERIAL)
+    list(APPEND CSRCS nxscope_iser.c)
+  endif()
+
+  if(CONFIG_LOGGING_NXSCOPE_INTF_DUMMY)
+    list(APPEND CSRCS nxscope_idummy.c)
+  endif()
+
+  if(CONFIG_LOGGING_NXSCOPE_PROTO_SER)
+    list(APPEND CSRCS nxscope_pser.c)
+  endif()
+
+  target_sources(apps PRIVATE ${CSRCS})
+endif()
diff --git a/industry/CMakeLists.txt b/lte/CMakeLists.txt
similarity index 88%
copy from industry/CMakeLists.txt
copy to lte/CMakeLists.txt
index 695c6dd3f..01e72ea15 100644
--- a/industry/CMakeLists.txt
+++ b/lte/CMakeLists.txt
@@ -1,5 +1,5 @@
 # ##############################################################################
-# apps/industry/CMakeLists.txt
+# apps/lte/CMakeLists.txt
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more contributor
 # license agreements.  See the NOTICE file distributed with this work for
@@ -18,4 +18,6 @@
 #
 # ##############################################################################
 
-nuttx_generate_kconfig(MENUDESC "Industrial Applications")
+nuttx_add_subdirectory()
+
+nuttx_generate_kconfig(MENUDESC "LTE Libraries and NSH Add-Ons")
diff --git a/industry/CMakeLists.txt b/sdr/CMakeLists.txt
similarity index 88%
copy from industry/CMakeLists.txt
copy to sdr/CMakeLists.txt
index 695c6dd3f..24eaf34d7 100644
--- a/industry/CMakeLists.txt
+++ b/sdr/CMakeLists.txt
@@ -1,5 +1,5 @@
 # ##############################################################################
-# apps/industry/CMakeLists.txt
+# apps/sdr/CMakeLists.txt
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more contributor
 # license agreements.  See the NOTICE file distributed with this work for
@@ -18,4 +18,6 @@
 #
 # ##############################################################################
 
-nuttx_generate_kconfig(MENUDESC "Industrial Applications")
+nuttx_add_subdirectory()
+
+nuttx_generate_kconfig(MENUDESC "Software Define Radio Libraries")