You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "kasjer (via GitHub)" <gi...@apache.org> on 2025/11/02 10:54:15 UTC

[PR] hal/shell: Add shell commands for hal [mynewt-core]

kasjer opened a new pull request, #3531:
URL: https://github.com/apache/mynewt-core/pull/3531

   This adds few commands to shell to manipulate
   gpio and nvregs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] hal/shell: Add shell commands for hal [mynewt-core]

Posted by "kasjer (via GitHub)" <gi...@apache.org>.
kasjer merged PR #3531:
URL: https://github.com/apache/mynewt-core/pull/3531


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] hal/shell: Add shell commands for hal [mynewt-core]

Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc commented on code in PR #3531:
URL: https://github.com/apache/mynewt-core/pull/3531#discussion_r2536722476


##########
hw/hal/shell_cmds/src/hal_shell_cmds.c:
##########
@@ -0,0 +1,153 @@
+/*
+ * 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.
+ */
+
+#include <errno.h>
+#include <string.h>
+#include <os/mynewt.h>
+#include <console/console.h>
+#include <shell/shell.h>
+#include <parse/parse.h>
+#include <hal/hal_gpio.h>
+#include <hal/hal_nvreg.h>
+
+int
+nvreg_dump_func(const struct shell_cmd *cmd, int argc, char *argv[],
+                struct streamer *streamer)
+{
+    int i;
+    uint32_t val;
+    int n = hal_nvreg_get_num_regs();
+
+    for (i = 0; i < n; ++i) {
+        val = hal_nvreg_read(i);
+        streamer_printf(streamer, "reg[%d] = %" PRIu32 " (0x%" PRIX32 ")\n", i,

Review Comment:
   similar print was discussed in other PRs and consensus was to use PRI macros only for 64bit values, while smaller types should simply be casted to (int) or (unsigned int)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] hal/shell: Add shell commands for hal [mynewt-core]

Posted by "kasjer (via GitHub)" <gi...@apache.org>.
kasjer commented on code in PR #3531:
URL: https://github.com/apache/mynewt-core/pull/3531#discussion_r2539495764


##########
hw/hal/shell_cmds/src/hal_shell_cmds.c:
##########
@@ -0,0 +1,153 @@
+/*
+ * 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.
+ */
+
+#include <errno.h>
+#include <string.h>
+#include <os/mynewt.h>
+#include <console/console.h>
+#include <shell/shell.h>
+#include <parse/parse.h>
+#include <hal/hal_gpio.h>
+#include <hal/hal_nvreg.h>
+
+int
+nvreg_dump_func(const struct shell_cmd *cmd, int argc, char *argv[],
+                struct streamer *streamer)
+{
+    int i;
+    uint32_t val;
+    int n = hal_nvreg_get_num_regs();
+
+    for (i = 0; i < n; ++i) {
+        val = hal_nvreg_read(i);
+        streamer_printf(streamer, "reg[%d] = %" PRIu32 " (0x%" PRIX32 ")\n", i,

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org