Change in osmo-ccid-firmware[master]: UART_debug now uses the async library with tx ring
Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13678 ) Change subject: UART_debug now uses the async library with tx ring .. UART_debug now uses the async library with tx ring Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 5 files changed, 13 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c index 6fa25cf..454cd2f 100644 --- a/sysmoOCTSIM/command.c +++ b/sysmoOCTSIM/command.c @@ -81,7 +81,7 @@ unsigned int i = 0; /* yield CPU after maximum of 10 received characters */ - while (usart_async_is_rx_not_empty(_debug) && (i < 10)) { + while (usart_async_rings_is_rx_not_empty(_debug) && (i < 10)) { int c = getchar(); if (c < 0) return; diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c index 8a50925..0b6b190 100644 --- a/sysmoOCTSIM/driver_init.c +++ b/sysmoOCTSIM/driver_init.c @@ -33,7 +33,7 @@ #define SIM6_BUFFER_SIZE 16 /*! The buffer size for USART */ -#define UART_DEBUG_BUFFER_SIZE 32 +#define UART_DEBUG_BUFFER_SIZE 256 struct usart_async_descriptor SIM0; struct usart_async_descriptor SIM1; @@ -51,9 +51,10 @@ static uint8_t SIM5_buffer[SIM5_BUFFER_SIZE]; static uint8_t SIM6_buffer[SIM6_BUFFER_SIZE]; -struct usart_async_descriptor UART_debug; +struct usart_async_rings_descriptor UART_debug; -static uint8_t UART_DEBUG_buffer[UART_DEBUG_BUFFER_SIZE]; +static uint8_t UART_DEBUG_buffer_rx[UART_DEBUG_BUFFER_SIZE]; +static uint8_t UART_DEBUG_buffer_tx[UART_DEBUG_BUFFER_SIZE]; /** * \brief USART Clock initialization function @@ -349,7 +350,7 @@ void UART_debug_init(void) { UART_debug_CLOCK_init(); - usart_async_init(_debug, SERCOM7, UART_DEBUG_buffer, UART_DEBUG_BUFFER_SIZE, (void *)NULL); + usart_async_rings_init(_debug, SERCOM7, UART_DEBUG_buffer_rx, UART_DEBUG_BUFFER_SIZE, UART_DEBUG_buffer_tx, UART_DEBUG_BUFFER_SIZE, (void *)NULL); UART_debug_PORT_init(); } diff --git a/sysmoOCTSIM/driver_init.h b/sysmoOCTSIM/driver_init.h index 9d009b9..6c4f3a1 100644 --- a/sysmoOCTSIM/driver_init.h +++ b/sysmoOCTSIM/driver_init.h @@ -21,15 +21,9 @@ #include #include -#include -#include -#include -#include -#include -#include -#include - #include +#include +#include #include "hal_usb_device.h" @@ -40,7 +34,7 @@ extern struct usart_async_descriptor SIM4; extern struct usart_async_descriptor SIM5; extern struct usart_async_descriptor SIM6; -extern struct usart_async_descriptor UART_debug; +extern struct usart_async_rings_descriptor UART_debug; void SIM0_PORT_init(void); void SIM0_CLOCK_init(void); diff --git a/sysmoOCTSIM/manual_test.c b/sysmoOCTSIM/manual_test.c index 526414a..d6852bc 100644 --- a/sysmoOCTSIM/manual_test.c +++ b/sysmoOCTSIM/manual_test.c @@ -203,7 +203,7 @@ int c; do { - } while (!usart_async_is_rx_not_empty(_debug)); + } while (!usart_async_rings_is_rx_not_empty(_debug)); c = getchar(); if (c < 0) diff --git a/sysmoOCTSIM/stdio_start.c b/sysmoOCTSIM/stdio_start.c index e2fb0c2..8a15c88 100644 --- a/sysmoOCTSIM/stdio_start.c +++ b/sysmoOCTSIM/stdio_start.c @@ -9,13 +9,13 @@ #include "atmel_start.h" #include "stdio_start.h" -static void UART_debug_rx_cb(const struct usart_async_descriptor *const io_descr) +static void UART_debug_rx_cb(const struct usart_async_rings_descriptor *const io_descr) { } void stdio_redirect_init(void) { - usart_async_register_callback(_debug, USART_ASYNC_RXC_CB, UART_debug_rx_cb); // if no callback function is registered receive won't work, even if the callback does nothing - usart_async_enable(_debug); + usart_async_rings_register_callback(_debug, USART_ASYNC_RXC_CB, UART_debug_rx_cb); // if no callback function is registered receive won't work, even if the callback does nothing + usart_async_rings_enable(_debug); stdio_io_init(_debug.io); } -- To view, visit https://gerrit.osmocom.org/13678 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc Gerrit-Change-Number: 13678 Gerrit-PatchSet: 11 Gerrit-Owner: Kévin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102)
Change in osmo-ccid-firmware[master]: UART_debug now uses the async library with tx ring
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13678 ) Change subject: UART_debug now uses the async library with tx ring .. Patch Set 11: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13678 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc Gerrit-Change-Number: 13678 Gerrit-PatchSet: 11 Gerrit-Owner: Kévin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Comment-Date: Thu, 09 May 2019 14:37:23 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-ccid-firmware[master]: UART_debug now uses the async library with tx ring
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13678 to look at the new patch set (#9). Change subject: UART_debug now uses the async library with tx ring .. UART_debug now uses the async library with tx ring Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 5 files changed, 13 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/78/13678/9 -- To view, visit https://gerrit.osmocom.org/13678 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc Gerrit-Change-Number: 13678 Gerrit-PatchSet: 9 Gerrit-Owner: Kévin Redon Gerrit-Reviewer: Jenkins Builder (102)
Change in osmo-ccid-firmware[master]: UART_debug now uses the async library with tx ring
Harald Welte has uploaded a new patch set (#4) to the change originally created by Kévin Redon. ( https://gerrit.osmocom.org/13678 ) Change subject: UART_debug now uses the async library with tx ring .. UART_debug now uses the async library with tx ring Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 5 files changed, 13 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/78/13678/4 -- To view, visit https://gerrit.osmocom.org/13678 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc Gerrit-Change-Number: 13678 Gerrit-PatchSet: 4 Gerrit-Owner: Kévin Redon Gerrit-Reviewer: Jenkins Builder (102)
Change in osmo-ccid-firmware[master]: UART_debug now uses the async library with tx ring
Kévin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13678 Change subject: UART_debug now uses the async library with tx ring .. UART_debug now uses the async library with tx ring Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/stdio_start.c 4 files changed, 12 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/78/13678/1 diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c index 7ac5662..327a1a0 100644 --- a/sysmoOCTSIM/command.c +++ b/sysmoOCTSIM/command.c @@ -76,7 +76,7 @@ unsigned int i = 0; /* yield CPU after maximum of 10 received characters */ - while (usart_async_is_rx_not_empty(_debug) && (i < 10)) { + while (usart_async_rings_is_rx_not_empty(_debug) && (i < 10)) { gpio_toggle_pin_level(USER_LED); // toggle LED to show we received something int c = getchar(); if (c < 0) diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c index 8a50925..0b6b190 100644 --- a/sysmoOCTSIM/driver_init.c +++ b/sysmoOCTSIM/driver_init.c @@ -33,7 +33,7 @@ #define SIM6_BUFFER_SIZE 16 /*! The buffer size for USART */ -#define UART_DEBUG_BUFFER_SIZE 32 +#define UART_DEBUG_BUFFER_SIZE 256 struct usart_async_descriptor SIM0; struct usart_async_descriptor SIM1; @@ -51,9 +51,10 @@ static uint8_t SIM5_buffer[SIM5_BUFFER_SIZE]; static uint8_t SIM6_buffer[SIM6_BUFFER_SIZE]; -struct usart_async_descriptor UART_debug; +struct usart_async_rings_descriptor UART_debug; -static uint8_t UART_DEBUG_buffer[UART_DEBUG_BUFFER_SIZE]; +static uint8_t UART_DEBUG_buffer_rx[UART_DEBUG_BUFFER_SIZE]; +static uint8_t UART_DEBUG_buffer_tx[UART_DEBUG_BUFFER_SIZE]; /** * \brief USART Clock initialization function @@ -349,7 +350,7 @@ void UART_debug_init(void) { UART_debug_CLOCK_init(); - usart_async_init(_debug, SERCOM7, UART_DEBUG_buffer, UART_DEBUG_BUFFER_SIZE, (void *)NULL); + usart_async_rings_init(_debug, SERCOM7, UART_DEBUG_buffer_rx, UART_DEBUG_BUFFER_SIZE, UART_DEBUG_buffer_tx, UART_DEBUG_BUFFER_SIZE, (void *)NULL); UART_debug_PORT_init(); } diff --git a/sysmoOCTSIM/driver_init.h b/sysmoOCTSIM/driver_init.h index 9d009b9..6c4f3a1 100644 --- a/sysmoOCTSIM/driver_init.h +++ b/sysmoOCTSIM/driver_init.h @@ -21,15 +21,9 @@ #include #include -#include -#include -#include -#include -#include -#include -#include - #include +#include +#include #include "hal_usb_device.h" @@ -40,7 +34,7 @@ extern struct usart_async_descriptor SIM4; extern struct usart_async_descriptor SIM5; extern struct usart_async_descriptor SIM6; -extern struct usart_async_descriptor UART_debug; +extern struct usart_async_rings_descriptor UART_debug; void SIM0_PORT_init(void); void SIM0_CLOCK_init(void); diff --git a/sysmoOCTSIM/stdio_start.c b/sysmoOCTSIM/stdio_start.c index e2fb0c2..8a15c88 100644 --- a/sysmoOCTSIM/stdio_start.c +++ b/sysmoOCTSIM/stdio_start.c @@ -9,13 +9,13 @@ #include "atmel_start.h" #include "stdio_start.h" -static void UART_debug_rx_cb(const struct usart_async_descriptor *const io_descr) +static void UART_debug_rx_cb(const struct usart_async_rings_descriptor *const io_descr) { } void stdio_redirect_init(void) { - usart_async_register_callback(_debug, USART_ASYNC_RXC_CB, UART_debug_rx_cb); // if no callback function is registered receive won't work, even if the callback does nothing - usart_async_enable(_debug); + usart_async_rings_register_callback(_debug, USART_ASYNC_RXC_CB, UART_debug_rx_cb); // if no callback function is registered receive won't work, even if the callback does nothing + usart_async_rings_enable(_debug); stdio_io_init(_debug.io); } -- To view, visit https://gerrit.osmocom.org/13678 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc Gerrit-Change-Number: 13678 Gerrit-PatchSet: 1 Gerrit-Owner: Kévin Redon