Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
8e1abbc5
Commit
8e1abbc5
authored
11 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
SAMA SSC: Add bufffer dump debug instrumentation
parent
dc5d404f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arch/arm/src/sama5/Kconfig
+7
-0
7 additions, 0 deletions
arch/arm/src/sama5/Kconfig
arch/arm/src/sama5/sam_ssc.c
+23
-9
23 additions, 9 deletions
arch/arm/src/sama5/sam_ssc.c
with
30 additions
and
9 deletions
arch/arm/src/sama5/Kconfig
+
7
−
0
View file @
8e1abbc5
...
...
@@ -1682,6 +1682,13 @@ config SAMA5_SSC_QDEBUG
---help---
Enable instrumentation to debug audio buffer queue logic.
config SAMA5_SSC_DUMPBUFFERS
bool "Dump Buffers"
depends on DEBUG_I2S
default n
---help---
Enable instrumentation to dump TX and RX buffers.
endmenu # SSC Configuration
endif # SAMA5_SSC0 || SAMA5_SSC1
...
...
This diff is collapsed.
Click to expand it.
arch/arm/src/sama5/sam_ssc.c
+
23
−
9
View file @
8e1abbc5
...
...
@@ -241,15 +241,13 @@
#ifndef CONFIG_DEBUG
# undef CONFIG_DEBUG_VERBOSE
# undef CONFIG_DEBUG_I2S
# undef CONFIG_SAMA5_SSC_DMADEBUG
# undef CONFIG_SAMA5_SSC_REGDEBUG
# undef CONFIG_SAMA5_SSC_QDEBUG
#endif
#if
!
def
ined(
CONFIG_DEBUG_I2S
)
#if
n
def
CONFIG_DEBUG_I2S
# undef CONFIG_SAMA5_SSC_DMADEBUG
# undef CONFIG_SAMA5_SSC_REGDEBUG
# undef CONFIG_SAMA5_SSC_QDEBUG
# undef CONFIG_SAMA5_SSC_DUMPBUFFERS
#endif
#ifndef CONFIG_DEBUG_DMA
...
...
@@ -390,6 +388,14 @@ static void ssc_dump_queues(struct sam_transport_s *xpt,
# define ssc_dump_txqueues(s,m)
#endif
#ifdef CONFIG_SAMA5_SSC_DUMPBUFFERS
# define ssc_init_buffer(b,s) memset(b, 0x55, s);
# define ssc_dump_buffer(m,b,s) lib_dumpbuffer(m,b,s)
#else
# define ssc_init_buffer(b,s)
# define ssc_dump_buffer(m,b,s)
#endif
/* Semaphore helpers */
static
void
ssc_exclsem_take
(
struct
sam_ssc_s
*
priv
);
...
...
@@ -1250,6 +1256,7 @@ static void ssc_rx_worker(void *arg)
{
struct
sam_ssc_s
*
priv
=
(
struct
sam_ssc_s
*
)
arg
;
struct
sam_buffer_s
*
bfcontainer
;
struct
ap_buffer_s
*
apb
;
irqstate_t
flags
;
DEBUGASSERT
(
priv
);
...
...
@@ -1310,7 +1317,8 @@ static void ssc_rx_worker(void *arg)
bfcontainer
=
(
struct
sam_buffer_s
*
)
sq_remfirst
(
&
priv
->
rx
.
done
);
irqrestore
(
flags
);
DEBUGASSERT
(
bfcontainer
&&
bfcontainer
->
callback
);
DEBUGASSERT
(
bfcontainer
&&
bfcontainer
->
apb
&&
bfcontainer
->
callback
);
apb
=
bfcontainer
->
apb
;
/* If the DMA was successful, then update the number of valid bytes in
* the audio buffer.
...
...
@@ -1318,19 +1326,21 @@ static void ssc_rx_worker(void *arg)
if
(
bfcontainer
->
result
==
OK
)
{
bfcontainer
->
apb
->
nbytes
=
bfcontainer
->
apb
->
nmaxbytes
;
apb
->
nbytes
=
apb
->
nmaxbytes
;
}
ssc_dump_buffer
(
"Received"
,
apb
->
samp
,
apb
->
nbytes
);
/* Perform the RX transfer done callback */
bfcontainer
->
callback
(
&
priv
->
dev
,
bfcontainer
->
a
pb
,
bfcontainer
->
arg
,
bfcontainer
->
result
);
bfcontainer
->
callback
(
&
priv
->
dev
,
apb
,
bfcontainer
->
a
rg
,
bfcontainer
->
result
);
/* Release our reference on the audio buffer. This may very likely
* cause the audio buffer to be freed.
*/
apb_free
(
bfcontainer
->
apb
);
apb_free
(
apb
);
/* And release the buffer container */
...
...
@@ -1992,6 +2002,8 @@ static int ssc_receive(struct i2s_dev_s *dev, struct ap_buffer_s *apb,
i2svdbg
(
"apb=%p nmaxbytes=%d arg=%p timeout=%d
\n
"
,
apb
,
apb
->
nmaxbytes
,
arg
,
timeout
);
ssc_init_buffer
(
apb
->
samp
,
apb
->
nmaxbytes
);
#ifdef SSC_HAVE_RX
/* Allocate a buffer container in advance */
...
...
@@ -2193,6 +2205,8 @@ static int ssc_send(struct i2s_dev_s *dev, struct ap_buffer_s *apb,
i2svdbg
(
"apb=%p nbytes=%d arg=%p timeout=%d
\n
"
,
apb
,
apb
->
nbytes
,
arg
,
timeout
);
ssc_dump_buffer
(
"Sending"
,
apb
->
samp
,
apb
->
nbytes
);
#ifdef SSC_HAVE_TX
/* Allocate a buffer container in advance */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment