You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2015/11/19 03:02:45 UTC
[3/4] incubator-mynewt-larva git commit: Parse command line args for
blinky too.
Parse command line args for blinky too.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/1fbd70ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/1fbd70ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/1fbd70ee
Branch: refs/heads/master
Commit: 1fbd70ee7f4257a9d6a27454500e70110736016f
Parents: 36edded
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Nov 18 17:59:17 2015 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Wed Nov 18 17:59:17 2015 -0800
----------------------------------------------------------------------
project/blinky/src/main.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/1fbd70ee/project/blinky/src/main.c
----------------------------------------------------------------------
diff --git a/project/blinky/src/main.c b/project/blinky/src/main.c
index 9296193..0ca3998 100755
--- a/project/blinky/src/main.c
+++ b/project/blinky/src/main.c
@@ -16,12 +16,15 @@
#include "os/os.h"
#include "bsp/bsp.h"
#include "hal/hal_gpio.h"
-#include "console/console.h"
+#include "console/console.h"
#include "shell/shell.h"
#include "util/log.h"
-#include "util/stats.h"
+#include "util/stats.h"
#include <assert.h>
#include <string.h>
+#ifdef ARCH_sim
+#include <mcu/mcu_sim.h>
+#endif
/* Init all tasks */
volatile int tasks_initialized;
@@ -135,11 +138,15 @@ init_tasks(void)
* @return int NOTE: this function should never return!
*/
int
-main(void)
+main(int argc, char **argv)
{
uint8_t entry[128];
int rc;
+#ifdef ARCH_sim
+ mcu_sim_parse_args(argc, argv);
+#endif
+
cbmem_init(&log_mem, log_buf, sizeof(log_buf));
util_log_cbmem_handler_init(&log_mem_handler, &log_mem);
util_log_register("log", &my_log, &log_mem_handler);