xiaoxiang781216 commented on a change in pull request #5363:
URL: https://github.com/apache/incubator-nuttx/pull/5363#discussion_r794209315



##########
File path: boards/arm/phy62xx/phy6222/scripts/Make.defs
##########
@@ -35,7 +35,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
 endif
 
 ifneq ($(CONFIG_DEBUG_NOOPT),y)
-  ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
+  ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing 
-fno-strength-reduce -fomit-frame-pointer

Review comment:
       revert, don't need

##########
File path: arch/arm/src/phy62xx/uart.c
##########
@@ -878,10 +887,21 @@ static int pplus_uart_receive(struct uart_dev_s *dev, 
unsigned int *status)
 {
   uart_Ctx_t *priv = (uart_Ctx_t *)dev->priv;
   uint32_t data;
+  static uint8_t fifo_buf_store[UART_RX_BUFFER_SIZE];
+  static int buf_head;
+  static int buf_tail;
+  /* Put fifo data into loopback buffer */
+  for(int i=0;i<fifo_len_store;i++)
+    {
+         fifo_buf_store[buf_head] = fifo_data_store[i];
+         buf_head = buf_head +1;
+         if(buf_head == UART_RX_BUFFER_SIZE)
+          buf_head = 0;
+    }
+  fifo_len_store = 0;
+  if(buf_tail == UART_RX_BUFFER_SIZE)

Review comment:
       add {}

##########
File path: arch/arm/src/phy62xx/uart.c
##########
@@ -878,10 +887,21 @@ static int pplus_uart_receive(struct uart_dev_s *dev, 
unsigned int *status)
 {
   uart_Ctx_t *priv = (uart_Ctx_t *)dev->priv;
   uint32_t data;
+  static uint8_t fifo_buf_store[UART_RX_BUFFER_SIZE];
+  static int buf_head;
+  static int buf_tail;
+  /* Put fifo data into loopback buffer */
+  for(int i=0;i<fifo_len_store;i++)

Review comment:
       add space after ;

##########
File path: arch/arm/src/phy62xx/uart.c
##########
@@ -878,10 +887,21 @@ static int pplus_uart_receive(struct uart_dev_s *dev, 
unsigned int *status)
 {
   uart_Ctx_t *priv = (uart_Ctx_t *)dev->priv;
   uint32_t data;
+  static uint8_t fifo_buf_store[UART_RX_BUFFER_SIZE];
+  static int buf_head;
+  static int buf_tail;

Review comment:
       why use static

##########
File path: arch/arm/src/phy62xx/uart.c
##########
@@ -921,11 +941,21 @@ static void pplus_uart_rxint(struct uart_dev_s *dev, bool 
enable)
 
 static bool pplus_uart_rxavailable(struct uart_dev_s *dev)
 {
+  static int len_fifo;
   uart_Ctx_t *priv = (uart_Ctx_t *)dev->priv;
-
-  /* Return true if the receive buffer/fifo is not "empty." */
-
-  return priv->rx_available;
+  /* Detect the length of received data from fifo*/
+  if(len_fifo == 0)
+  {
+         hal_UART0_IRQHandler();
+         len_fifo = fifo_len_store;
+  }
+  if(len_fifo <= 0)
+         {
+         len_fifo = 0;
+         return len_fifo;
+         }
+  else
+         return len_fifo--;

Review comment:
       fix the nxstyle warning




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to