summaryrefslogtreecommitdiffstats
path: root/nuttx/configs/olimex-strp711
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2009-12-15 20:56:22 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2009-12-15 20:56:22 +0000
commita590c74176d14e37511e376625aedc1c3c5b55d2 (patch)
treecc9f00d272faed8cca17c115086ef4f542beec34 /nuttx/configs/olimex-strp711
parent38a5f26e413ba9680024049bbeae80a69394e38f (diff)
Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@2352 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/configs/olimex-strp711')
-rw-r--r--nuttx/configs/olimex-strp711/include/board.h6
-rw-r--r--nuttx/configs/olimex-strp711/src/up_buttons.c10
-rw-r--r--nuttx/configs/olimex-strp711/src/up_leds.c14
-rw-r--r--nuttx/configs/olimex-strp711/src/up_nsh.c1
-rw-r--r--nuttx/configs/olimex-strp711/src/up_spi.c71
5 files changed, 53 insertions, 49 deletions
diff --git a/nuttx/configs/olimex-strp711/include/board.h b/nuttx/configs/olimex-strp711/include/board.h
index 911e0bff71..1d4b503c4b 100644
--- a/nuttx/configs/olimex-strp711/include/board.h
+++ b/nuttx/configs/olimex-strp711/include/board.h
@@ -1,7 +1,7 @@
/****************************************************************************
* configs/olimex-strp711/include/board.h
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -70,7 +70,7 @@
****************************************************************************/
#ifndef __ASSEMBLY__
-# include <sys/types.h>
+# include <stdint.h>
#endif
#include "chip.h"
@@ -173,7 +173,7 @@ extern "C" {
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
-EXTERN ubyte up_buttons(void);
+EXTERN uint8_t up_buttons(void);
#endif
#undef EXTERN
diff --git a/nuttx/configs/olimex-strp711/src/up_buttons.c b/nuttx/configs/olimex-strp711/src/up_buttons.c
index f6340026e9..a33c1caebc 100644
--- a/nuttx/configs/olimex-strp711/src/up_buttons.c
+++ b/nuttx/configs/olimex-strp711/src/up_buttons.c
@@ -1,7 +1,7 @@
/****************************************************************************
* configs/olimex-strp711/src/up_leds.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+#include <stdint.h>
#include "chip.h"
#include "up_arch.h"
@@ -76,7 +76,7 @@
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void)
{
- uint16 reg16;
+ uint16_t reg16;
/* Configure the GPIO0 & 1 pins as inputs */
@@ -109,9 +109,9 @@ void up_buttoninit(void)
* Name: up_buttons
****************************************************************************/
-ubyte up_buttons(void)
+uint8_t up_buttons(void)
{
- ubyte ret = 0;
+ uint8_t ret = 0;
if ((getreg16(STR71X_GPIO0_PD) & STR71X_WAKEUPBUTTON_GPIO0) != 0)
{
diff --git a/nuttx/configs/olimex-strp711/src/up_leds.c b/nuttx/configs/olimex-strp711/src/up_leds.c
index a5719d5f99..8f803346dd 100644
--- a/nuttx/configs/olimex-strp711/src/up_leds.c
+++ b/nuttx/configs/olimex-strp711/src/up_leds.c
@@ -1,7 +1,7 @@
/****************************************************************************
* configs/olimex-strp711/src/up_leds.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+#include <stdint.h>
#include "chip.h"
#include "up_arch.h"
@@ -62,8 +62,8 @@
* Private Data
****************************************************************************/
-static uint16 g_led2set;
-static uint16 g_led2clr;
+static uint16_t g_led2set;
+static uint16_t g_led2clr;
/****************************************************************************
* Private Functions
@@ -73,9 +73,9 @@ static uint16 g_led2clr;
* Name: up_setleds
****************************************************************************/
-static void up_setleds(uint16 setbits, uint16 clearbits)
+static void up_setleds(uint16_t setbits, uint16_t clearbits)
{
- uint16 reg16;
+ uint16_t reg16;
/* Save the state of LED2 for later */
@@ -101,7 +101,7 @@ static void up_setleds(uint16 setbits, uint16 clearbits)
#ifdef CONFIG_ARCH_LEDS
void up_ledinit(void)
{
- uint16 reg16;
+ uint16_t reg16;
/* Set normal function output */
diff --git a/nuttx/configs/olimex-strp711/src/up_nsh.c b/nuttx/configs/olimex-strp711/src/up_nsh.c
index cf4f558079..5869895790 100644
--- a/nuttx/configs/olimex-strp711/src/up_nsh.c
+++ b/nuttx/configs/olimex-strp711/src/up_nsh.c
@@ -39,7 +39,6 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
#include <stdio.h>
#include <debug.h>
diff --git a/nuttx/configs/olimex-strp711/src/up_spi.c b/nuttx/configs/olimex-strp711/src/up_spi.c
index 04337445be..4f6036c3f9 100644
--- a/nuttx/configs/olimex-strp711/src/up_spi.c
+++ b/nuttx/configs/olimex-strp711/src/up_spi.c
@@ -38,6 +38,11 @@
****************************************************************************/
#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+
#include <nuttx/spi.h>
#include <arch/board/board.h>
@@ -248,8 +253,8 @@
struct str71x_spidev_s
{
struct spi_dev_s spidev; /* Externally visible part of the SPI interface */
- uint32 spibase; /* BSPIn base address */
- uint16 csbit; /* BSPIn SS bit int GPIO0 */
+ uint32_t spibase; /* BSPIn base address */
+ uint16_t csbit; /* BSPIn SS bit int GPIO0 */
};
/****************************************************************************
@@ -258,15 +263,15 @@ struct str71x_spidev_s
/* Helpers */
-static inline uint16 spi_getreg(FAR struct str71x_spidev_s *priv, ubyte offset);
-static inline void spi_putreg(FAR struct str71x_spidev_s *priv, ubyte offset, uint16 value);
+static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv, uint8_t offset);
+static inline void spi_putreg(FAR struct str71x_spidev_s *priv, uint8_t offset, uint16_t value);
/* SPI methods */
-static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, boolean selected);
-static uint32 spi_setfrequency(FAR struct spi_dev_s *dev, uint32 frequency);
-static ubyte spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
-static uint16 spi_send(FAR struct spi_dev_s *dev, uint16 wd);
+static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
+static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency);
+static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
+static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd);
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t buflen);
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t buflen);
@@ -327,7 +332,7 @@ static struct str71x_spidev_s g_spidev1 =
*
****************************************************************************/
-static inline uint16 spi_getreg(FAR struct str71x_spidev_s *priv, ubyte offset)
+static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv, uint8_t offset)
{
return getreg16(priv->spibase + offset);
}
@@ -348,7 +353,7 @@ static inline uint16 spi_getreg(FAR struct str71x_spidev_s *priv, ubyte offset)
*
****************************************************************************/
-static inline void spi_putreg(FAR struct str71x_spidev_s *priv, ubyte offset, uint16 value)
+static inline void spi_putreg(FAR struct str71x_spidev_s *priv, uint8_t offset, uint16_t value)
{
putreg16(value, priv->spibase + offset);
}
@@ -364,17 +369,17 @@ static inline void spi_putreg(FAR struct str71x_spidev_s *priv, ubyte offset, ui
* Input Parameters:
* dev - Device-specific state data
* devid - Identifies the device to select
- * selected - TRUE: slave selected, FALSE: slave de-selected
+ * selected - true: slave selected, false: slave de-selected
*
* Returned Value:
* None
*
****************************************************************************/
-static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, boolean selected)
+static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
{
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
- uint16 reg16;
+ uint16_t reg16;
DEBUGASSERT(priv && priv->spibase);
@@ -439,11 +444,11 @@ static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, boolean
*
****************************************************************************/
-static uint32 spi_setfrequency(FAR struct spi_dev_s *dev, uint32 frequency)
+static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency)
{
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
- uint32 divisor;
- uint32 cr1;
+ uint32_t divisor;
+ uint32_t cr1;
DEBUGASSERT(priv && priv->spibase);
@@ -476,7 +481,7 @@ static uint32 spi_setfrequency(FAR struct spi_dev_s *dev, uint32 frequency)
cr1 = spi_getreg(priv, STR71X_BSPI_CSR1_OFFSET);
cr1 &= ~(STR71X_BSPICSR1_BSPE|STR71X_BSPICSR1_MSTR);
spi_putreg(priv, STR71X_BSPI_CSR1_OFFSET, cr1);
- spi_putreg(priv, STR71X_BSPI_CLK_OFFSET, (uint16)divisor);
+ spi_putreg(priv, STR71X_BSPI_CLK_OFFSET, (uint16_t)divisor);
/* Now we can enable the BSP in master mode */
@@ -501,10 +506,10 @@ static uint32 spi_setfrequency(FAR struct spi_dev_s *dev, uint32 frequency)
*
****************************************************************************/
-static ubyte spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
+static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
{
- ubyte ret = 0;
- uint16 reg16 = getreg16(STR71X_GPIO1_PD);
+ uint8_t ret = 0;
+ uint16_t reg16 = getreg16(STR71X_GPIO1_PD);
if ((reg16 & MMCSD_GPIO1_WPIN) != 0)
{
@@ -535,7 +540,7 @@ static ubyte spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
*
****************************************************************************/
-static uint16 spi_send(FAR struct spi_dev_s *dev, uint16 wd)
+static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)
{
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
@@ -561,7 +566,7 @@ static uint16 spi_send(FAR struct spi_dev_s *dev, uint16 wd)
/* Get the received value from the RX FIFO and return it */
- return (ubyte)(spi_getreg(priv, STR71X_BSPI_RXR_OFFSET) >> 8);
+ return (uint8_t)(spi_getreg(priv, STR71X_BSPI_RXR_OFFSET) >> 8);
}
/*************************************************************************
@@ -576,7 +581,7 @@ static uint16 spi_send(FAR struct spi_dev_s *dev, uint16 wd)
* buflen - the length of data to send from the buffer in number of words.
* The wordsize is determined by the number of bits-per-word
* selected for the SPI interface. If nbits <= 8, the data is
- * packed into ubytes; if nbits >8, the data is packed into uint16's
+ * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's
*
* Returned Value:
* None
@@ -586,8 +591,8 @@ static uint16 spi_send(FAR struct spi_dev_s *dev, uint16 wd)
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t buflen)
{
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
- FAR const ubyte *ptr = (FAR const ubyte *)buffer;
- uint16 csr2;
+ FAR const uint8_t *ptr = (FAR const uint8_t *)buffer;
+ uint16_t csr2;
DEBUGASSERT(priv && priv->spibase);
@@ -601,7 +606,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size
{
/* Send the data */
- spi_putreg(priv, STR71X_BSPI_TXR_OFFSET, ((uint16)*ptr) << 8);
+ spi_putreg(priv, STR71X_BSPI_TXR_OFFSET, ((uint16_t)*ptr) << 8);
ptr++;
buflen--;
}
@@ -621,8 +626,8 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size
(void)spi_getreg(priv, STR71X_BSPI_RXR_OFFSET);
}
- /* There is a race condition where TFNE may go FALSE just before
- * RFNE goes TRUE and this loop terminates prematurely. The nasty little
+ /* There is a race condition where TFNE may go false just before
+ * RFNE goes true and this loop terminates prematurely. The nasty little
* delay in the following solves that (it could probably be tuned to
* improve performance).
*/
@@ -648,7 +653,7 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size
* buflen - the length of data that can be received in the buffer in number
* of words. The wordsize is determined by the number of bits-per-word
* selected for the SPI interface. If nbits <= 8, the data is
- * packed into ubytes; if nbits >8, the data is packed into uint16's
+ * packed into uint8_t; if nbits >8, the data is packed into uint16_t's
*
* Returned Value:
* None
@@ -658,8 +663,8 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t buflen)
{
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
- FAR ubyte *ptr = (FAR ubyte*)buffer;
- uint32 fifobytes = 0;
+ FAR uint8_t *ptr = (FAR uint8_t*)buffer;
+ uint32_t fifobytes = 0;
DEBUGASSERT(priv && priv->spibase);
@@ -685,7 +690,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t bu
while ((spi_getreg(priv, STR71X_BSPI_CSR2_OFFSET) & STR71X_BSPICSR2_RFNE) != 0)
{
- *ptr++ = (ubyte)(spi_getreg(priv, STR71X_BSPI_RXR_OFFSET) >> 8);
+ *ptr++ = (uint8_t)(spi_getreg(priv, STR71X_BSPI_RXR_OFFSET) >> 8);
fifobytes--;
}
}
@@ -713,7 +718,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port)
{
FAR struct spi_dev_s *ret;
irqstate_t flags;
- uint16 reg16;
+ uint16_t reg16;
flags = irqsave();
#ifdef CONFIG_STR71X_BSPI0