<commit_before>/*
 * Copyright (c) 2017 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/* Include esp-idf headers first to avoid redefining BIT() macro */
#include <rom/uart.h>
#include <rom/ets_sys.h>

#include <uart.h>
#include <errno.h>

static unsigned char esp32_uart_tx(struct device *dev,
				   unsigned char c)
{
	ARG_UNUSED(dev);

	uart_tx_one_char(c);

	return 0;
}

static int esp32_uart_rx(struct device *dev, unsigned char *p_char)
{
	ARG_UNUSED(dev);

	switch (uart_rx_one_char(p_char)) {
	case OK:
		return 0;
	case PENDING:<commit_msg>drivers: serial: esp32: Return transmitted character on success<commit_after>/*
 * Copyright (c) 2017 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/* Include esp-idf headers first to avoid redefining BIT() macro */
#include <rom/uart.h>
#include <rom/ets_sys.h>

#include <uart.h>
#include <errno.h>

static unsigned char esp32_uart_tx(struct device *dev,
				   unsigned char c)
{
	ARG_UNUSED(dev);

	uart_tx_one_char(c);

	return c;
}

static int esp32_uart_rx(struct device *dev, unsigned char *p_char)
{
	ARG_UNUSED(dev);

	switch (uart_rx_one_char(p_char)) {
	case OK:
		return 0;
	case PENDING:
{'fraction_non_alphanumeric': 0.12352941176470589, 'fraction_numerical': 0.02100840336134454, 'mean_word_length': 4.413636363636364, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1850890', 'n_tokens_mistral': 475, 'n_tokens_neox': 442, 'n_words': 116}