diff options
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/ChangeLog | 3 | ||||
-rw-r--r-- | nuttx/drivers/audio/Kconfig | 6 | ||||
-rw-r--r-- | nuttx/drivers/audio/vs1053.c | 10 | ||||
-rw-r--r-- | nuttx/include/sys/prctl.h | 11 |
4 files changed, 24 insertions, 6 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 8ab052e09..be77b5e56 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -6017,3 +6017,6 @@ Kinetis KL family from Alan Carvalho de Assis (2013-11-10). * configs/freedom-kl25z: Add PWM support. From Alan Carvalho de Assis (2013-11-10). + * drivers/audio/vs1053: VS1053 worker thread stack size is now + configurable and assigned a name via pthread_setname_np(). From Ken + Pettit (2013-11-10). diff --git a/nuttx/drivers/audio/Kconfig b/nuttx/drivers/audio/Kconfig index 723dbda2a..1c70684ad 100644 --- a/nuttx/drivers/audio/Kconfig +++ b/nuttx/drivers/audio/Kconfig @@ -35,6 +35,12 @@ config VS1053_DEVICE_COUNT context pointers for the DREQ ISR to use for lookup when it needs to signal that additional data is being requested. +config VS1053_WORKER_STACKSIZE + int "VS1053 worker thread stack size" + default 768 + ---help--- + Stack size to use with the VS1053 worker thread. + if AUDIO_DRIVER_SPECIFIC_BUFFERS config VS1053_NUM_BUFFERS diff --git a/nuttx/drivers/audio/vs1053.c b/nuttx/drivers/audio/vs1053.c index 76be87991..e44c7a6e4 100644 --- a/nuttx/drivers/audio/vs1053.c +++ b/nuttx/drivers/audio/vs1053.c @@ -88,6 +88,10 @@ # define CONFIG_VS1053_NUM_BUFFERS 2 #endif +#ifndef CONFIG_VS1053_WORKER_STACKSIZE +# define CONFIG_VS1053_WORKER_STACKSIZE 768 +#endif + #define VS1053_DUMMY 0xFF #define VS1053_DEFAULT_XTALI 12288000 #define VS1053_DATA_FREQ 20000000 @@ -1474,7 +1478,8 @@ static int vs1053_start(FAR struct audio_lowerhalf_s *lower) pthread_attr_init(&tattr); sparam.sched_priority = sched_get_priority_max(SCHED_FIFO) - 3; - pthread_attr_setschedparam(&tattr, &sparam); + (void)pthread_attr_setschedparam(&tattr, &sparam); + (void)pthread_attr_setstacksize(&tattr, CONFIG_VS1053_WORKER_STACKSIZE); auddbg("Starting workerthread\n"); ret = pthread_create(&dev->threadid, &tattr, vs1053_workerthread, @@ -1484,7 +1489,10 @@ static int vs1053_start(FAR struct audio_lowerhalf_s *lower) auddbg("Can't create worker thread, errno=%d\n", errno); } else + { + pthread_setname_np(dev->threadid, "vs1053"); auddbg("Created worker thread\n"); + } return ret; } diff --git a/nuttx/include/sys/prctl.h b/nuttx/include/sys/prctl.h index f1441a77a..adabdf886 100644 --- a/nuttx/include/sys/prctl.h +++ b/nuttx/include/sys/prctl.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/sys/prctl.h * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -65,8 +65,8 @@ * prctl(PR_GET_NAME, myname, 0); */ - #define PR_SET_NAME 1 - #define PR_GET_NAME 2 +#define PR_SET_NAME 1 +#define PR_GET_NAME 2 /**************************************************************************** * Public Type Definitions @@ -79,7 +79,8 @@ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif @@ -104,7 +105,7 @@ extern "C" { * ****************************************************************************/ -EXTERN int prctl(int option, ...); +int prctl(int option, ...); #undef EXTERN #if defined(__cplusplus) |