Skip to content

Commit ba8e997

Browse files
bors[bot]alevy
andcommitted
Merge tock#1131
1131: Use proper pin for CC26xx UART RX r=ppannuto a=alevy ### Pull Request Overview This fixes a regression in the CC26xx UART introduced by a tiny oversight in tock#1073. The implementation of `configure` was using the stored `tx_pin` twice, for configuring both TX and RX pins. Since RX is configured second, this overrode resulted in the user-chosen TX pin being configured to act as the RX side of the UART, and no TX configured at all. The result is that the console or debug appeared not to work. ### Testing Strategy I programmed the launchxl board with a kernel from current `master` as well as the `c_hello` app. Running that results in no output on the UART. With the fix in this PR, and the same app, output is "Hello World!", as expected. I ran similar small tests with `panic!` and `debug!`. ### TODO or Help Wanted _For after this PR_ I'm concerned about the duplication of the PCRM module---the UART module refers to the CC26xx PCRM module, while other drivers refer to the CC26x2 PCRM module. I originally assumed this was the problem until running `git bisect`. I really think we should just get rid of CC26xx for now. But that's for another PR. ### Documentation Updated - [x] ~~Updated the relevant files in `/docs`, or no updates are required.~~ ### Formatting - [x] Ran `make formatall`. Co-authored-by: Amit Aryeh Levy <[email protected]>
2 parents 6715c6f + 39135c1 commit ba8e997

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chips/cc26xx/src/uart.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl UART {
107107
}
108108

109109
self.tx_pin.map_or(ReturnCode::EOFF, |tx_pin| {
110-
self.tx_pin.map_or(ReturnCode::EOFF, |rx_pin| {
110+
self.rx_pin.map_or(ReturnCode::EOFF, |rx_pin| {
111111
unsafe {
112112
// Make sure the TX pin is output/high before assigning it to UART control
113113
// to avoid falling edge glitches

0 commit comments

Comments
 (0)