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
ca0a2b3f
Commit
ca0a2b3f
authored
Aug 29, 2022
by
Joo Aun Saw
Committed by
Johny Mattsson
Aug 29, 2022
Browse files
platform: platform_uart_setup handles null ptr
parent
01b94f31
Changes
1
Hide whitespace changes
Inline
Side-by-side
components/platform/platform.c
View file @
ca0a2b3f
...
...
@@ -209,9 +209,11 @@ static void task_uart( void *pvParameters ){
uint32_t
platform_uart_setup
(
unsigned
id
,
uint32_t
baud
,
int
databits
,
int
parity
,
int
stopbits
,
uart_pins_t
*
pins
)
{
int
flow_control
=
UART_HW_FLOWCTRL_DISABLE
;
if
(
pins
->
flow_control
&
PLATFORM_UART_FLOW_CTS
)
flow_control
|=
UART_HW_FLOWCTRL_CTS
;
if
(
pins
->
flow_control
&
PLATFORM_UART_FLOW_RTS
)
flow_control
|=
UART_HW_FLOWCTRL_RTS
;
if
(
pins
!=
NULL
)
{
if
(
pins
->
flow_control
&
PLATFORM_UART_FLOW_CTS
)
flow_control
|=
UART_HW_FLOWCTRL_CTS
;
if
(
pins
->
flow_control
&
PLATFORM_UART_FLOW_RTS
)
flow_control
|=
UART_HW_FLOWCTRL_RTS
;
}
uart_config_t
cfg
=
{
.
baud_rate
=
baud
,
.
flow_ctrl
=
flow_control
,
...
...
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