summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/namedapp/exec_namedapp.c48
-rw-r--r--apps/namedapp/namedapp.h4
-rw-r--r--nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h18
3 files changed, 51 insertions, 19 deletions
diff --git a/apps/namedapp/exec_namedapp.c b/apps/namedapp/exec_namedapp.c
index dd0f0b84f..75e5b83d0 100644
--- a/apps/namedapp/exec_namedapp.c
+++ b/apps/namedapp/exec_namedapp.c
@@ -4,6 +4,11 @@
* Copyright (C) 2011 Uros Platise. All rights reserved.
* Author: Uros Platise <uros.platise@isotel.eu>
*
+ * With updates, modifications, and general maintenance by:
+ *
+ * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Auther: Gregory Nutt <gnutt@nuttx.org>
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -66,16 +71,34 @@
* Public Functions
****************************************************************************/
+/****************************************************************************
+ * Name: namedapp_getname
+ *
+ * Description:
+ * Return the name of the application at index in the table of named
+ * applications.
+ *
+ ****************************************************************************/
+
const char *namedapp_getname(int index)
{
if (index < 0 || index >= number_namedapps())
{
- return NULL;
+ return NULL;
}
-
+
return namedapps[index].name;
}
+/****************************************************************************
+ * Name: namedapp_isavail
+ *
+ * Description:
+ * Return the index into the table of applications for the applicaiton with
+ * the name 'appname'.
+ *
+ ****************************************************************************/
+
int namedapp_isavail(FAR const char *appname)
{
int i;
@@ -92,6 +115,15 @@ int namedapp_isavail(FAR const char *appname)
return ERROR;
}
+/****************************************************************************
+ * Name: namedapp_isavail
+ *
+ * Description:
+ * Execute the application with name 'appname', providing the arguments
+ * in the argv[] array.
+ *
+ ****************************************************************************/
+
int exec_namedapp(FAR const char *appname, FAR const char **argv)
{
int i;
@@ -100,21 +132,21 @@ int exec_namedapp(FAR const char *appname, FAR const char **argv)
{
#ifndef CONFIG_CUSTOM_STACK
i = task_create(namedapps[i].name, namedapps[i].priority,
- namedapps[i].stacksize, namedapps[i].main,
- (argv) ? &argv[1] : (const char **)NULL);
+ namedapps[i].stacksize, namedapps[i].main,
+ (argv) ? &argv[1] : (const char **)NULL);
#else
i = task_create(namedapps[i].name, namedapps[i].priority, namedapps[i].main,
- (argv) ? &argv[1] : (const char **)NULL);
+ (argv) ? &argv[1] : (const char **)NULL);
#endif
#if CONFIG_RR_INTERVAL > 0
if (i > 0)
{
struct sched_param param;
-
+
sched_getparam(0, &param);
- sched_setscheduler(i, SCHED_RR, &param);
- }
+ sched_setscheduler(i, SCHED_RR, &param);
+ }
#endif
}
diff --git a/apps/namedapp/namedapp.h b/apps/namedapp/namedapp.h
index 88fa7f36a..7fcdf42dc 100644
--- a/apps/namedapp/namedapp.h
+++ b/apps/namedapp/namedapp.h
@@ -2,9 +2,9 @@
* apps/namedaps/namedapp.h
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Authors: Uros Platise <uros.platise@isotel.eu>
- * Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h b/nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h
index 29d58d061..293f838e9 100644
--- a/nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h
+++ b/nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h
@@ -71,15 +71,15 @@
#define PINCONF_FUNC_SHIFT (16) /* Bits 16-18: Alternate function number */
#define PINCONF_FUNC_MASK (7 << PINCONF_FUNC_SHIFT)
-# define PINCONF_FUNC(n) (0 << PINCONF_FUNC_SHIFT)
-# define PINCONF_FUNC0 (1 << PINCONF_FUNC_SHIFT)
-# define PINCONF_FUNC1 (2 << PINCONF_FUNC_SHIFT)
-# define PINCONF_FUNC2 (3 << PINCONF_FUNC_SHIFT)
-# define PINCONF_FUNC3 (4 << PINCONF_FUNC_SHIFT)
-# define PINCONF_FUNC4 (5 << PINCONF_FUNC_SHIFT)
-# define PINCONF_FUNC5 (6 << PINCONF_FUNC_SHIFT)
-# define PINCONF_FUNC6 (7 << PINCONF_FUNC_SHIFT)
-# define PINCONF_FUNC7 (8 << PINCONF_FUNC_SHIFT)
+# define PINCONF_FUNC(n) ((n) << PINCONF_FUNC_SHIFT)
+# define PINCONF_FUNC0 (0 << PINCONF_FUNC_SHIFT)
+# define PINCONF_FUNC1 (1 << PINCONF_FUNC_SHIFT)
+# define PINCONF_FUNC2 (2 << PINCONF_FUNC_SHIFT)
+# define PINCONF_FUNC3 (3 << PINCONF_FUNC_SHIFT)
+# define PINCONF_FUNC4 (4 << PINCONF_FUNC_SHIFT)
+# define PINCONF_FUNC5 (5 << PINCONF_FUNC_SHIFT)
+# define PINCONF_FUNC6 (6 << PINCONF_FUNC_SHIFT)
+# define PINCONF_FUNC7 (7 << PINCONF_FUNC_SHIFT)
/* Pull-up/down resisters. These selections are available for all pins but may not
* make sense for all pins. NOTE: that both pull up and down is not precluded.