From 9ca182373f591c5d595f039d58078317c1e3b975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Barna=C5=9B?= Date: Wed, 3 Feb 2021 18:35:37 +0100 Subject: servo_v4p1: Fix communication with ATmega32 keyboard emulator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ś Change-Id: Ia4fe26dcbd7146eb202b948a5f03c04b1c673001 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2673411 Reviewed-by: Aseda Aboagye --- chip/stm32/usart_tx_interrupt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chip') 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) -- cgit v1.2.1