You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/06/07 08:25:04 UTC

[GitHub] [incubator-nuttx] CV-Bowen opened a new pull request, #6379: arm/tlsr82: gpio driver bug fix and optimize.

CV-Bowen opened a new pull request, #6379:
URL: https://github.com/apache/incubator-nuttx/pull/6379

   ## Summary
   1. follow telink sdk handbook, adjust register configuration order;
   2. add more debug information output;
   3. gpio irq bug fix and optimize;
   4. typo fix; 
   
   ## Impact
   tlsr82 gpio
   
   ## Testing
   local test with gpio example, input, output, irq(normal mode, risc mode)
   


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] CV-Bowen commented on a diff in pull request #6379: arm/tlsr82: gpio driver bug fix and optimize.

Posted by GitBox <gi...@apache.org>.
CV-Bowen commented on code in PR #6379:
URL: https://github.com/apache/incubator-nuttx/pull/6379#discussion_r890986814


##########
boards/arm/tlsr82/tlsr8278adk80d/src/tlsr8278_gpio.c:
##########
@@ -269,22 +295,33 @@ static int tlsr82_go_setpintype(struct gpio_dev_s *dev,
 int tlsr82_gpio_initialize(void)
 {
   int i;
+  int ret = OK;
+  struct tlsr82gpio_dev_s *tlsr82gpio;
 
-  tlsr82_gpioirqconfig(g_gpios[3], NULL, NULL);
+  tlsr82_gpioirqinitialize();
 
   for (i = 0; i < BOARD_NGPIO; i++)
     {
-      g_gpdevs[i].gpio.gp_pintype = g_init_pintype[i];
-      g_gpdevs[i].gpio.gp_ops     = &gpio_ops;
-      g_gpdevs[i].id              = i;
-      gpio_pin_register(&g_gpdevs[i].gpio, i);
-
-      /* Configure the pin that will be used as input */
+      tlsr82gpio = &g_gpdevs[i];
+      tlsr82gpio->gpio.gp_pintype = tlsr82gpio->init_pintype;
+      tlsr82gpio->gpio.gp_ops     = &gpio_ops;
+      tlsr82gpio->id              = i;
+
+      ret = tlsr82_go_setpintype(&tlsr82gpio->gpio,
+                                 tlsr82gpio->init_pintype);
+      if (ret < 0)
+        {
+          goto errout;
+        }
 
-      tlsr82_gpioconfig(g_gpios[i]);
+      gpio_pin_register(&tlsr82gpio->gpio, i);
     }
 
-  return 0;
+  return OK;
+
+errout:
+
+  return ret;

Review Comment:
   Done



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6379: arm/tlsr82: gpio driver bug fix and optimize.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6379:
URL: https://github.com/apache/incubator-nuttx/pull/6379#discussion_r890979730


##########
boards/arm/tlsr82/tlsr8278adk80d/src/tlsr8278_gpio.c:
##########
@@ -269,22 +295,33 @@ static int tlsr82_go_setpintype(struct gpio_dev_s *dev,
 int tlsr82_gpio_initialize(void)
 {
   int i;
+  int ret = OK;
+  struct tlsr82gpio_dev_s *tlsr82gpio;
 
-  tlsr82_gpioirqconfig(g_gpios[3], NULL, NULL);
+  tlsr82_gpioirqinitialize();
 
   for (i = 0; i < BOARD_NGPIO; i++)
     {
-      g_gpdevs[i].gpio.gp_pintype = g_init_pintype[i];
-      g_gpdevs[i].gpio.gp_ops     = &gpio_ops;
-      g_gpdevs[i].id              = i;
-      gpio_pin_register(&g_gpdevs[i].gpio, i);
-
-      /* Configure the pin that will be used as input */
+      tlsr82gpio = &g_gpdevs[i];
+      tlsr82gpio->gpio.gp_pintype = tlsr82gpio->init_pintype;
+      tlsr82gpio->gpio.gp_ops     = &gpio_ops;
+      tlsr82gpio->id              = i;
+
+      ret = tlsr82_go_setpintype(&tlsr82gpio->gpio,
+                                 tlsr82gpio->init_pintype);
+      if (ret < 0)
+        {
+          goto errout;
+        }
 
-      tlsr82_gpioconfig(g_gpios[i]);
+      gpio_pin_register(&tlsr82gpio->gpio, i);
     }
 
-  return 0;
+  return OK;
+
+errout:
+
+  return ret;

Review Comment:
   optional
   ```suggestion
   out:
   
     return ret;
   ```
   `ret` should be `OK` any way at the end



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6379: arm/tlsr82: gpio driver bug fix and optimize.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6379:
URL: https://github.com/apache/incubator-nuttx/pull/6379


-- 
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-unsubscribe@nuttx.apache.org

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