Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
522d454e
Commit
522d454e
authored
Nov 24, 2015
by
Damien George
Browse files
stmhal: Small simplification of code to tickle DMA idle counter.
parent
3baf6b53
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/dma.c
View file @
522d454e
...
...
@@ -33,7 +33,8 @@
#include
"py/obj.h"
#include
"irq.h"
#define NSTREAMS_PER_CONTROLLER (8)
#define NSTREAMS_PER_CONTROLLER_LOG2 (3)
#define NSTREAMS_PER_CONTROLLER (1 << NSTREAMS_PER_CONTROLLER_LOG2)
#define NCONTROLLERS (2)
#define NSTREAM (NCONTROLLERS * NSTREAMS_PER_CONTROLLER)
...
...
@@ -117,11 +118,7 @@ static int get_dma_id(DMA_Stream_TypeDef *dma_stream) {
// Resets the idle counter for the DMA controller associated with dma_id.
static
void
dma_tickle
(
int
dma_id
)
{
if
(
dma_id
<
NSTREAMS_PER_CONTROLLER
)
{
dma_idle
.
counter
[
0
]
=
1
;
}
else
{
dma_idle
.
counter
[
1
]
=
1
;
}
dma_idle
.
counter
[(
dma_id
>>
NSTREAMS_PER_CONTROLLER_LOG2
)
&
1
]
=
1
;
}
static
void
dma_enable_clock
(
int
dma_id
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment