Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
a56a7b27
Commit
a56a7b27
authored
Jun 20, 2017
by
devsaurus
Browse files
init ws2812_chains during platform_init
parent
10e96a3b
Changes
3
Hide whitespace changes
Inline
Side-by-side
components/platform/include/platform.h
View file @
a56a7b27
...
...
@@ -228,6 +228,7 @@ int platform_dht_read( uint8_t gpio_num, uint8_t wakeup_ms, uint8_t *data );
// *****************************************************************************
// WS2812 platform interface
void
platform_ws2812_init
(
void
);
int
platform_ws2812_setup
(
uint8_t
gpio_num
,
uint8_t
num_mem
,
const
uint8_t
*
data
,
size_t
len
);
int
platform_ws2812_release
(
void
);
int
platform_ws2812_send
(
void
);
...
...
components/platform/platform.c
View file @
a56a7b27
...
...
@@ -12,6 +12,7 @@
int
platform_init
(
void
)
{
platform_ws2812_init
();
return
PLATFORM_OK
;
}
...
...
components/platform/ws2812.c
View file @
a56a7b27
...
...
@@ -159,6 +159,7 @@ int platform_ws2812_release( void )
rmt_driver_uninstall
(
channel
);
platform_rmt_release
(
channel
);
chain
->
valid
=
false
;
// attach GPIO to pin, driving 0
gpio_set_level
(
chain
->
gpio
,
0
);
...
...
@@ -235,3 +236,10 @@ int platform_ws2812_send( void )
return
res
;
}
void
platform_ws2812_init
(
void
)
{
for
(
rmt_channel_t
channel
=
0
;
channel
<
RMT_CHANNEL_MAX
;
channel
++
)
{
ws2812_chains
[
channel
].
valid
=
false
;
}
}
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