You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/02/05 21:31:06 UTC
[incubator-nuttx] branch pr213 updated (a5bb9f7 -> 09e3b03)
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a change to branch pr213
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.
from a5bb9f7 boards: maix-bit: Adjust CONFIG_BOARD_LOOPSPERMSEC
new 95cc571 gs2200m: Add a config to set log level
new 09e3b03 gs2200m: Make CHECK_VERSION use Kconfig
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
drivers/wireless/Kconfig | 11 +++++++++++
drivers/wireless/gs2200m.c | 26 ++++++++++++++++++++++++--
2 files changed, 35 insertions(+), 2 deletions(-)
[incubator-nuttx] 01/02: gs2200m: Add a config to set log level
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch pr213
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 95cc571b4ec88b69f6d8be4a51e853a736626832
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Wed Feb 5 18:11:38 2020 +0900
gs2200m: Add a config to set log level
---
drivers/wireless/Kconfig | 7 +++++++
drivers/wireless/gs2200m.c | 22 ++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/drivers/wireless/Kconfig b/drivers/wireless/Kconfig
index 2490a40..c5582d1 100644
--- a/drivers/wireless/Kconfig
+++ b/drivers/wireless/Kconfig
@@ -40,6 +40,13 @@ config WL_GS2200M_DISABLE_DHCPC
bool "Disable the internal dhcp client"
default n
+config WL_GS2200M_LOGLEVEL
+ int "Log level"
+ default 0
+ range 0 2
+ ---help---
+ The debug level of GS2200M. (AT+LOGLVL)
+
endif
source drivers/wireless/spirit/Kconfig
diff --git a/drivers/wireless/gs2200m.c b/drivers/wireless/gs2200m.c
index 7c89ea21..3cddb53 100644
--- a/drivers/wireless/gs2200m.c
+++ b/drivers/wireless/gs2200m.c
@@ -1967,6 +1967,22 @@ static enum pkt_type_e gs2200m_set_gpio(FAR struct gs2200m_dev_s *dev,
#endif
/****************************************************************************
+ * Name: gs2200m_set_loglevel
+ * NOTE: See 11.3.1 Log Level
+ ****************************************************************************/
+
+#if CONFIG_WL_GS2200M_LOGLEVEL > 0
+static enum pkt_type_e gs2200m_set_loglevel(FAR struct gs2200m_dev_s *dev,
+ int level)
+{
+ char cmd[16];
+
+ snprintf(cmd, sizeof(cmd), "AT+LOGLVL=%d\r\n", level);
+ return gs2200m_send_cmd(dev, cmd, NULL);
+}
+#endif
+
+/****************************************************************************
* Name: gs2200m_get_version
****************************************************************************/
@@ -2875,6 +2891,12 @@ static int gs2200m_start(FAR struct gs2200m_dev_s *dev)
t = gs2200m_enable_echo(dev, 0);
ASSERT(TYPE_OK == t);
+#if CONFIG_WL_GS2200M_LOGLEVEL > 0
+ /* Set log level */
+ t = gs2200m_set_loglevel(dev, CONFIG_WL_GS2200M_LOGLEVEL);
+ ASSERT(TYPE_OK == t);
+#endif
+
#ifdef CHECK_VERSION
/* Version */
[incubator-nuttx] 02/02: gs2200m: Make CHECK_VERSION use Kconfig
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch pr213
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 09e3b0342430ebe7bbebe6280c228101c452e86b
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Wed Feb 5 18:31:56 2020 +0900
gs2200m: Make CHECK_VERSION use Kconfig
---
drivers/wireless/Kconfig | 4 ++++
drivers/wireless/gs2200m.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/wireless/Kconfig b/drivers/wireless/Kconfig
index c5582d1..299b664 100644
--- a/drivers/wireless/Kconfig
+++ b/drivers/wireless/Kconfig
@@ -40,6 +40,10 @@ config WL_GS2200M_DISABLE_DHCPC
bool "Disable the internal dhcp client"
default n
+config WL_GS2200M_CHECK_VERSION
+ bool "Check the version of GS2200M"
+ default n
+
config WL_GS2200M_LOGLEVEL
int "Log level"
default 0
diff --git a/drivers/wireless/gs2200m.c b/drivers/wireless/gs2200m.c
index 3cddb53..297d925 100644
--- a/drivers/wireless/gs2200m.c
+++ b/drivers/wireless/gs2200m.c
@@ -1986,7 +1986,7 @@ static enum pkt_type_e gs2200m_set_loglevel(FAR struct gs2200m_dev_s *dev,
* Name: gs2200m_get_version
****************************************************************************/
-#ifdef CHECK_VERSION
+#ifdef CONFIG_WL_GS2200M_CHECK_VERSION
static enum pkt_type_e gs2200m_get_version(FAR struct gs2200m_dev_s *dev)
{
char cmd[16];
@@ -2897,7 +2897,7 @@ static int gs2200m_start(FAR struct gs2200m_dev_s *dev)
ASSERT(TYPE_OK == t);
#endif
-#ifdef CHECK_VERSION
+#ifdef CONFIG_WL_GS2200M_CHECK_VERSION
/* Version */
t = gs2200m_get_version(dev);