The examples/qencoder app was trying to init the encoder by a direct call into the board, cheating in a local header to declare the normally unavailable function prototype.

This commit is contained in:
Sebastien Lorquet 2016-11-22 05:54:12 -06:00 committed by Gregory Nutt
parent 7d25e957bf
commit 637283d810
2 changed files with 2 additions and 37 deletions

View File

@ -52,7 +52,6 @@
struct qe_example_s
{
bool initialized; /* True: QE devices have been initialized */
FAR char *devpath; /* Path to the QE device */
#ifdef CONFIG_NSH_BUILTIN_APPS
bool reset; /* True: set the count back to zero */
@ -67,19 +66,4 @@ struct qe_example_s
extern struct qe_example_s g_qeexample;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: qe_devinit()
*
* Description:
* Perform architecuture-specific initialization of the QE hardware. This
* interface must be provided by all configurations using apps/examples/qe
*
****************************************************************************/
int qe_devinit(void);
#endif /* __APPS_EXAMPLES_QENCODER_QE_H */

View File

@ -252,28 +252,9 @@ int qe_main(int argc, FAR char *argv[])
int nloops;
#endif
/* Check if we have initialized */
/* Set the default values */
if (!g_qeexample.initialized)
{
/* Initialization of the encoder hardware is performed by logic external to
* this test.
*/
printf("qe_main: Initializing external encoder(s)\n");
ret = qe_devinit();
if (ret != OK)
{
printf("qe_main: qe_devinit failed: %d\n", ret);
exitval = EXIT_FAILURE;
goto errout;
}
/* Set the default values */
qe_devpath(CONFIG_EXAMPLES_QENCODER_DEVPATH);
g_qeexample.initialized = true;
}
qe_devpath(CONFIG_EXAMPLES_QENCODER_DEVPATH);
/* Parse command line arguments */