Fixes for parameters.xml dependencies

Moved definitions of parameters into *params.c in each module.
This is used by the cmake file as a pattern for dependencies when
generating the parameters.xml file.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-10-10 01:15:22 -07:00
parent 67087c6428
commit c28ae649a3
16 changed files with 286 additions and 204 deletions
@@ -38,6 +38,7 @@ set(QURT_LAYER_SRCS
drv_hrt.c
qurt_stubs.c
main.cpp
params.c
)
if ("${QURT_ENABLE_STUBS}" STREQUAL "1")
list(APPEND QURT_LAYER_SRCS
+6 -15
View File
@@ -1,6 +1,5 @@
/****************************************************************************
*
* Copyright (C) 2015 Mark Charlebois. All rights reserved.
* Copyright (C) 2015 Mark Charlebois. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -42,6 +41,7 @@
#include <px4_time.h>
#include <px4_posix.h>
#include <px4_defines.h>
#include <dspal_platform.h>
#include <vector>
#include <string>
#include <map>
@@ -100,15 +100,6 @@ static void process_commands(map<string,px4_main_t> &apps, const char *cmds)
bool found_first_char = false;
char arg[256];
// This is added because it is a parameter used by commander, yet created by mavlink. Since mavlink is not
// running on QURT, we need to manually define it so it is available to commander. "2" is for quadrotor.
// Following is hack to prevent duplicate parameter definition error in param parser
/**
* @board QuRT_App
*/
PARAM_DEFINE_INT32(MAV_TYPE,2);
// Eat leading whitespace
eat_whitespace(b, i);
@@ -152,7 +143,7 @@ extern void init_once(void);
};
__BEGIN_DECLS
extern int dspal_main(int argc, char *argv[]);
int dspal_main(int argc, char *argv[]);
__END_DECLS
@@ -164,13 +155,13 @@ int dspal_entry( int argc, char* argv[] )
px4::init_once();
px4::init(argc, (char **)argv, "mainapp");
process_commands(apps, get_commands());
usleep( 1000000 ); // give time for all commands to execute before starting external function
sleep(1); // give time for all commands to execute before starting external function
if(qurt_external_hook)
{
qurt_external_hook();
}
for( ;; ){
usleep( 1000000 );
for(;;){
sleep(1);
}
return 0;
}
+43
View File
@@ -0,0 +1,43 @@
/****************************************************************************
* Copyright (C) 2015 Mark Charlebois. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <systemlib/param/param.h>
// This is added because it is a parameter used by commander, yet created by mavlink. Since mavlink is not
// running on QURT, we need to manually define it so it is available to commander. "2" is for quadrotor.
// Following is hack to prevent duplicate parameter definition error in param parser
/**
* @board QuRT_App
*/
PARAM_DEFINE_INT32(MAV_TYPE,2);
+39 -56
View File
@@ -31,107 +31,90 @@
*
****************************************************************************/
#include "px4_log.h"
//extern "C" {
void block_indefinite( void );
void _Read_uleb( void );
void _Parse_fde_instr( void );
void _Parse_csd( void );
void _Valbytes( void );
void _Get_eh_data( void );
void _Parse_lsda( void );
void __cxa_guard_release( void );
void _Read_enc_ptr( void );
void _Read_sleb( void );
void __cxa_guard_acquire( void );
void __cxa_pure_virtual( void );
#include <semaphore.h>
void block_indefinite(void);
void _Read_uleb(void);
void _Parse_fde_instr(void);
void _Parse_csd(void);
void _Valbytes(void);
void _Get_eh_data(void);
void _Parse_lsda(void);
void __cxa_guard_release(void);
void _Read_enc_ptr(void);
void _Read_sleb(void);
void __cxa_guard_acquire(void);
void __cxa_pure_virtual(void);
void block_indefinite( void )
{
for(;;)
{
volatile int x = 0;
++x;
}
sem_t forever;
sem_init(&forever, 0, 0);
sem_wait(&forever);
}
void _Read_uleb( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void _Parse_fde_instr( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void _Parse_csd( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
#if 0
void _Locksyslock( int x )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void _Unlocksyslock( int x )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
#endif
void _Valbytes( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void _Get_eh_data( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void _Parse_lsda( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void __cxa_guard_release( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void _Read_enc_ptr( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void _Read_sleb( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void __cxa_guard_acquire( void )
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
void __cxa_pure_virtual()
{
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
PX4_WARN( "Error: Calling unresolved symbol stub[%s]", __FUNCTION__ );
block_indefinite();
}
//}
+2
View File
@@ -1,4 +1,6 @@
#include <dlfcn.h>
#include <qurt_log.h>
#include <dspal_platform.h>
void HAP_debug(const char *msg, int level, const char *filename, int line)
{