vrahane commented on a change in pull request #630: LP5523: LED Driver
URL: https://github.com/apache/mynewt-core/pull/630#discussion_r146365301
 
 

 ##########
 File path: hw/drivers/lp5523/src/lp5523_shell.c
 ##########
 @@ -0,0 +1,1017 @@
+/*
+ * 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 <string.h>
+#include <errno.h>
+#include "sysinit/sysinit.h"
+#include "console/console.h"
+#include "shell/shell.h"
+#include "hal/hal_gpio.h"
+#include "lp5523/lp5523.h"
+#include "parse/parse.h"
+
+#if MYNEWT_VAL(LP5523_CLI)
+
+static int lp5523_shell_cmd(int argc, char **argv);
+
+static struct shell_cmd lp5523_shell_cmd_struct = {
+    .sc_cmd = "lp5523",
+    .sc_cmd_func = lp5523_shell_cmd
+};
+
+static struct sensor_itf *lp5523_itf;
 
 Review comment:
   The suggestion is great and probably we want to able to do that at some 
point but sensor device shell can't really be initialized using sysinit. Reason 
is we we cannot specify arguments in sysinit and that extent of code generation 
is not our intent. Also, we want the app to initialize the shell only for one 
instance of the sensor and it's only for experimentation purposes. It is not 
going to be present in most products.
   so, the expected flow of development would be:
   - Bring up one sensor using the driver
   - Use the shell to talk to it and experiment
   - Test all sensor features
   - Once tested, plug it into the sensor framework
   - Test the sensor using the sensor shell. 
   - If you see the data coming out as expected, the driver is good.
   The shell is optional and it is not needed most of the times.
   Hope I answered your question.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to