-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix panics for UART #434
base: master
Are you sure you want to change the base?
Fix panics for UART #434
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1899,15 +1899,15 @@ fn new_common<UART: Uart>( | |
uart_driver_install( | ||
UART::port(), | ||
if rx.is_some() { | ||
config.rx_fifo_size as _ | ||
config.rx_fifo_size | ||
} else { | ||
0 | ||
}, | ||
UART_FIFO_SIZE * 2 | ||
ivmarkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} as _, | ||
if tx.is_some() { | ||
config.tx_fifo_size as _ | ||
config.tx_fifo_size | ||
} else { | ||
0 | ||
}, | ||
UART_FIFO_SIZE * 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. However.... why do we need this? Are you having problems with TX as well, or are you doing it "just in case"? IMO this is not necessary, because the TX assert is slightly different: https://github.com/espressif/esp-idf/blob/a322e6bdad4b6675d4597fb2722eea2851ba88cb/components/driver/uart/uart.c#L1589 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree. Cancel changes |
||
} as _, | ||
config.queue_size as _, | ||
queue.map(|q| q as *mut _).unwrap_or(ptr::null_mut()), | ||
InterruptType::to_native(config.intr_flags) as i32, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind altering it so that
Self::Unknown
becomes a catch all.But: you are not fixing the root cause why it panicked in the first place, isn't it?
esp_reset_reason_t_ESP_RST_UNKNOWN
because we have that branchSo... how about we map this something else (whatever it is) in the
match
statement? I mean in addition to the change you introduce here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I'll look at the reset reason code and add it to the enum. @ivmarkov Did you mean this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.