You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/01/28 15:00:09 UTC
[incubator-nuttx] branch pr172 updated: Fix several coding standard
issues in the generic SPI LCD driver.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch pr172
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/pr172 by this push:
new f27152a Fix several coding standard issues in the generic SPI LCD driver.
f27152a is described below
commit f27152a1af3ad6207a596c936816863cda4514f0
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Tue Jan 28 08:49:15 2020 -0600
Fix several coding standard issues in the generic SPI LCD driver.
---
drivers/lcd/lcddrv_spiif.c | 30 ++++++--------------------
include/nuttx/lcd/lcddrv_spiif.h | 46 ++++++++++++++++++----------------------
2 files changed, 28 insertions(+), 48 deletions(-)
diff --git a/drivers/lcd/lcddrv_spiif.c b/drivers/lcd/lcddrv_spiif.c
index d1dbb3e..a2826e8 100644
--- a/drivers/lcd/lcddrv_spiif.c
+++ b/drivers/lcd/lcddrv_spiif.c
@@ -4,7 +4,7 @@
* Generic Driver interface for the Single Chip LCD driver connected
* via spi driver
*
- * Copyright (C) 2019 Greg Nutt. All rights reserved.
+ * Copyright (C) 2020 Gregory Nutt. All rights reserved.
* Author: Dave Marples <da...@marples.net>
* Based on work from Marco Krahl <oc...@gmail.com>
*
@@ -57,16 +57,12 @@
#include <nuttx/lcd/lcddrv_spiif.h>
/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
* Private Type Definition
****************************************************************************/
struct lcddrv_spiif_lcd_s
{
- /* Publically visible device structure */
+ /* Publicly visible device structure */
struct lcddrv_lcd_s dev;
@@ -76,18 +72,6 @@ struct lcddrv_spiif_lcd_s
};
/****************************************************************************
- * Private Function Protototypes
- ****************************************************************************/
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/****************************************************************************
* Public Functions
****************************************************************************/
@@ -106,7 +90,7 @@ struct lcddrv_spiif_lcd_s
*
****************************************************************************/
-static int lcddrv_spiif_backlight(struct lcddrv_lcd_s *lcd, int level)
+static int lcddrv_spiif_backlight(FAR struct lcddrv_lcd_s *lcd, int level)
{
return spiif_backlight(lcd, level);
}
@@ -203,7 +187,7 @@ static int lcddrv_spiif_sendmulti(FAR struct lcddrv_lcd_s *lcd,
****************************************************************************/
static int lcddrv_spiif_recv(FAR struct lcddrv_lcd_s *lcd,
- uint8_t *param)
+ FAR uint8_t *param)
{
FAR struct lcddrv_spiif_lcd_s *priv = (FAR struct lcddrv_spiif_lcd_s *)lcd;
@@ -309,10 +293,10 @@ static int lcddrv_spiif_recvmulti(FAR struct lcddrv_lcd_s *lcd,
*
****************************************************************************/
-FAR struct lcddrv_lcd_s *lcddrv_spiif_initialize(struct spi_dev_s *spi)
+FAR struct lcddrv_lcd_s *lcddrv_spiif_initialize(FAR struct spi_dev_s *spi)
{
- FAR struct lcddrv_spiif_lcd_s *priv =
- (struct lcddrv_spiif_lcd_s *)kmm_zalloc(sizeof(struct lcddrv_spiif_lcd_s));
+ FAR struct lcddrv_spiif_lcd_s *priv = (FAR struct lcddrv_spiif_lcd_s *)
+ kmm_zalloc(sizeof(struct lcddrv_spiif_lcd_s));
if (!priv)
{
diff --git a/include/nuttx/lcd/lcddrv_spiif.h b/include/nuttx/lcd/lcddrv_spiif.h
index aefa5e3..eb3a7b9 100644
--- a/include/nuttx/lcd/lcddrv_spiif.h
+++ b/include/nuttx/lcd/lcddrv_spiif.h
@@ -1,7 +1,7 @@
-/*****************************************************************************
+/****************************************************************************
* include/nuttx/lcd/lcddrv_spiif.h
*
- * Copyright (C) 2014 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2020 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gn...@nuttx.org>
* Dave Marples <da...@marples.net>
*
@@ -45,10 +45,6 @@
#include <nuttx/spi/spi.h>
/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
* Public Types
****************************************************************************/
@@ -56,7 +52,7 @@ struct lcddrv_lcd_s
{
/* Interface to control the ILI9341 lcd driver
*
- * - select Select the device (as neccessary) before performing
+ * - select Select the device (as necessary) before performing
* any operations.
* - deselect Deselect the device (as necessary).
* - send Send specific parameter to the LCD driver.
@@ -72,21 +68,21 @@ struct lcddrv_lcd_s
CODE void (*select)(FAR struct lcddrv_lcd_s *lcd);
CODE void (*deselect)(FAR struct lcddrv_lcd_s *lcd);
- CODE int (*sendcmd)(FAR struct lcddrv_lcd_s *lcd, const uint8_t cmd);
- CODE int (*sendparam)(FAR struct lcddrv_lcd_s *lcd, const uint8_t param);
- CODE int (*recvparam)(FAR struct lcddrv_lcd_s *lcd, uint8_t *param);
- CODE int (*recvgram)(FAR struct lcddrv_lcd_s *lcd,
- uint16_t *wd, uint32_t nwords);
- CODE int (*sendgram)(FAR struct lcddrv_lcd_s *lcd,
- const uint16_t *wd, uint32_t nwords);
- CODE int (*backlight)(FAR struct lcddrv_lcd_s *lcd, int level);
-
- /* mcu interface specific data following */
+ CODE int (*sendcmd)(FAR struct lcddrv_lcd_s *lcd, const uint8_t cmd);
+ CODE int (*sendparam)(FAR struct lcddrv_lcd_s *lcd, const uint8_t param);
+ CODE int (*recvparam)(FAR struct lcddrv_lcd_s *lcd, FAR uint8_t *param);
+ CODE int (*recvgram)(FAR struct lcddrv_lcd_s *lcd,
+ FAR uint16_t *wd, uint32_t nwords);
+ CODE int (*sendgram)(FAR struct lcddrv_lcd_s *lcd,
+ FAR const uint16_t *wd, uint32_t nwords);
+ CODE int (*backlight)(FAR struct lcddrv_lcd_s *lcd, int level);
+
+ /* MCU interface specific data following */
};
-/*****************************************************************************
+/****************************************************************************
* Public Data
- *****************************************************************************/
+ ****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
@@ -96,11 +92,11 @@ extern "C"
#define EXTERN extern
#endif
-/*****************************************************************************
+/****************************************************************************
* Public Function Prototypes
- *****************************************************************************/
+ ****************************************************************************/
-/*****************************************************************************
+/****************************************************************************
* Name: spiif_backlight
* (Provided by integrating platform)
*
@@ -116,7 +112,7 @@ extern "C"
*
****************************************************************************/
-extern int spiif_backlight(struct lcddrv_lcd_s *lcd, int level);
+extern int spiif_backlight(FAR struct lcddrv_lcd_s *lcd, int level);
/****************************************************************************
* Name: FAR struct lcddrv_lcd_s *lcddrv_spiif_initialize
@@ -125,7 +121,7 @@ extern int spiif_backlight(struct lcddrv_lcd_s *lcd, int level);
* Initialize the device structure to control the LCD Single chip driver.
*
* Input Parameters:
- * path : path to spi device to use
+ * path : path to SPI device to use
*
* Returned Value:
* On success, this function returns a reference to the LCD control object
@@ -134,7 +130,7 @@ extern int spiif_backlight(struct lcddrv_lcd_s *lcd, int level);
*
****************************************************************************/
-FAR struct lcddrv_lcd_s *lcddrv_spiif_initialize(struct spi_dev_s *spi);
+FAR struct lcddrv_lcd_s *lcddrv_spiif_initialize(FAR struct spi_dev_s *spi);
#undef EXTERN
#ifdef __cplusplus