This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 39e9a17e600b0ed079aea7e86bb98ff8ad1b009d
Author: Gustavo Henrique Nihei <[email protected]>
AuthorDate: Wed Mar 16 13:55:02 2022 -0300

    xtensa/esp32s3: Apply style fixes throughout serial driver
    
    Signed-off-by: Gustavo Henrique Nihei <[email protected]>
---
 arch/xtensa/src/esp32s3/esp32s3_serial.c | 69 +++++++++++++++-----------------
 1 file changed, 33 insertions(+), 36 deletions(-)

diff --git a/arch/xtensa/src/esp32s3/esp32s3_serial.c 
b/arch/xtensa/src/esp32s3/esp32s3_serial.c
index acc2b26..a560fa2 100644
--- a/arch/xtensa/src/esp32s3/esp32s3_serial.c
+++ b/arch/xtensa/src/esp32s3/esp32s3_serial.c
@@ -23,40 +23,37 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
-#include <nuttx/arch.h>
-#include <nuttx/irq.h>
-#include <nuttx/serial/serial.h>
-#include <nuttx/fs/ioctl.h>
 
-#include <sys/types.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <string.h>
 #include <assert.h>
-#include <errno.h>
 #include <debug.h>
-
+#include <errno.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+#include <sys/types.h>
 #ifdef CONFIG_SERIAL_TERMIOS
 #  include <termios.h>
 #endif
+#include <unistd.h>
 
-#include "xtensa.h"
-#include "chip.h"
-
-#include "hardware/esp32s3_uart.h"
-#include "hardware/esp32s3_system.h"
+#include <nuttx/arch.h>
+#include <nuttx/fs/ioctl.h>
+#include <nuttx/irq.h>
+#include <nuttx/serial/serial.h>
 
+#include "xtensa.h"
 #include "esp32s3_config.h"
 #include "esp32s3_irq.h"
 #include "esp32s3_lowputc.h"
+#include "hardware/esp32s3_uart.h"
+#include "hardware/esp32s3_system.h"
 
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* The console is enabled, and it's not the syslog device,
- * so, it should be a serial device.
+/* The console is enabled, and it's not the syslog device, so, it should be a
+ * serial device.
  */
 
 #ifdef USE_SERIALDRIVER
@@ -67,8 +64,8 @@
  * Console can be UART0 or UART1, but will always be ttys0.
  */
 
-/* In case a UART was assigned to be
- * the console and the corresponding peripheral was also selected.
+/* In case a UART was assigned to be the console and the corresponding
+ * peripheral was also selected.
  */
 
 #ifdef CONSOLE_UART
@@ -92,7 +89,7 @@
 #  endif
 #endif /* CONSOLE_UART */
 
-/* Pick ttys1 */
+/* Pick ttyS1 */
 
 #if defined(CONFIG_ESP32S3_UART0) && !defined(UART0_ASSIGNED)
 #  define TTYS1_DEV           g_uart0_dev  /* UART0 is ttyS1 */
@@ -140,21 +137,21 @@ static bool esp32s3_rxflowcontrol(struct uart_dev_s *dev,
 
 static struct uart_ops_s g_uart_ops =
 {
-  .setup       = esp32s3_setup,
-  .shutdown    = esp32s3_shutdown,
-  .attach      = esp32s3_attach,
-  .detach      = esp32s3_detach,
-  .txint       = esp32s3_txint,
-  .rxint       = esp32s3_rxint,
-  .rxavailable = esp32s3_rxavailable,
-  .txready     = esp32s3_txready,
-  .txempty     = esp32s3_txempty,
-  .send        = esp32s3_send,
-  .receive     = esp32s3_receive,
-  .ioctl       = esp32s3_ioctl,
+  .setup         = esp32s3_setup,
+  .shutdown      = esp32s3_shutdown,
+  .attach        = esp32s3_attach,
+  .detach        = esp32s3_detach,
+  .ioctl         = esp32s3_ioctl,
+  .receive       = esp32s3_receive,
+  .rxint         = esp32s3_rxint,
+  .rxavailable   = esp32s3_rxavailable,
 #ifdef CONFIG_SERIAL_IFLOWCONTROL
-  .rxflowcontrol  = esp32s3_rxflowcontrol,
+  .rxflowcontrol = esp32s3_rxflowcontrol,
 #endif
+  .send          = esp32s3_send,
+  .txint         = esp32s3_txint,
+  .txready       = esp32s3_txready,
+  .txempty       = esp32s3_txempty
 };
 
 /* UART 0 */
@@ -678,7 +675,7 @@ static bool esp32s3_txempty(struct uart_dev_s *dev)
 
 static void esp32s3_send(struct uart_dev_s *dev, int ch)
 {
-  esp32s3_lowputc_send_byte(dev->priv, ch);
+  esp32s3_lowputc_send_byte(dev->priv, (char)ch);
 }
 
 /****************************************************************************
@@ -1111,7 +1108,7 @@ int up_putc(int ch)
       up_lowputc('\r');
     }
 
-  up_lowputc(ch);
+  up_lowputc((char)ch);
 
 #ifdef CONSOLE_UART
   esp32s3_lowputc_restore_all_uart_int(CONSOLE_DEV.priv, &int_status);

Reply via email to