summaryrefslogtreecommitdiff
path: root/nuttx/examples
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-13 15:13:37 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-13 15:13:37 +0000
commitc37fdc28c2cfdf41a549ba245c1cad85b757e53a (patch)
tree2812daa6196bae9eb0a4233aa1b28f6eb7902c44 /nuttx/examples
parenta3933a716fd10ac4c87089ce7fac43ee24b3a2d4 (diff)
downloadpx4-nuttx-c37fdc28c2cfdf41a549ba245c1cad85b757e53a.tar.gz
px4-nuttx-c37fdc28c2cfdf41a549ba245c1cad85b757e53a.tar.bz2
px4-nuttx-c37fdc28c2cfdf41a549ba245c1cad85b757e53a.zip
Eliminate some hcs12 compile errors/warnings
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2329 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples')
-rw-r--r--nuttx/examples/ostest/barrier.c8
-rw-r--r--nuttx/examples/ostest/main.c13
-rw-r--r--nuttx/examples/ostest/mqueue.c4
3 files changed, 15 insertions, 10 deletions
diff --git a/nuttx/examples/ostest/barrier.c b/nuttx/examples/ostest/barrier.c
index 6b33ac0e3..56c0b75b1 100644
--- a/nuttx/examples/ostest/barrier.c
+++ b/nuttx/examples/ostest/barrier.c
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/ostest/barrier.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -48,6 +48,8 @@
* Definitions
****************************************************************************/
+#define HALF_SECOND 500000L
+
/****************************************************************************
* Private Data
****************************************************************************/
@@ -69,7 +71,7 @@ static void *barrier_func(void *parameter)
printf("barrier_func: Thread %d started\n", id);
#ifndef CONFIG_DISABLE_SIGNALS
- usleep(500*1000);
+ usleep(HALF_SECOND);
#endif
/* Wait at the barrier until all threads are synchronized. */
@@ -96,7 +98,7 @@ static void *barrier_func(void *parameter)
}
#ifndef CONFIG_DISABLE_SIGNALS
- usleep(500*1000);
+ usleep(HALF_SECOND);
#endif
printf("barrier_func: Thread %d done\n", id);
return NULL;
diff --git a/nuttx/examples/ostest/main.c b/nuttx/examples/ostest/main.c
index 261f7974b..22a45dcfc 100644
--- a/nuttx/examples/ostest/main.c
+++ b/nuttx/examples/ostest/main.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * ostest/main.c
+ * examples/ostest/main.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -51,8 +51,9 @@
* Definitions
****************************************************************************/
-#define PRIORITY 100
-#define NARGS 4
+#define PRIORITY 100
+#define NARGS 4
+#define HALF_SECOND_USEC 500000L
/****************************************************************************
* Private Data
@@ -133,7 +134,7 @@ static void check_test_memory_usage(void)
{
/* Wait a little bit to let any threads terminate */
- usleep(500*1000);
+ usleep(HALF_SECOND_USEC);
/* Get the current memory usage */
@@ -224,7 +225,7 @@ static int user_main(int argc, char *argv[])
/* Sample the memory usage now */
#ifndef CONFIG_DISABLE_SIGNALS
- usleep(500*1000);
+ usleep(HALF_SECOND_USEC);
#ifdef CONFIG_CAN_PASS_STRUCTS
g_mmbefore = mallinfo();
@@ -405,7 +406,7 @@ static int user_main(int argc, char *argv[])
*/
#ifndef CONFIG_DISABLE_SIGNALS
- usleep(500*1000);
+ usleep(HALF_SECOND_USEC);
#ifdef CONFIG_CAN_PASS_STRUCTS
g_mmafter = mallinfo();
diff --git a/nuttx/examples/ostest/mqueue.c b/nuttx/examples/ostest/mqueue.c
index 8c96d9cf4..e68cfc012 100644
--- a/nuttx/examples/ostest/mqueue.c
+++ b/nuttx/examples/ostest/mqueue.c
@@ -73,6 +73,8 @@
# define TEST_RECEIVE_NMSGS (10)
#endif
+#define HALF_SECOND_USEC_USEC 500000L
+
/**************************************************************************
* Private Types
**************************************************************************/
@@ -370,7 +372,7 @@ void mqueue_test(void)
/* Wait a bit to see if the thread exits on its own */
- usleep(500*1000);
+ usleep(HALF_SECOND_USEC_USEC);
#endif
/* Then cancel the thread and see if it did */