Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
f2a5041c
Unverified
Commit
f2a5041c
authored
Feb 21, 2024
by
Rodrigo Garcia
Committed by
GitHub
Feb 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix(sigmaDelta): fixes sigmaDeltaAttach() when another peripheral is already attached (#9268)
parent
72f9fe3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
cores/esp32/esp32-hal-sigmadelta.c
cores/esp32/esp32-hal-sigmadelta.c
+5
-3
No files found.
cores/esp32/esp32-hal-sigmadelta.c
View file @
f2a5041c
...
@@ -27,11 +27,13 @@ static bool sigmaDeltaDetachBus(void * bus){
...
@@ -27,11 +27,13 @@ static bool sigmaDeltaDetachBus(void * bus){
bool
sigmaDeltaAttach
(
uint8_t
pin
,
uint32_t
freq
)
//freq 1220-312500
bool
sigmaDeltaAttach
(
uint8_t
pin
,
uint32_t
freq
)
//freq 1220-312500
{
{
perimanSetBusDeinit
(
ESP32_BUS_TYPE_SIGMADELTA
,
sigmaDeltaDetachBus
);
perimanSetBusDeinit
(
ESP32_BUS_TYPE_SIGMADELTA
,
sigmaDeltaDetachBus
);
sdm_channel_handle_t
bus
=
(
sdm_channel_handle_t
)
perimanGetPinBus
(
pin
,
ESP32_BUS_TYPE_SIGMADELTA
);
sdm_channel_handle_t
bus
=
NULL
;
if
(
bus
!=
NULL
&&
!
perimanClearPinBus
(
pin
)){
// pin may be previously attached to other peripheral -> detach it.
// if attached to sigmaDelta, detach it and set the new frequency
if
(
perimanGetPinBusType
(
pin
)
!=
ESP32_BUS_TYPE_INIT
&&
!
perimanClearPinBus
(
pin
)){
log_e
(
"Pin %u could not be detached."
,
pin
);
return
false
;
return
false
;
}
}
bus
=
NULL
;
sdm_config_t
config
=
{
sdm_config_t
config
=
{
.
gpio_num
=
(
int
)
pin
,
.
gpio_num
=
(
int
)
pin
,
.
clk_src
=
SDM_CLK_SRC_DEFAULT
,
.
clk_src
=
SDM_CLK_SRC_DEFAULT
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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