diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-08-04 12:29:19 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-08-04 12:29:19 +0000 |
commit | c07e3aeb901dac03d1faff65b4c6eda1de25141c (patch) | |
tree | 67ad77464ffc9b98908f63a61f3d62a7529a9fc8 /apps/examples/nxlines | |
parent | f831ee4825edac31395b26876023e792cda23281 (diff) | |
download | nuttx-c07e3aeb901dac03d1faff65b4c6eda1de25141c.tar.gz nuttx-c07e3aeb901dac03d1faff65b4c6eda1de25141c.tar.bz2 nuttx-c07e3aeb901dac03d1faff65b4c6eda1de25141c.zip |
Add Yu Qiang's patch for RGMP support on the ARM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3843 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/nxlines')
-rw-r--r-- | apps/examples/nxlines/nxlines_bkgd.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/examples/nxlines/nxlines_bkgd.c b/apps/examples/nxlines/nxlines_bkgd.c index 164521156..80808b1da 100644 --- a/apps/examples/nxlines/nxlines_bkgd.c +++ b/apps/examples/nxlines/nxlines_bkgd.c @@ -257,12 +257,25 @@ void nxlines_test(NXWINDOW hwnd) message("nxlines_test: nx_drawline failed clearing: %d\n", ret); } - /* Set up for the next time throught the loop then sleep for a bit. */ + /* Set up for the next time through the loop then sleep for a bit. */ - angle += b16PI / 16; /* 32 angular positions in full circle */ - if (angle > (31 * (2 * b16PI) / 32)) /* Wrap back to zero.. allowing for slop */ + angle += b16PI / 16; /* 32 angular positions in full circle */ + + /* Check if we have gone all the way around */ + + if (angle > (31 * (2 * b16PI) / 32)) { +#ifdef CONFIG_EXAMPLES_NXLINES_BUILTIN + /* If this example was built as an NSH add-on, then exit after we + * have gone all the way around once. + */ + + return; +#else + /* Wrap back to zero and continue with the test */ + angle = 0; +#endif } memcpy(&previous, &vector, sizeof(struct nxgl_vector_s)); |