diff options
author | Michał Barnaś <mb@semihalf.com> | 2021-02-03 18:35:37 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-09 12:03:23 +0000 |
commit | 9ca182373f591c5d595f039d58078317c1e3b975 (patch) | |
tree | 025bcb817294a7804bd2557e7067cc002ad4c530 /chip/stm32 | |
parent | 50ebbad974c5c9916721ecf2e42ca07dd6df691b (diff) | |
download | chrome-ec-9ca182373f591c5d595f039d58078317c1e3b975.tar.gz |
servo_v4p1: Fix communication with ATmega32 keyboard emulator
Fix queue used in USART TX of STM32 interrupt handler. It was using
producer queue instead of consumer, which resulted in no data
transmitted through usart.
BUG=b:179284396
BRANCH=main
TEST=Flash servo_v4p1 and run servod without board parameter.
There should be no error like:
ServoUSBkm232Handler - ERROR - Atmega KB offline:
failed to communicate.
TEST=Flash servo_v4p1.
Connect DUT charger to servo_v4p1 and servo to DUT.
Run servod with board specified.
Enable keyboard emulator: dut-control init_usb_keyboard:on
Execute in terminal:
socat readline $(dut-control atmega_pty | cut -d: -f2)
Writing any data should result in random characters appearing
on DUT.
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Change-Id: Ia4fe26dcbd7146eb202b948a5f03c04b1c673001
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2673411
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'chip/stm32')
-rw-r--r-- | chip/stm32/usart_tx_interrupt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/stm32/usart_tx_interrupt.c b/chip/stm32/usart_tx_interrupt.c index 6a6aaf65f7..d8d441ba1b 100644 --- a/chip/stm32/usart_tx_interrupt.c +++ b/chip/stm32/usart_tx_interrupt.c @@ -73,7 +73,7 @@ static void usart_tx_interrupt_handler_common( static size_t queue_remove(struct usart_config const *config, uint8_t *dest) { - return queue_remove_unit(config->producer.queue, (void *) dest); + return queue_remove_unit(config->consumer.queue, (void *) dest); } static void usart_tx_interrupt_handler(struct usart_config const *config) |