Qurt platform custom icm42688p IMU driver (#20753)

- first version of IMU driver for the VOXL 2 platform (Qurt)
 - this is a customized version of the Invensense ICM42688P driver, it is currently in the VOXL 2 board directory
This commit is contained in:
Eric Katzfey
2022-12-12 22:02:23 -05:00
committed by GitHub
parent 33e39d68f7
commit e17ddcc0e5
24 changed files with 2040 additions and 23 deletions
+1
View File
@@ -44,3 +44,4 @@ add_library(px4_layer
)
target_link_libraries(px4_layer PRIVATE work_queue)
target_link_libraries(px4_layer PRIVATE drivers_board)
+14 -5
View File
@@ -66,6 +66,14 @@ static task_entry_t taskmap[PX4_MAX_TASKS];
static bool task_mutex_initialized = false;
static pthread_mutex_t task_mutex;
// These are some Qurt pthread stubs needed for compilation and linking
extern "C" {
int pthread_setname_np(pthread_t __target_thread, const char *__name) { return 0; }
int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy) { return 0; }
}
static void *entry_adapter(void *ptr)
{
task_entry_t *data;
@@ -147,11 +155,12 @@ static px4_task_t px4_task_spawn_internal(const char *name, int priority, px4_ma
return -1;
}
priority = 255 - priority;
if (priority < 5) { priority = 5; }
if (priority > 250) { priority = 250; }
// Qurt threads have different priority numbers. 1 is the highest
// priority and 254 is the lowest. But we are using the pthread
// implementation on Qurt which returns 255 when you call sched_get_priority_max.
// So, the big assumption is that the Qurt pthread implementation deals with
// this properly when creating the underlying Qurt task.
// TODO: Needs to be verified!
if (strlen(name) >= PX4_TASK_MAX_NAME_LENGTH) {
pthread_mutex_unlock(&task_mutex);