diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-27 12:38:04 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-27 12:38:04 -0600 |
commit | 62eef54bf66ef31d91527b2e6f2fa0042226101e (patch) | |
tree | d19685e549edee0f88d725778a6bddd173d26da0 | |
parent | 9035e07120245e2ebeaf4a2102f843300c5319e8 (diff) | |
download | nuttx-62eef54bf66ef31d91527b2e6f2fa0042226101e.tar.gz nuttx-62eef54bf66ef31d91527b2e6f2fa0042226101e.tar.bz2 nuttx-62eef54bf66ef31d91527b2e6f2fa0042226101e.zip |
LPC4357 EVB: Ooops got sense of the LED GPIO backward
-rw-r--r-- | nuttx/configs/lpc4357-evb/README.txt | 2 | ||||
-rw-r--r-- | nuttx/configs/lpc4357-evb/include/board.h | 2 | ||||
-rw-r--r-- | nuttx/configs/lpc4357-evb/src/lpc4357-evb.h | 4 | ||||
-rw-r--r-- | nuttx/configs/lpc4357-evb/src/lpc43_autoleds.c | 28 | ||||
-rw-r--r-- | nuttx/configs/lpc4357-evb/src/lpc43_userleds.c | 4 | ||||
-rwxr-xr-x | nuttx/drivers/eeprom/README.txt | 4 |
6 files changed, 26 insertions, 18 deletions
diff --git a/nuttx/configs/lpc4357-evb/README.txt b/nuttx/configs/lpc4357-evb/README.txt index 694343a44..12a166866 100644 --- a/nuttx/configs/lpc4357-evb/README.txt +++ b/nuttx/configs/lpc4357-evb/README.txt @@ -555,7 +555,7 @@ LED and Pushbuttons LED SIGNAL MCU D6 LED_3V3 PE_& GPIO7[7] - LED is grounded and a high output illuminates the LED. + A low output illuminates the LED. If CONFIG_ARCH_LEDS is defined, the LED will be controlled as follows for NuttX debug functionality (where NC means "No Change"). diff --git a/nuttx/configs/lpc4357-evb/include/board.h b/nuttx/configs/lpc4357-evb/include/board.h index 5e23e4cb8..e882a103e 100644 --- a/nuttx/configs/lpc4357-evb/include/board.h +++ b/nuttx/configs/lpc4357-evb/include/board.h @@ -207,7 +207,7 @@ * D6 LED_3V3 PE_7 GPIO7[7] * ---- ------- ------------- * - * LED is grounded and a high output illuminates the LED. + * A low output illuminates the LED. * * LED index values for use with lpc43_setled() */ diff --git a/nuttx/configs/lpc4357-evb/src/lpc4357-evb.h b/nuttx/configs/lpc4357-evb/src/lpc4357-evb.h index fd4d111f1..2c3fd8caf 100644 --- a/nuttx/configs/lpc4357-evb/src/lpc4357-evb.h +++ b/nuttx/configs/lpc4357-evb/src/lpc4357-evb.h @@ -59,7 +59,7 @@ * D6 LED_3V3 PE_7 GPIO7[7] * ---- ------- ------------- * - * LED is grounded and a high output illuminates the LED. + * A low output illuminates the LED. * * Definitions to configure LED pins as GPIOs: * @@ -72,7 +72,7 @@ /* Definitions to configure LED GPIO as outputs */ -#define GPIO_LED (GPIO_MODE_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT7 | GPIO_PIN7) +#define GPIO_LED (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT7 | GPIO_PIN7) /* Button definitions *******************************************************/ /* to be provided */ diff --git a/nuttx/configs/lpc4357-evb/src/lpc43_autoleds.c b/nuttx/configs/lpc4357-evb/src/lpc43_autoleds.c index 3983391c1..70d832867 100644 --- a/nuttx/configs/lpc4357-evb/src/lpc43_autoleds.c +++ b/nuttx/configs/lpc4357-evb/src/lpc43_autoleds.c @@ -155,21 +155,26 @@ void board_led_initialize(void) void board_led_on(int led) { + bool ledon = true; /* OFF. Low illuminates */ + switch (led) { default: case 0: - lpc43_gpio_write(GPIO_LED, false); /* LED OFF */ - break; + break; /* LED OFF until state 1 */ - case 2: /* LED no change */ - break; + case 2: + return; /* LED no change */ case 1: case 3: - lpc43_gpio_write(GPIO_LED, true); /* LED ON */ + ledon = false; /* LED ON. Low illuminates */ break; } + + /* Turn LED on or off, depending on state */ + + lpc43_gpio_write(GPIO_LED, ledon); } /**************************************************************************** @@ -183,13 +188,16 @@ void board_led_off(int led) default: case 0: case 1: - case 2: - break; /* LED no change */ - case 3: - lpc43_gpio_write(GPIO_LED, false); /* LED OFF */ - break; + break; /* LED OFF */ + + case 2: + return; /* LED no change */ } + + /* LED OFF, Low illuminates */ + + lpc43_gpio_write(GPIO_LED, true); } #endif /* CONFIG_ARCH_LEDS */ diff --git a/nuttx/configs/lpc4357-evb/src/lpc43_userleds.c b/nuttx/configs/lpc4357-evb/src/lpc43_userleds.c index c6d532ab7..1e2816cb2 100644 --- a/nuttx/configs/lpc4357-evb/src/lpc43_userleds.c +++ b/nuttx/configs/lpc4357-evb/src/lpc43_userleds.c @@ -149,7 +149,7 @@ void lpc43_setled(int led, bool ledon) { if (led == BOARD_LED) { - lpc43_gpio_write(GPIO_LED, ledon); + lpc43_gpio_write(GPIO_LED, !ledon); } } @@ -159,7 +159,7 @@ void lpc43_setled(int led, bool ledon) void lpc43_setleds(uint8_t ledset) { - lpc43_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) != 0); + lpc43_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0); } #endif /* !CONFIG_ARCH_LEDS */ diff --git a/nuttx/drivers/eeprom/README.txt b/nuttx/drivers/eeprom/README.txt index c577865d1..eaa8727c3 100755 --- a/nuttx/drivers/eeprom/README.txt +++ b/nuttx/drivers/eeprom/README.txt @@ -83,12 +83,12 @@ File Systems int losetup(FAR const char *devname, FAR const char *filename, uint16_t sectsize, off_t offset, bool readonly); - Give a file or character devices at 'filename', losetup will create the + Given a file or character devices at 'filename', losetup will create the block device 'devname' using a bogus sector size of sectsize. 'offset' is normally zero but can be used to provide an offset into the EEPROM where the block driver data starts; The EEPROM block driver can also be read- only. - There is a corresponding function that will destory the loop device: + There is a corresponding function that will destroy the loop device: int loteardown(FAR const char *devname); |