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:
parent
7d25e957bf
commit
637283d810
@ -52,7 +52,6 @@
|
|||||||
|
|
||||||
struct qe_example_s
|
struct qe_example_s
|
||||||
{
|
{
|
||||||
bool initialized; /* True: QE devices have been initialized */
|
|
||||||
FAR char *devpath; /* Path to the QE device */
|
FAR char *devpath; /* Path to the QE device */
|
||||||
#ifdef CONFIG_NSH_BUILTIN_APPS
|
#ifdef CONFIG_NSH_BUILTIN_APPS
|
||||||
bool reset; /* True: set the count back to zero */
|
bool reset; /* True: set the count back to zero */
|
||||||
@ -67,19 +66,4 @@ struct qe_example_s
|
|||||||
|
|
||||||
extern struct qe_example_s g_qeexample;
|
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 */
|
#endif /* __APPS_EXAMPLES_QENCODER_QE_H */
|
||||||
|
@ -252,28 +252,9 @@ int qe_main(int argc, FAR char *argv[])
|
|||||||
int nloops;
|
int nloops;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Check if we have initialized */
|
/* Set the default values */
|
||||||
|
|
||||||
if (!g_qeexample.initialized)
|
qe_devpath(CONFIG_EXAMPLES_QENCODER_DEVPATH);
|
||||||
{
|
|
||||||
/* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Parse command line arguments */
|
/* Parse command line arguments */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user