From 4965d0dc9967847e76795ef625de9a0e49228a80 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 4 Jun 2016 11:29:27 -0600 Subject: [PATCH 01/16] KL and LPC11: Perform similar name change as for STM32: xyz_lowputc -> up_putc --- arch/arm/src/kl/Make.defs | 2 +- arch/arm/src/kl/{kl_lowgetc.c => kl_getc.c} | 33 ++++----------- arch/arm/src/kl/{kl_lowgetc.h => kl_getc.h} | 40 ++++--------------- arch/arm/src/kl/kl_serial.c | 19 +-------- arch/arm/src/lpc11xx/Make.defs | 2 +- .../lpc11xx/{lpc11_lowgetc.c => lpc11_getc.c} | 30 +++----------- .../lpc11xx/{lpc11_lowgetc.h => lpc11_getc.h} | 37 +++-------------- arch/arm/src/lpc11xx/lpc11_serial.c | 16 -------- arch/arm/src/stm32/Make.defs | 2 +- arch/arm/src/stm32/stm32.h | 2 +- .../stm32/{stm32_lowgetc.c => stm32_getc.c} | 2 +- .../stm32/{stm32_lowgetc.h => stm32_getc.h} | 8 ++-- 12 files changed, 36 insertions(+), 157 deletions(-) rename arch/arm/src/kl/{kl_lowgetc.c => kl_getc.c} (77%) rename arch/arm/src/kl/{kl_lowgetc.h => kl_getc.h} (69%) rename arch/arm/src/lpc11xx/{lpc11_lowgetc.c => lpc11_getc.c} (79%) rename arch/arm/src/lpc11xx/{lpc11_lowgetc.h => lpc11_getc.h} (70%) rename arch/arm/src/stm32/{stm32_lowgetc.c => stm32_getc.c} (99%) rename arch/arm/src/stm32/{stm32_lowgetc.h => stm32_getc.h} (91%) diff --git a/arch/arm/src/kl/Make.defs b/arch/arm/src/kl/Make.defs index 68c58af802..39308b6948 100644 --- a/arch/arm/src/kl/Make.defs +++ b/arch/arm/src/kl/Make.defs @@ -70,7 +70,7 @@ CMN_CSRCS += up_dumpnvic.c endif CHIP_ASRCS = -CHIP_CSRCS = kl_clockconfig.c kl_gpio.c kl_idle.c kl_irq.c kl_lowgetc.c +CHIP_CSRCS = kl_clockconfig.c kl_gpio.c kl_idle.c kl_irq.c kl_getc.c CHIP_CSRCS += kl_lowputc.c kl_serial.c kl_start.c kl_cfmconfig.c ifneq ($(CONFIG_SCHED_TICKLESS),y) diff --git a/arch/arm/src/kl/kl_lowgetc.c b/arch/arm/src/kl/kl_getc.c similarity index 77% rename from arch/arm/src/kl/kl_lowgetc.c rename to arch/arm/src/kl/kl_getc.c index 8033ee732f..cee3195dd0 100644 --- a/arch/arm/src/kl/kl_lowgetc.c +++ b/arch/arm/src/kl/kl_getc.c @@ -1,7 +1,7 @@ /**************************************************************************** - * arch/arm/src/kl/kl_lowgetc.c + * arch/arm/src/kl/kl_getc.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -41,40 +41,23 @@ #include -#include -#include - -#include "up_internal.h" #include "up_arch.h" #include "kl_config.h" -#include "kl_lowgetc.h" - -#include "chip/kl_uart.h" +#include "kl_getc.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Select UART parameters for the selected console */ #if defined(CONFIG_UART0_SERIAL_CONSOLE) # define CONSOLE_BASE KL_UART0_BASE -# define CONSOLE_FREQ BOARD_CORECLK_FREQ -# define CONSOLE_BAUD CONFIG_UART0_BAUD -# define CONSOLE_BITS CONFIG_UART0_BITS -# define CONSOLE_PARITY CONFIG_UART0_PARITY #elif defined(CONFIG_UART1_SERIAL_CONSOLE) # define CONSOLE_BASE KL_UART1_BASE -# define CONSOLE_FREQ BOARD_BUSCLK_FREQ -# define CONSOLE_BAUD CONFIG_UART1_BAUD -# define CONSOLE_BITS CONFIG_UART1_BITS -# define CONSOLE_PARITY CONFIG_UART1_PARITY #elif defined(CONFIG_UART2_SERIAL_CONSOLE) # define CONSOLE_BASE KL_UART2_BASE -# define CONSOLE_FREQ BOARD_BUSCLK_FREQ -# define CONSOLE_BAUD CONFIG_UART2_BAUD -# define CONSOLE_BITS CONFIG_UART2_BITS -# define CONSOLE_PARITY CONFIG_UART2_PARITY #endif /**************************************************************************** @@ -82,14 +65,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: kl_lowgetc + * Name: up_getc * * Description: * Input one byte from the serial console * ****************************************************************************/ -int kl_lowgetc(void) +int up_getc(void) { uint8_t ch = 0; @@ -98,11 +81,11 @@ int kl_lowgetc(void) * we have data in the buffer to read. */ - while ((getreg8(CONSOLE_BASE+KL_UART_S1_OFFSET) & UART_S1_RDRF) == 0); + while ((getreg8(CONSOLE_BASE + KL_UART_S1_OFFSET) & UART_S1_RDRF) == 0); /* Then read a character from the UART data register */ - ch = getreg8(CONSOLE_BASE+KL_UART_D_OFFSET); + ch = getreg8(CONSOLE_BASE + KL_UART_D_OFFSET); #endif return (int)ch; diff --git a/arch/arm/src/kl/kl_lowgetc.h b/arch/arm/src/kl/kl_getc.h similarity index 69% rename from arch/arm/src/kl/kl_lowgetc.h rename to arch/arm/src/kl/kl_getc.h index 625f534964..aff6b2a0b3 100644 --- a/arch/arm/src/kl/kl_lowgetc.h +++ b/arch/arm/src/kl/kl_getc.h @@ -1,7 +1,7 @@ /************************************************************************************ - * arch/arm/src/kl/kl_lowgetc.h + * arch/arm/src/kl/kl_getc.h * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,42 +33,16 @@ * ************************************************************************************/ -#ifndef __ARCH_ARM_SRC_KL_KINETIS_LOWGETC_H -#define __ARCH_ARM_SRC_KL_KINETIS_LOWGETC_H +#ifndef __ARCH_ARM_SRC_KL_KINETIS_GETC_H +#define __ARCH_ARM_SRC_KL_KINETIS_GETC_H /************************************************************************************ * Included Files ************************************************************************************/ #include + #include "kl_config.h" +#include "chip/kl_uart.h" -/************************************************************************************ - * Public Data - ************************************************************************************/ - -#ifndef __ASSEMBLY__ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/************************************************************************************ - * Public Function Prototypes - ************************************************************************************/ - -#ifdef HAVE_SERIAL_CONSOLE -int kl_lowgetc(void); -#endif - -#undef EXTERN -#if defined(__cplusplus) -} -#endif -#endif /* __ASSEMBLY__ */ -#endif /* __ARCH_ARM_SRC_KL_KINETIS_LOWGETC_H */ +#endif /* __ARCH_ARM_SRC_KL_KINETIS_GETC_H */ diff --git a/arch/arm/src/kl/kl_serial.c b/arch/arm/src/kl/kl_serial.c index fb135ca795..fab56a34d5 100644 --- a/arch/arm/src/kl/kl_serial.c +++ b/arch/arm/src/kl/kl_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/kl/kl_serial.c * - * Copyright (C) 2013-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -59,15 +59,14 @@ #include "kl_config.h" #include "kl_lowputc.h" -#include "kl_lowgetc.h" #include "chip.h" #include "kl_gpio.h" #include "chip/kl_uart.h" - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Some sanity checks *******************************************************/ /* Is there at least one UART enabled and configured as a RS-232 device? */ @@ -958,18 +957,4 @@ int up_putc(int ch) return ch; } -/**************************************************************************** - * Name: up_getc - * - * Description: - * Provide priority, low-level access to support OS debug writes - * - ****************************************************************************/ - -int up_getc(void) -{ - /* Check for LF */ - - return kl_lowgetc(); -} #endif /* USE_SERIALDRIVER */ diff --git a/arch/arm/src/lpc11xx/Make.defs b/arch/arm/src/lpc11xx/Make.defs index a40c143545..fd0e046964 100644 --- a/arch/arm/src/lpc11xx/Make.defs +++ b/arch/arm/src/lpc11xx/Make.defs @@ -71,7 +71,7 @@ endif CHIP_ASRCS = CHIP_CSRCS = lpc11_clockconfig.c lpc11_gpio.c lpc11_i2c.c lpc11_idle.c -CHIP_CSRCS += lpc11_irq.c lpc11_lowputc.c lpc11_lowgetc.c lpc11_serial.c +CHIP_CSRCS += lpc11_irq.c lpc11_lowputc.c lpc11_getc.c lpc11_serial.c CHIP_CSRCS += lpc11_spi.c lpc11_ssp.c lpc11_start.c # Configuration-dependent LPC11xx files diff --git a/arch/arm/src/lpc11xx/lpc11_lowgetc.c b/arch/arm/src/lpc11xx/lpc11_getc.c similarity index 79% rename from arch/arm/src/lpc11xx/lpc11_lowgetc.c rename to arch/arm/src/lpc11xx/lpc11_getc.c index a4c0f81c54..9d733b2e3e 100644 --- a/arch/arm/src/lpc11xx/lpc11_lowgetc.c +++ b/arch/arm/src/lpc11xx/lpc11_getc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/lpc11/lpc11_lowgetc.c + * arch/arm/src/lpc11/lpc11_getc.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,42 +41,22 @@ #include -#include -#include - -#include "up_internal.h" #include "up_arch.h" -#include "chip/lpc11_syscon.h" -#include "chip/lpc11_uart.h" - -#include "lpc11_gpio.h" -#include "lpc11_lowgetc.h" -#include "lpc11_serial.h" +#include "lpc11_getc.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Select UART parameters for the selected console */ #if defined(CONFIG_UART0_SERIAL_CONSOLE) # define CONSOLE_BASE LPC11_UART0_BASE -# define CONSOLE_FREQ BOARD_CORECLK_FREQ -# define CONSOLE_BAUD CONFIG_UART0_BAUD -# define CONSOLE_BITS CONFIG_UART0_BITS -# define CONSOLE_PARITY CONFIG_UART0_PARITY #elif defined(CONFIG_UART1_SERIAL_CONSOLE) # define CONSOLE_BASE LPC11_UART1_BASE -# define CONSOLE_FREQ BOARD_BUSCLK_FREQ -# define CONSOLE_BAUD CONFIG_UART1_BAUD -# define CONSOLE_BITS CONFIG_UART1_BITS -# define CONSOLE_PARITY CONFIG_UART1_PARITY #elif defined(CONFIG_UART2_SERIAL_CONSOLE) # define CONSOLE_BASE LPC11_UART2_BASE -# define CONSOLE_FREQ BOARD_BUSCLK_FREQ -# define CONSOLE_BAUD CONFIG_UART2_BAUD -# define CONSOLE_BITS CONFIG_UART2_BITS -# define CONSOLE_PARITY CONFIG_UART2_PARITY #endif /**************************************************************************** @@ -84,14 +64,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: lpc11_lowgetc + * Name: up_getc * * Description: * Input one byte from the serial console * ****************************************************************************/ -int lpc11_lowgetc(void) +int up_getc(void) { uint8_t ch = 0; diff --git a/arch/arm/src/lpc11xx/lpc11_lowgetc.h b/arch/arm/src/lpc11xx/lpc11_getc.h similarity index 70% rename from arch/arm/src/lpc11xx/lpc11_lowgetc.h rename to arch/arm/src/lpc11xx/lpc11_getc.h index 932898f395..e00864bfc4 100644 --- a/arch/arm/src/lpc11xx/lpc11_lowgetc.h +++ b/arch/arm/src/lpc11xx/lpc11_getc.h @@ -1,5 +1,5 @@ /************************************************************************************ - * arch/arm/src/lpc11/lpc11_lowgetc.h + * arch/arm/src/lpc11/lpc11_getc.h * * Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ************************************************************************************/ -#ifndef __ARCH_ARM_SRC_LPC11XX_LPC11_LOWGETC_H -#define __ARCH_ARM_SRC_LPC11XX_LPC11_LOWGETC_H +#ifndef __ARCH_ARM_SRC_LPC11XX_LPC11_GETC_H +#define __ARCH_ARM_SRC_LPC11XX_LPC11_GETC_H /************************************************************************************ * Included Files @@ -42,33 +42,6 @@ #include #include "lpc11_serial.h" +#include "chip/lpc11_uart.h" -/************************************************************************************ - * Public Data - ************************************************************************************/ - -#ifndef __ASSEMBLY__ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -#ifdef HAVE_SERIAL_CONSOLE -int lpc11_lowgetc(void); -#endif - -#undef EXTERN -#if defined(__cplusplus) -} -#endif -#endif /* __ASSEMBLY__ */ -#endif /* __ARCH_ARM_SRC_LPC11XX_LPC11_LOWGETC_H */ +#endif /* __ARCH_ARM_SRC_LPC11XX_LPC11_GETC_H */ diff --git a/arch/arm/src/lpc11xx/lpc11_serial.c b/arch/arm/src/lpc11xx/lpc11_serial.c index 6bbd488a3e..86e3feb11c 100644 --- a/arch/arm/src/lpc11xx/lpc11_serial.c +++ b/arch/arm/src/lpc11xx/lpc11_serial.c @@ -64,7 +64,6 @@ #include "chip.h" #include "chip/lpc11_uart.h" #include "lpc11_gpio.h" -#include "lpc11_lowgetc.h" #include "lpc11_serial.h" /**************************************************************************** @@ -1041,19 +1040,4 @@ int up_putc(int ch) return ch; } -/**************************************************************************** - * Name: up_getc - * - * Description: - * Provide priority, low-level access to support OS debug writes - * - ****************************************************************************/ - -int up_getc(void) -{ - /* Check for LF */ - - return lpc11_lowgetc(); -} - #endif /* USE_SERIALDRIVER */ diff --git a/arch/arm/src/stm32/Make.defs b/arch/arm/src/stm32/Make.defs index 2cc901fb2c..0b691c270d 100644 --- a/arch/arm/src/stm32/Make.defs +++ b/arch/arm/src/stm32/Make.defs @@ -110,7 +110,7 @@ CHIP_ASRCS = CHIP_CSRCS = stm32_allocateheap.c stm32_start.c stm32_rcc.c stm32_lse.c CHIP_CSRCS += stm32_lsi.c stm32_gpio.c stm32_exti_gpio.c stm32_flash.c -CHIP_CSRCS += stm32_irq.c stm32_dma.c stm32_lowputc.c stm32_lowgetc.c +CHIP_CSRCS += stm32_irq.c stm32_dma.c stm32_lowputc.c stm32_getc.c CHIP_CSRCS += stm32_serial.c stm32_spi.c stm32_sdio.c stm32_tim.c CHIP_CSRCS += stm32_waste.c stm32_ccm.c stm32_uid.c stm32_capture.c diff --git a/arch/arm/src/stm32/stm32.h b/arch/arm/src/stm32/stm32.h index 8e75e4e9d7..7ae058ee05 100644 --- a/arch/arm/src/stm32/stm32.h +++ b/arch/arm/src/stm32/stm32.h @@ -92,7 +92,7 @@ #include "stm32_usbdev.h" #include "stm32_wdg.h" #include "stm32_lowputc.h" -#include "stm32_lowgetc.h" +#include "stm32_getc.h" #include "stm32_eth.h" #endif /* __ARCH_ARM_SRC_STM32_STM32_H */ diff --git a/arch/arm/src/stm32/stm32_lowgetc.c b/arch/arm/src/stm32/stm32_getc.c similarity index 99% rename from arch/arm/src/stm32/stm32_lowgetc.c rename to arch/arm/src/stm32/stm32_getc.c index 4e080b828a..e5fbb0fa3d 100644 --- a/arch/arm/src/stm32/stm32_lowgetc.c +++ b/arch/arm/src/stm32/stm32_getc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/stm32/stm32_lowgetc.c + * arch/arm/src/stm32/stm32_getc.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/arch/arm/src/stm32/stm32_lowgetc.h b/arch/arm/src/stm32/stm32_getc.h similarity index 91% rename from arch/arm/src/stm32/stm32_lowgetc.h rename to arch/arm/src/stm32/stm32_getc.h index 624e6272f4..651165fba5 100644 --- a/arch/arm/src/stm32/stm32_lowgetc.h +++ b/arch/arm/src/stm32/stm32_getc.h @@ -1,5 +1,5 @@ /************************************************************************************ - * arch/arm/src/stm32/stm32_lowgetc.h + * arch/arm/src/stm32/stm32_getc.h * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ************************************************************************************/ -#ifndef __ARCH_ARM_SRC_STM32_STM32_LOWGETC_H -#define __ARCH_ARM_SRC_STM32_STM32_LOWGETC_H +#ifndef __ARCH_ARM_SRC_STM32_STM32_GETC_H +#define __ARCH_ARM_SRC_STM32_STM32_GETC_H /************************************************************************************ * Included Files @@ -44,4 +44,4 @@ #include "chip.h" -#endif /* __ARCH_ARM_SRC_STM32_STM32_LOWGETC_H */ +#endif /* __ARCH_ARM_SRC_STM32_STM32_GETC_H */ From 6b84637a5ba6a61058e68c7148322e7d7a6f3b35 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 4 Jun 2016 13:04:13 -0600 Subject: [PATCH 02/16] Update some comments --- arch/arm/src/kl/kl_getc.c | 4 ++++ arch/arm/src/lpc11xx/lpc11_getc.c | 6 +++++- arch/arm/src/stm32/stm32_getc.c | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/kl/kl_getc.c b/arch/arm/src/kl/kl_getc.c index cee3195dd0..8b63ec217d 100644 --- a/arch/arm/src/kl/kl_getc.c +++ b/arch/arm/src/kl/kl_getc.c @@ -70,6 +70,10 @@ * Description: * Input one byte from the serial console * + * REVIST: If used with the serial driver enabled, then this could + * interfere with the serial driver operations. Serial interrupts should + * be disabled when this function executes in that case. + * ****************************************************************************/ int up_getc(void) diff --git a/arch/arm/src/lpc11xx/lpc11_getc.c b/arch/arm/src/lpc11xx/lpc11_getc.c index 9d733b2e3e..f809e9d343 100644 --- a/arch/arm/src/lpc11xx/lpc11_getc.c +++ b/arch/arm/src/lpc11xx/lpc11_getc.c @@ -67,7 +67,11 @@ * Name: up_getc * * Description: - * Input one byte from the serial console + * Input one byte from the serial console. + * + * REVIST: If used with the serial driver enabled, then this could + * interfere with the serial driver operations. Serial interrupts should + * be disabled when this function executes in that case. * ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_getc.c b/arch/arm/src/stm32/stm32_getc.c index e5fbb0fa3d..de9020bab4 100644 --- a/arch/arm/src/stm32/stm32_getc.c +++ b/arch/arm/src/stm32/stm32_getc.c @@ -89,6 +89,10 @@ * Description: * Read one byte from the serial console * + * REVIST: If used with the serial driver enabled, then this could + * interfere with the serial driver operations. Serial interrupts should + * be disabled when this function executes in that case. + * ****************************************************************************/ int up_getc(void) From 1c4d0686c8d6a881c8ae2c3574b80e5faea79b79 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 4 Jun 2016 16:05:36 -0600 Subject: [PATCH 03/16] LPC43xx: Fill out some missing GPIO interrupt logic --- arch/arm/src/lpc43xx/Kconfig | 13 +++--- arch/arm/src/lpc43xx/lpc43_gpioint.c | 68 ++++++++++++++++++---------- 2 files changed, 50 insertions(+), 31 deletions(-) diff --git a/arch/arm/src/lpc43xx/Kconfig b/arch/arm/src/lpc43xx/Kconfig index d29fe32781..9a2bcad916 100644 --- a/arch/arm/src/lpc43xx/Kconfig +++ b/arch/arm/src/lpc43xx/Kconfig @@ -150,13 +150,6 @@ endchoice # LPC43XX Boot Configuration menu "LPC43xx Peripheral Support" - -config LPC43_GPIO_IRQ - bool "GPIO interrupt support" - default n - ---help--- - Enable support for GPIO interrupts - config LPC43_ADC0 bool "ADC0" default n @@ -321,6 +314,12 @@ config LPC43_WWDT endmenu # LPC43xx Peripheral Support +config LPC43_GPIO_IRQ + bool "GPIO interrupt support" + default n + ---help--- + Enable support for GPIO interrupts + if LPC43_ETHERNET menu "Ethernet MAC configuration" diff --git a/arch/arm/src/lpc43xx/lpc43_gpioint.c b/arch/arm/src/lpc43xx/lpc43_gpioint.c index 39d664aabe..328a62c85c 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpioint.c +++ b/arch/arm/src/lpc43xx/lpc43_gpioint.c @@ -181,6 +181,9 @@ int lpc43_gpioint_pinconfig(uint16_t gpiocfg) unsigned int pinint = ((gpiocfg & GPIO_PININT_MASK) >> GPIO_PININT_SHIFT); uint32_t bitmask = (1 << pinint); uint32_t regval; + uint32_t isel; + uint32_t einr; + uint32_t einf; DEBUGASSERT(port < NUM_GPIO_PORTS && pin < NUM_GPIO_PINS && GPIO_IS_PININT(gpiocfg)); @@ -226,37 +229,54 @@ int lpc43_gpioint_pinconfig(uint16_t gpiocfg) putreg32(regval, LPC43_GPIOINT_ISEL); - /* Configure the active high level or rising edge + /* Configure the active level or rising/falling edge * - * TODO: this works for edge sensitive, but not level sensitive, active - * level is only controlled in IENF. + * ISEL + * 0 = Edge sensitive + * 1 = Level sensitive + * EINR 0-7: + * 0 = Disable rising edge or level interrupt. + * 1 = Enable rising edge or level interrupt. + * EINF 0-7: + * 0 = Disable falling edge interrupt or set active interrupt level + * LOW. + * 1 = Enable falling edge interrupt enabled or set active interrupt + * level HIGH */ - regval = getreg32(LPC43_GPIOINT_IENR); - if (GPIO_IS_ACTIVE_HI(gpiocfg)) + isel = getreg32(LPC43_GPIOINT_ISEL) & ~bitmask; + einr = getreg32(LPC43_GPIOINT_IENR) & ~bitmask; + einf = getreg32(LPC43_GPIOINT_IENF) & ~bitmask; + + switch (gpiocfg & GPIO_INT_MASK) { - regval |= bitmask; - } - else - { - regval &= ~bitmask; + case GPIO_INT_LEVEL_HI: + einf |= bitmask; /* Enable active level HI */ + case GPIO_INT_LEVEL_LOW: + isel |= bitmask; /* Level sensitive */ + einr |= bitmask; /* Enable level interrupt */ + break; + + case GPIO_INT_EDGE_RISING: + einr |= bitmask; /* Enable rising edge interrupt */ + break; + + case GPIO_INT_EDGE_BOTH: + einr |= bitmask; /* Enable rising edge interrupt */ + case GPIO_INT_EDGE_FALLING: + einf |= bitmask; /* Enable falling edge interrupt */ + break; + + /* Default is edge sensitive but with both edges disabled. */ + + default: + break; } - putreg32(regval, LPC43_GPIOINT_IENR); + putreg32(isel, LPC43_GPIOINT_ISEL); + putreg32(einr, LPC43_GPIOINT_IENR); + putreg32(einf, LPC43_GPIOINT_IENF); - /* Configure the active high low or falling edge */ - - regval = getreg32(LPC43_GPIOINT_IENF); - if (GPIO_IS_ACTIVE_LOW(gpiocfg)) - { - regval |= bitmask; - } - else - { - regval &= ~bitmask; - } - - putreg32(regval, LPC43_GPIOINT_IENF); return OK; } From 7671087abcc59a52ac604c2549328f9ddeca4826 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 4 Jun 2016 16:36:27 -0600 Subject: [PATCH 04/16] LPC32xx GPIO interrupts: Remove some old logic that should not be there. --- arch/arm/src/lpc43xx/lpc43_gpioint.c | 32 ++++++++-------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/arch/arm/src/lpc43xx/lpc43_gpioint.c b/arch/arm/src/lpc43xx/lpc43_gpioint.c index 328a62c85c..bfe660070e 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpioint.c +++ b/arch/arm/src/lpc43xx/lpc43_gpioint.c @@ -180,7 +180,7 @@ int lpc43_gpioint_pinconfig(uint16_t gpiocfg) unsigned int pin = ((gpiocfg & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT); unsigned int pinint = ((gpiocfg & GPIO_PININT_MASK) >> GPIO_PININT_SHIFT); uint32_t bitmask = (1 << pinint); - uint32_t regval; + uint32_t pinsel; uint32_t isel; uint32_t einr; uint32_t einf; @@ -200,35 +200,21 @@ int lpc43_gpioint_pinconfig(uint16_t gpiocfg) if (pinint < 4) { - regval = getreg32(LPC43_SCU_PINTSEL0); - regval &= ~SCU_PINTSEL0_MASK(pinint); - regval |= ((pin << SCU_PINTSEL0_INTPIN_SHIFT(pinint)) | + pinsel = getreg32(LPC43_SCU_PINTSEL0); + pinsel &= ~SCU_PINTSEL0_MASK(pinint); + pinsel |= ((pin << SCU_PINTSEL0_INTPIN_SHIFT(pinint)) | (port << SCU_PINTSEL0_PORTSEL_SHIFT(pinint))); - putreg32(regval, LPC43_SCU_PINTSEL0); + putreg32(pinsel, LPC43_SCU_PINTSEL0); } else { - regval = getreg32(LPC43_SCU_PINTSEL1); - regval &= ~SCU_PINTSEL1_MASK(pinint); - regval |= ((pin << SCU_PINTSEL1_INTPIN_SHIFT(pinint)) | + pinsel = getreg32(LPC43_SCU_PINTSEL1); + pinsel &= ~SCU_PINTSEL1_MASK(pinint); + pinsel |= ((pin << SCU_PINTSEL1_INTPIN_SHIFT(pinint)) | (port << SCU_PINTSEL1_PORTSEL_SHIFT(pinint))); - putreg32(regval, LPC43_SCU_PINTSEL1); + putreg32(pinsel, LPC43_SCU_PINTSEL1); } - /* Set level or edge sensitive */ - - regval = getreg32(LPC43_GPIOINT_ISEL); - if (GPIO_IS_LEVEL(gpiocfg)) - { - regval |= bitmask; - } - else - { - regval &= ~bitmask; - } - - putreg32(regval, LPC43_GPIOINT_ISEL); - /* Configure the active level or rising/falling edge * * ISEL From f2c65a4c47e41f86410eabac517ce81b3f2e1399 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 12:13:11 -0600 Subject: [PATCH 05/16] Refresh configurations --- configs/sam3u-ek/nxwm/defconfig | 27 +++++++++++++++--------- configs/sama5d3x-ek/nxwm/defconfig | 23 +++++++++++++++----- configs/samv71-xult/nxwm/defconfig | 30 ++++++++++++++++++--------- configs/shenzhou/nxwm/defconfig | 24 +++++++++++++++------ configs/stm3220g-eval/nxwm/defconfig | 25 +++++++++++++++------- configs/stm3240g-eval/knxwm/defconfig | 25 +++++++++++++++------- configs/stm3240g-eval/nxwm/defconfig | 25 +++++++++++++++------- 7 files changed, 127 insertions(+), 52 deletions(-) diff --git a/configs/sam3u-ek/nxwm/defconfig b/configs/sam3u-ek/nxwm/defconfig index fb8be1e62e..35a17fe3f1 100644 --- a/configs/sam3u-ek/nxwm/defconfig +++ b/configs/sam3u-ek/nxwm/defconfig @@ -76,6 +76,7 @@ CONFIG_ARCH="arm" # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set +# CONFIG_ARCH_CHIP_IMX6 is not set # CONFIG_ARCH_CHIP_KINETIS is not set # CONFIG_ARCH_CHIP_KL is not set # CONFIG_ARCH_CHIP_LM is not set @@ -94,6 +95,7 @@ CONFIG_ARCH_CHIP_SAM34=y # CONFIG_ARCH_CHIP_SAMV7 is not set # CONFIG_ARCH_CHIP_STM32 is not set # CONFIG_ARCH_CHIP_STM32F7 is not set +# CONFIG_ARCH_CHIP_STM32L4 is not set # CONFIG_ARCH_CHIP_STR71X is not set # CONFIG_ARCH_CHIP_TMS570 is not set # CONFIG_ARCH_CHIP_MOXART is not set @@ -115,12 +117,15 @@ CONFIG_ARCH_CORTEXM3=y # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-m" CONFIG_ARCH_CHIP="sam34" +# CONFIG_ARM_TOOLCHAIN_IAR is not set +CONFIG_ARM_TOOLCHAIN_GNU=y # CONFIG_ARMV7M_USEBASEPRI is not set CONFIG_ARCH_HAVE_CMNVECTOR=y # CONFIG_ARMV7M_CMNVECTOR is not set # CONFIG_ARMV7M_LAZYFPU is not set # CONFIG_ARCH_HAVE_FPU is not set # CONFIG_ARCH_HAVE_DPFPU is not set +# CONFIG_ARCH_HAVE_TRUSTZONE is not set CONFIG_ARM_HAVE_MPU_UNIFIED=y # CONFIG_ARM_MPU is not set @@ -131,6 +136,7 @@ CONFIG_ARM_HAVE_MPU_UNIFIED=y # CONFIG_ARMV7M_HAVE_DCACHE is not set # CONFIG_ARMV7M_HAVE_ITCM is not set # CONFIG_ARMV7M_HAVE_DTCM is not set +# CONFIG_ARMV7M_TOOLCHAIN_IARL is not set CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y # CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set # CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set @@ -508,10 +514,14 @@ CONFIG_ADS7843E_THRESHY=39 # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set # CONFIG_IOEXPANDER is not set + +# +# LCD Driver Support +# CONFIG_LCD=y # -# Common LCD Settings +# Common Graphic LCD Settings # # CONFIG_LCD_CONSOLE is not set # CONFIG_LCD_NOGETRUN is not set @@ -540,11 +550,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_LCD_RLANDSCAPE is not set # CONFIG_LCD_ILI9341 is not set # CONFIG_LCD_RA8875 is not set - -# -# Alphanumeric/Segment LCD Devices -# -# CONFIG_LCD_LCD1602 is not set +# CONFIG_SLCD is not set # # LED Support @@ -586,10 +592,6 @@ CONFIG_UART0_SERIALDRIVER=y # CONFIG_USART7_SERIALDRIVER is not set # CONFIG_USART8_SERIALDRIVER is not set # CONFIG_OTHER_UART_SERIALDRIVER is not set - -# -# USART Configuration -# CONFIG_MCU_SERIAL=y CONFIG_STANDARD_SERIAL=y # CONFIG_SERIAL_IFLOWCONTROL is not set @@ -675,6 +677,7 @@ CONFIG_NX_LCDDRIVER=y CONFIG_NX_NPLANES=1 CONFIG_NX_BGCOLOR=0x0 CONFIG_NX_WRITEONLY=y +# CONFIG_NX_UPDATE is not set # # Supported Pixel Depths @@ -838,6 +841,8 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set +CONFIG_ARCH_HAVE_TLS=y +# CONFIG_TLS is not set # CONFIG_LIBC_NETDB is not set # @@ -956,6 +961,7 @@ CONFIG_CXX_NEWLONG=y # Network Utilities # # CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_ESP8266 is not set # CONFIG_NETUTILS_FTPC is not set # CONFIG_NETUTILS_JSON is not set # CONFIG_NETUTILS_SMTP is not set @@ -1078,6 +1084,7 @@ CONFIG_NXWIDGETS_LISTENERSTACK=1596 # NXWidget Configuration # CONFIG_NXWIDGETS_BPP=16 +# CONFIG_NXWIDGETS_GREYSCALE is not set CONFIG_NXWIDGETS_SIZEOFCHAR=1 # diff --git a/configs/sama5d3x-ek/nxwm/defconfig b/configs/sama5d3x-ek/nxwm/defconfig index 5e533abf0d..682488ad76 100644 --- a/configs/sama5d3x-ek/nxwm/defconfig +++ b/configs/sama5d3x-ek/nxwm/defconfig @@ -80,6 +80,7 @@ CONFIG_ARCH="arm" # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set +# CONFIG_ARCH_CHIP_IMX6 is not set # CONFIG_ARCH_CHIP_KINETIS is not set # CONFIG_ARCH_CHIP_KL is not set # CONFIG_ARCH_CHIP_LM is not set @@ -98,6 +99,7 @@ CONFIG_ARCH_CHIP_SAMA5=y # CONFIG_ARCH_CHIP_SAMV7 is not set # CONFIG_ARCH_CHIP_STM32 is not set # CONFIG_ARCH_CHIP_STM32F7 is not set +# CONFIG_ARCH_CHIP_STM32L4 is not set # CONFIG_ARCH_CHIP_STR71X is not set # CONFIG_ARCH_CHIP_TMS570 is not set # CONFIG_ARCH_CHIP_MOXART is not set @@ -119,9 +121,12 @@ CONFIG_ARCH_CORTEXA5=y # CONFIG_ARCH_CORTEXR7F is not set CONFIG_ARCH_FAMILY="armv7-a" CONFIG_ARCH_CHIP="sama5" +# CONFIG_ARM_TOOLCHAIN_IAR is not set +# CONFIG_ARM_TOOLCHAIN_GNU is not set CONFIG_ARCH_HAVE_FPU=y # CONFIG_ARCH_HAVE_DPFPU is not set CONFIG_ARCH_FPU=y +# CONFIG_ARCH_HAVE_TRUSTZONE is not set # CONFIG_ARM_HAVE_MPU_UNIFIED is not set CONFIG_ARCH_HAVE_LOWVECTORS=y CONFIG_ARCH_LOWVECTORS=y @@ -131,6 +136,8 @@ CONFIG_ARCH_LOWVECTORS=y # ARMv7-A Configuration Options # # CONFIG_ARMV7A_HAVE_GICv2 is not set +# CONFIG_ARMV7A_HAVE_GTM is not set +# CONFIG_ARMV7A_HAVE_PTM is not set # CONFIG_ARMV7A_HAVE_L2CC is not set # CONFIG_ARMV7A_HAVE_L2CC_PL310 is not set # CONFIG_ARMV7A_TOOLCHAIN_BUILDROOT is not set @@ -182,7 +189,6 @@ CONFIG_SAMA5_HAVE_PIOE=y # CONFIG_SAMA5_HAVE_TC is not set # CONFIG_SAMA5_HAVE_TC1 is not set # CONFIG_SAMA5_HAVE_TC2 is not set -# CONFIG_ARCH_HAVE_TRUSTZONE is not set # CONFIG_SAMA5_HAVE_TWI3 is not set # CONFIG_SAMA5_HAVE_VDEC is not set # CONFIG_SAMA5_FLEXCOM is not set @@ -603,7 +609,12 @@ CONFIG_INPUT=y # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set # CONFIG_IOEXPANDER is not set + +# +# LCD Driver Support +# # CONFIG_LCD is not set +# CONFIG_SLCD is not set # # LED Support @@ -645,10 +656,6 @@ CONFIG_USART1_SERIALDRIVER=y # CONFIG_USART7_SERIALDRIVER is not set # CONFIG_USART8_SERIALDRIVER is not set # CONFIG_OTHER_UART_SERIALDRIVER is not set - -# -# USART Configuration -# CONFIG_MCU_SERIAL=y CONFIG_STANDARD_SERIAL=y # CONFIG_SERIAL_IFLOWCONTROL is not set @@ -743,6 +750,7 @@ CONFIG_NX_NPLANES=1 CONFIG_NX_BGCOLOR=0x95fa # CONFIG_NX_ANTIALIASING is not set # CONFIG_NX_WRITEONLY is not set +# CONFIG_NX_UPDATE is not set # # Supported Pixel Depths @@ -907,6 +915,8 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set +CONFIG_ARCH_HAVE_TLS=y +# CONFIG_TLS is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -945,6 +955,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_ADC is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CPUHOG is not set @@ -1031,6 +1042,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # Network Utilities # # CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_ESP8266 is not set # CONFIG_NETUTILS_FTPC is not set # CONFIG_NETUTILS_JSON is not set # CONFIG_NETUTILS_SMTP is not set @@ -1155,6 +1167,7 @@ CONFIG_NXWIDGETS_LISTENERSTACK=1596 # NXWidget Configuration # CONFIG_NXWIDGETS_BPP=16 +# CONFIG_NXWIDGETS_GREYSCALE is not set CONFIG_NXWIDGETS_SIZEOFCHAR=1 # diff --git a/configs/samv71-xult/nxwm/defconfig b/configs/samv71-xult/nxwm/defconfig index f0734a4218..cae079b2d7 100644 --- a/configs/samv71-xult/nxwm/defconfig +++ b/configs/samv71-xult/nxwm/defconfig @@ -264,6 +264,13 @@ CONFIG_SAMV7_USART0=y # CONFIG_SAMV7_USART2 is not set # CONFIG_SAMV7_WDT is not set # CONFIG_SAMV7_RSWDT is not set +# CONFIG_SAMV7_JTAG_DISABLE is not set +CONFIG_SAMV7_JTAG_FULL_ENABLE=y +# CONFIG_SAMV7_JTAG_FULL_SW_ENABLE is not set +# CONFIG_SAMV7_JTAG_SW_ENABLE is not set +# CONFIG_SAMV7_ERASE_DISABLE is not set +CONFIG_SAMV7_ERASE_ENABLE=y +# CONFIG_SAMV7_SYSTEMRESET is not set CONFIG_SAMV7_GPIO_IRQ=y CONFIG_SAMV7_GPIOA_IRQ=y CONFIG_SAMV7_GPIOB_IRQ=y @@ -549,10 +556,14 @@ CONFIG_MXT_THRESHY=8 # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set # CONFIG_IOEXPANDER is not set + +# +# LCD Driver Support +# CONFIG_LCD=y # -# Common LCD Settings +# Common Graphic LCD Settings # # CONFIG_LCD_CONSOLE is not set CONFIG_LCD_NOGETRUN=y @@ -581,11 +592,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_LCD_RLANDSCAPE is not set # CONFIG_LCD_ILI9341 is not set # CONFIG_LCD_RA8875 is not set - -# -# Alphanumeric/Segment LCD Devices -# -# CONFIG_LCD_LCD1602 is not set +# CONFIG_SLCD is not set # # LED Support @@ -639,10 +646,12 @@ CONFIG_AT25_SPIFREQUENCY=20000000 # CONFIG_MTD_AT45DB is not set # CONFIG_MTD_M25P is not set # CONFIG_MTD_S25FL1 is not set +# CONFIG_MTD_N25QXXX is not set # CONFIG_MTD_SMART is not set # CONFIG_MTD_RAMTRON is not set # CONFIG_MTD_SST25 is not set # CONFIG_MTD_SST25XX is not set +# CONFIG_MTD_SST26 is not set # CONFIG_MTD_SST39FV is not set # CONFIG_MTD_W25 is not set # CONFIG_EEPROM is not set @@ -676,10 +685,6 @@ CONFIG_USART0_SERIALDRIVER=y # CONFIG_USART7_SERIALDRIVER is not set # CONFIG_USART8_SERIALDRIVER is not set # CONFIG_OTHER_UART_SERIALDRIVER is not set - -# -# USART Configuration -# CONFIG_MCU_SERIAL=y CONFIG_STANDARD_SERIAL=y # CONFIG_SERIAL_IFLOWCONTROL is not set @@ -773,6 +778,7 @@ CONFIG_NX_LCDDRIVER=y CONFIG_NX_NPLANES=1 CONFIG_NX_BGCOLOR=0x95fa CONFIG_NX_WRITEONLY=y +# CONFIG_NX_UPDATE is not set # # Supported Pixel Depths @@ -1036,6 +1042,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # File System Utilities # +# CONFIG_FSUTILS_FLASH_ERASEALL is not set # CONFIG_FSUTILS_INIFILE is not set # CONFIG_FSUTILS_PASSWD is not set @@ -1067,6 +1074,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # Network Utilities # # CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_ESP8266 is not set # CONFIG_NETUTILS_FTPC is not set # CONFIG_NETUTILS_JSON is not set # CONFIG_NETUTILS_SMTP is not set @@ -1191,6 +1199,7 @@ CONFIG_NXWIDGETS_LISTENERSTACK=2048 # NXWidget Configuration # CONFIG_NXWIDGETS_BPP=16 +# CONFIG_NXWIDGETS_GREYSCALE is not set CONFIG_NXWIDGETS_SIZEOFCHAR=1 # @@ -1362,6 +1371,7 @@ CONFIG_NXWM_HEXCALCULATOR_FONTID=5 # CONFIG_SYSTEM_FREE is not set # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set +# CONFIG_SYSTEM_FLASH_ERASEALL is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_HEX2BIN is not set CONFIG_SYSTEM_I2CTOOL=y diff --git a/configs/shenzhou/nxwm/defconfig b/configs/shenzhou/nxwm/defconfig index a59049abed..78e803db84 100644 --- a/configs/shenzhou/nxwm/defconfig +++ b/configs/shenzhou/nxwm/defconfig @@ -417,6 +417,10 @@ CONFIG_STM32_JTAG_FULL_ENABLE=y # CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG is not set # CONFIG_STM32_FORCEPOWER is not set # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set + +# +# Timer Configuration +# # CONFIG_STM32_TIM1_CAP is not set # CONFIG_STM32_TIM3_CAP is not set # CONFIG_STM32_TIM4_CAP is not set @@ -428,9 +432,17 @@ CONFIG_STM32_SERIALDRIVER=y # # U[S]ART Configuration # + +# +# U[S]ART Device Configuration +# CONFIG_STM32_USART2_SERIALDRIVER=y # CONFIG_STM32_USART2_1WIREDRIVER is not set # CONFIG_USART2_RS485 is not set + +# +# Serial Driver Configuration +# # CONFIG_SERIAL_DISABLE_REORDERING is not set # CONFIG_STM32_FLOWCONTROL_BROKEN is not set # CONFIG_STM32_USART_BREAKS is not set @@ -752,10 +764,14 @@ CONFIG_ADS7843E_THRESHY=51 # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set # CONFIG_IOEXPANDER is not set + +# +# LCD Driver Support +# CONFIG_LCD=y # -# Common LCD Settings +# Common Graphic LCD Settings # # CONFIG_LCD_CONSOLE is not set CONFIG_LCD_NOGETRUN=y @@ -787,11 +803,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_LCD_RLANDSCAPE is not set # CONFIG_LCD_ILI9341 is not set # CONFIG_LCD_RA8875 is not set - -# -# Alphanumeric/Segment LCD Devices -# -# CONFIG_LCD_LCD1602 is not set +# CONFIG_SLCD is not set # # LED Support diff --git a/configs/stm3220g-eval/nxwm/defconfig b/configs/stm3220g-eval/nxwm/defconfig index fadce2d0ab..3c430c4fd6 100644 --- a/configs/stm3220g-eval/nxwm/defconfig +++ b/configs/stm3220g-eval/nxwm/defconfig @@ -434,6 +434,10 @@ CONFIG_STM32_JTAG_FULL_ENABLE=y # CONFIG_STM32_FORCEPOWER is not set # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set # CONFIG_STM32_FSMC_SRAM is not set + +# +# Timer Configuration +# # CONFIG_STM32_TIM1_CAP is not set # CONFIG_STM32_TIM3_CAP is not set # CONFIG_STM32_TIM4_CAP is not set @@ -451,9 +455,17 @@ CONFIG_STM32_SERIALDRIVER=y # # U[S]ART Configuration # + +# +# U[S]ART Device Configuration +# CONFIG_STM32_USART3_SERIALDRIVER=y # CONFIG_STM32_USART3_1WIREDRIVER is not set # CONFIG_USART3_RS485 is not set + +# +# Serial Driver Configuration +# # CONFIG_SERIAL_DISABLE_REORDERING is not set # CONFIG_STM32_FLOWCONTROL_BROKEN is not set # CONFIG_STM32_USART_BREAKS is not set @@ -766,10 +778,14 @@ CONFIG_STMPE811_TEMP_DISABLE=y # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set # CONFIG_IOEXPANDER is not set + +# +# LCD Driver Support +# CONFIG_LCD=y # -# Common LCD Settings +# Common Graphic LCD Settings # # CONFIG_LCD_CONSOLE is not set CONFIG_LCD_NOGETRUN=y @@ -797,12 +813,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_LCD_RLANDSCAPE is not set # CONFIG_LCD_ILI9341 is not set # CONFIG_LCD_RA8875 is not set - -# -# Alphanumeric/Segment LCD Devices -# -# CONFIG_LCD_LCD1602 is not set -# CONFIG_LCD_BACKPACK is not set +# CONFIG_SLCD is not set # # LED Support diff --git a/configs/stm3240g-eval/knxwm/defconfig b/configs/stm3240g-eval/knxwm/defconfig index fe098b72e1..851b298219 100644 --- a/configs/stm3240g-eval/knxwm/defconfig +++ b/configs/stm3240g-eval/knxwm/defconfig @@ -444,6 +444,10 @@ CONFIG_STM32_JTAG_FULL_ENABLE=y # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set # CONFIG_STM32_CCMEXCLUDE is not set # CONFIG_STM32_FSMC_SRAM is not set + +# +# Timer Configuration +# # CONFIG_STM32_TIM1_CAP is not set # CONFIG_STM32_TIM2_CAP is not set # CONFIG_STM32_TIM3_CAP is not set @@ -462,9 +466,17 @@ CONFIG_STM32_SERIALDRIVER=y # # U[S]ART Configuration # + +# +# U[S]ART Device Configuration +# CONFIG_STM32_USART3_SERIALDRIVER=y # CONFIG_STM32_USART3_1WIREDRIVER is not set # CONFIG_USART3_RS485 is not set + +# +# Serial Driver Configuration +# # CONFIG_SERIAL_DISABLE_REORDERING is not set # CONFIG_STM32_FLOWCONTROL_BROKEN is not set # CONFIG_STM32_USART_BREAKS is not set @@ -761,10 +773,14 @@ CONFIG_STMPE811_TEMP_DISABLE=y # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set # CONFIG_IOEXPANDER is not set + +# +# LCD Driver Support +# CONFIG_LCD=y # -# Common LCD Settings +# Common Graphic LCD Settings # # CONFIG_LCD_CONSOLE is not set CONFIG_LCD_NOGETRUN=y @@ -792,12 +808,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_LCD_RLANDSCAPE is not set # CONFIG_LCD_ILI9341 is not set # CONFIG_LCD_RA8875 is not set - -# -# Alphanumeric/Segment LCD Devices -# -# CONFIG_LCD_LCD1602 is not set -# CONFIG_LCD_BACKPACK is not set +# CONFIG_SLCD is not set # # LED Support diff --git a/configs/stm3240g-eval/nxwm/defconfig b/configs/stm3240g-eval/nxwm/defconfig index e3e15ad43e..d2bfa0fa65 100644 --- a/configs/stm3240g-eval/nxwm/defconfig +++ b/configs/stm3240g-eval/nxwm/defconfig @@ -437,6 +437,10 @@ CONFIG_STM32_JTAG_FULL_ENABLE=y # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set # CONFIG_STM32_CCMEXCLUDE is not set # CONFIG_STM32_FSMC_SRAM is not set + +# +# Timer Configuration +# # CONFIG_STM32_TIM1_CAP is not set # CONFIG_STM32_TIM2_CAP is not set # CONFIG_STM32_TIM3_CAP is not set @@ -455,9 +459,17 @@ CONFIG_STM32_SERIALDRIVER=y # # U[S]ART Configuration # + +# +# U[S]ART Device Configuration +# CONFIG_STM32_USART3_SERIALDRIVER=y # CONFIG_STM32_USART3_1WIREDRIVER is not set # CONFIG_USART3_RS485 is not set + +# +# Serial Driver Configuration +# # CONFIG_SERIAL_DISABLE_REORDERING is not set # CONFIG_STM32_FLOWCONTROL_BROKEN is not set # CONFIG_STM32_USART_BREAKS is not set @@ -769,10 +781,14 @@ CONFIG_STMPE811_TEMP_DISABLE=y # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set # CONFIG_IOEXPANDER is not set + +# +# LCD Driver Support +# CONFIG_LCD=y # -# Common LCD Settings +# Common Graphic LCD Settings # # CONFIG_LCD_CONSOLE is not set CONFIG_LCD_NOGETRUN=y @@ -800,12 +816,7 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_LCD_RLANDSCAPE is not set # CONFIG_LCD_ILI9341 is not set # CONFIG_LCD_RA8875 is not set - -# -# Alphanumeric/Segment LCD Devices -# -# CONFIG_LCD_LCD1602 is not set -# CONFIG_LCD_BACKPACK is not set +# CONFIG_SLCD is not set # # LED Support From 37dd4e52a1d62a27c66aa54a73e5e03161808c6a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 12:13:56 -0600 Subject: [PATCH 06/16] boardctl.h needs to be include-able from C++ files --- include/sys/boardctl.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/sys/boardctl.h b/include/sys/boardctl.h index 5177dd8074..b1ebe45e8f 100644 --- a/include/sys/boardctl.h +++ b/include/sys/boardctl.h @@ -265,6 +265,19 @@ struct boardioc_usbdev_ctrl_s }; #endif /* CONFIG_BOARDCTL_USBDEVCTRL */ +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ @@ -299,5 +312,10 @@ struct boardioc_usbdev_ctrl_s int boardctl(unsigned int cmd, uintptr_t arg); +#undef EXTERN +#if defined(__cplusplus) +} +#endif + #endif /* CONFIG_LIB_BOARDCTL */ #endif /* __INCLUDE_SYS_BOARDCTL_H */ From f36e342f3889bc0761bfb09bf90ea8487c80d761 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 12:14:18 -0600 Subject: [PATCH 07/16] tools/tesbuild.sh will now build NxWM configurations --- tools/testbuild.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/tools/testbuild.sh b/tools/testbuild.sh index 9546c92144..c9f30a178b 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -34,22 +34,27 @@ WD=$PWD nuttx=$WD/../nuttx +UNLINK=./unlink.sh progname=$0 host=linux wenv=cygwin sizet=uint +APPSDIR=../apps +NXWDIR=../NxWidgets unset testfile function showusage { echo "" - echo "USAGE: $progname [-w|l] [-c|n] [-s] " + echo "USAGE: $progname [-w|l] [-c|n] [-s] [-a ] [-n ] " echo " $progname -h" echo "" echo "Where:" echo " -w|l selects Windows (w) or Linux (l). Default: Linux" echo " -c|n selects Windows native (n) or Cygwin (c). Default Cygwin" echo " -s Use C++ unsigned long size_t in new operator. Default unsigned int" + echo " -a provides the relative path to the apps/ directory. Default ../apps" + echo " -n provides the relative path to the NxWidgets/ directory. Default ../NxWidgets" echo " -h will show this help test and terminate" echo " selects the list of configurations to test. No default" echo "" @@ -78,6 +83,14 @@ while [ ! -z "$1" ]; do -s ) sizet=long ;; + -a ) + shift + APPSDIR="$1" + ;; + -n ) + shift + NXWDIR="$1" + ;; -h ) showusage ;; @@ -122,6 +135,15 @@ function distclean { fi } +# Check if build is NxWM and clean + +function nxcheck { + unset nxconfig + if [ -d $NXWDIR ]; then + nxconfig=`grep CONFIG_NXWM=y $nuttx/.config` + fi +} + # Configure for the next build function configure { @@ -196,6 +218,33 @@ function configure { make olddefconfig 1>/dev/null 2>&1 } +# Build the NxWidgets libraries + +function nxbuild { + if [ -e $APPSDIR/internal ]; then + $UNLINK $APPSDIR/internal + fi + + if [ ! -z "$nxconfig" ]; then + echo " Building NxWidgets..." + echo "------------------------------------------------------------------------------------" + + cd $nuttx/$NXTOOLS || { echo "Failed to CD to $NXTOOLS"; exit 1; } + ./install.sh $nuttx/$APPSDIR nxwm 1>/dev/null + + cd $nuttx || { echo "Failed to CD to $nuttx"; exit 1; } + make -i context 1>/dev/null + + cd $nuttx/$NXWIDGETSDIR || { echo "Failed to CD to $NXWIDGETSDIR"; exit 1; } + make -i TOPDIR=$nuttx clean 1>/dev/null + make -i TOPDIR=$nuttx 1>/dev/null + + cd $nuttx/$NXWMDIR || { echo "Failed to CD to $NXWMDIR"; exit 1; } + make -i TOPDIR=$nuttx clean 1>/dev/null + make -i TOPDIR=$nuttx 1>/dev/null + fi +} + # Perform the next build function build { @@ -209,14 +258,27 @@ function build { function dotest { echo "------------------------------------------------------------------------------------" + nxcheck distclean configure + nxbuild build } # Perform the build test for each entry in the test list file -export APPSDIR=../apps +if [ ! -d $APPSDIR ]; then + export "ERROR: No directory found at $APPSDIR" + exit 1 +fi + +export APPSDIR + +if [ -d $NXWDIR ]; then + NXWIDGETSDIR=$NXWDIR/libnxwidgets + NXWMDIR=$NXWDIR/nxwm + NXTOOLS=$NXWDIR/tools +fi # Shouldn't have to do this From ba0040fe1f948dae8f33f7819bce27f9ceff3440 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 13:18:43 -0600 Subject: [PATCH 08/16] NxWM configurations need boardctl() with touchscreen support --- configs/sam3u-ek/nxwm/defconfig | 2 +- configs/sama5d3x-ek/nxwm/defconfig | 2 +- configs/shenzhou/nxwm/defconfig | 2 +- configs/stm3220g-eval/nxwm/defconfig | 11 ++++++++++- configs/stm3240g-eval/knxwm/defconfig | 11 ++++++++++- configs/stm3240g-eval/nxwm/defconfig | 11 ++++++++++- 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/configs/sam3u-ek/nxwm/defconfig b/configs/sam3u-ek/nxwm/defconfig index 35a17fe3f1..407a4e34d5 100644 --- a/configs/sam3u-ek/nxwm/defconfig +++ b/configs/sam3u-ek/nxwm/defconfig @@ -341,7 +341,7 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_TSCTEST is not set +CONFIG_BOARDCTL_TSCTEST=y # CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set diff --git a/configs/sama5d3x-ek/nxwm/defconfig b/configs/sama5d3x-ek/nxwm/defconfig index 682488ad76..bc5e3694ac 100644 --- a/configs/sama5d3x-ek/nxwm/defconfig +++ b/configs/sama5d3x-ek/nxwm/defconfig @@ -443,7 +443,7 @@ CONFIG_SAMA5D3xEK_TSD_DEVMINOR=0 # CONFIG_SAMA5D3xEK_SLOWCLOCK is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_TSCTEST is not set +CONFIG_BOARDCTL_TSCTEST=y # CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set diff --git a/configs/shenzhou/nxwm/defconfig b/configs/shenzhou/nxwm/defconfig index 78e803db84..22489a72ce 100644 --- a/configs/shenzhou/nxwm/defconfig +++ b/configs/shenzhou/nxwm/defconfig @@ -591,7 +591,7 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_TSCTEST is not set +CONFIG_BOARDCTL_TSCTEST=y # CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set diff --git a/configs/stm3220g-eval/nxwm/defconfig b/configs/stm3220g-eval/nxwm/defconfig index 3c430c4fd6..5ee92bfc04 100644 --- a/configs/stm3220g-eval/nxwm/defconfig +++ b/configs/stm3220g-eval/nxwm/defconfig @@ -605,7 +605,14 @@ CONFIG_NSH_MMCSDSLOTNO=0 # CONFIG_STM32_ILI9325_DISABLE is not set CONFIG_STM3220G_LCD=y CONFIG_LCD_RDSHIFT=5 -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_RESET is not set +# CONFIG_BOARDCTL_UNIQUEID is not set +CONFIG_BOARDCTL_TSCTEST=y +# CONFIG_BOARDCTL_ADCTEST is not set +# CONFIG_BOARDCTL_PWMTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features @@ -1364,6 +1371,7 @@ CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_EXAMPLES_UDPBLASTER is not set # CONFIG_EXAMPLES_DISCOVER is not set # CONFIG_EXAMPLES_WEBSERVER is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WGET is not set @@ -1557,6 +1565,7 @@ CONFIG_NXWIDGETS=y # NX Server/Device Configuration # CONFIG_NXWIDGETS_FLICKERFREE=y +# CONFIG_NXWIDGETS_EXTERNINIT is not set CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGET_SERVERINIT=y CONFIG_NXWIDGETS_SERVERPRIO=110 diff --git a/configs/stm3240g-eval/knxwm/defconfig b/configs/stm3240g-eval/knxwm/defconfig index 851b298219..9d2baf17c6 100644 --- a/configs/stm3240g-eval/knxwm/defconfig +++ b/configs/stm3240g-eval/knxwm/defconfig @@ -598,7 +598,14 @@ CONFIG_STM3240G_LCD_RDSHIFT=5 # CONFIG_STM3240G_ILI9325_DISABLE is not set CONFIG_STM3240G_BOARDINIT_PRIO=196 CONFIG_STM3240G_BOARDINIT_STACK=2048 -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_RESET is not set +# CONFIG_BOARDCTL_UNIQUEID is not set +CONFIG_BOARDCTL_TSCTEST=y +# CONFIG_BOARDCTL_ADCTEST is not set +# CONFIG_BOARDCTL_PWMTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features @@ -1187,6 +1194,7 @@ CONFIG_CXX_NEWLONG=y # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set # CONFIG_EXAMPLES_WEBSERVER is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set @@ -1243,6 +1251,7 @@ CONFIG_NXWIDGETS=y # NX Server/Device Configuration # CONFIG_NXWIDGETS_FLICKERFREE=y +# CONFIG_NXWIDGETS_EXTERNINIT is not set CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 diff --git a/configs/stm3240g-eval/nxwm/defconfig b/configs/stm3240g-eval/nxwm/defconfig index d2bfa0fa65..677e3d58ff 100644 --- a/configs/stm3240g-eval/nxwm/defconfig +++ b/configs/stm3240g-eval/nxwm/defconfig @@ -608,7 +608,14 @@ CONFIG_STM3240G_LCD=y CONFIG_STM3240G_LCD_RDSHIFT=5 # CONFIG_STM3240G_ILI9320_DISABLE is not set # CONFIG_STM3240G_ILI9325_DISABLE is not set -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_RESET is not set +# CONFIG_BOARDCTL_UNIQUEID is not set +CONFIG_BOARDCTL_TSCTEST=y +# CONFIG_BOARDCTL_ADCTEST is not set +# CONFIG_BOARDCTL_PWMTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features @@ -1367,6 +1374,7 @@ CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_EXAMPLES_UDPBLASTER is not set # CONFIG_EXAMPLES_DISCOVER is not set # CONFIG_EXAMPLES_WEBSERVER is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WGET is not set @@ -1562,6 +1570,7 @@ CONFIG_NXWIDGETS=y # NX Server/Device Configuration # CONFIG_NXWIDGETS_FLICKERFREE=y +# CONFIG_NXWIDGETS_EXTERNINIT is not set CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGET_SERVERINIT=y CONFIG_NXWIDGETS_SERVERPRIO=110 From 7fa31493c958e5e5028679643d285aefdea630bd Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 13:19:41 -0600 Subject: [PATCH 09/16] Update tools/tesbuild.sh --- tools/testbuild.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/testbuild.sh b/tools/testbuild.sh index c9f30a178b..0a6ecb0bdf 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -34,7 +34,8 @@ WD=$PWD nuttx=$WD/../nuttx -UNLINK=./unlink.sh +TOOLSDIR=$nuttx/tools +UNLINK=$TOOLSDIR/unlink.sh progname=$0 host=linux @@ -53,7 +54,7 @@ function showusage { echo " -w|l selects Windows (w) or Linux (l). Default: Linux" echo " -c|n selects Windows native (n) or Cygwin (c). Default Cygwin" echo " -s Use C++ unsigned long size_t in new operator. Default unsigned int" - echo " -a provides the relative path to the apps/ directory. Default ../apps" + echo " -a provides the relative path to the apps/ directory. Default ../apps" echo " -n provides the relative path to the NxWidgets/ directory. Default ../NxWidgets" echo " -h will show this help test and terminate" echo " selects the list of configurations to test. No default" @@ -221,8 +222,8 @@ function configure { # Build the NxWidgets libraries function nxbuild { - if [ -e $APPSDIR/internal ]; then - $UNLINK $APPSDIR/internal + if [ -e $APPSDIR/external ]; then + $UNLINK $APPSDIR/external fi if [ ! -z "$nxconfig" ]; then @@ -232,6 +233,8 @@ function nxbuild { cd $nuttx/$NXTOOLS || { echo "Failed to CD to $NXTOOLS"; exit 1; } ./install.sh $nuttx/$APPSDIR nxwm 1>/dev/null + make -C $nuttx/$APPSDIR/external TOPDIR=$nuttx APPDIR=$nuttx/$APPSDIR TOPDIR=$nuttx clean 1>/dev/null + cd $nuttx || { echo "Failed to CD to $nuttx"; exit 1; } make -i context 1>/dev/null @@ -249,7 +252,7 @@ function nxbuild { function build { cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } - echo " Building..." + echo " Building NuttX..." echo "------------------------------------------------------------------------------------" make -i 1>/dev/null } From af43ce4f467a56774cadc49bac169b248a50912b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 15:01:16 -0600 Subject: [PATCH 10/16] Update ChangeLog --- ChangeLog | 23 ++++++++++++++++++++--- arch/arm/src/lpc43xx/lpc43_gpioint.c | 4 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0df50e18fc..36041eb279 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11884,6 +11884,23 @@ in the OS and is simply a wrapper around the MDIOC_BULKERASE IOCTL command. It used to be called (only) from apps/system/flash_eraseall, but that has been removed because it - violated the OS/applicatin interface -- by calling flash_eraseall(). - The old code can be found in the Obsoleted' repository (2016-06-03). - + violated the OS/application interface -- by calling flash_eraseall(). + The old code can be found in the Obsoleted' repository (and a revised + version can be found at apps/fsutils/flash_eraseall) (2016-06-03). + * arch/arm/src/lpc43xx: Fix errors in GPIO interrupt logic. From v01d + (phreakuencies) (2016-06-04) + * arch/arm/src/kl and lpc11xx: rename xyz_lowputc to up_putc. Remove + all references to up_lowputc, everywhere (2016-06-04). + * configs/stm32f103-minimum: Add minnsh configuration. From Alan + Carvalho de Assis (2016-06-04). + * arch/arm/src/stm32: Add the up_getc() function to STM32 in order to + support the minnsh configuration. From Alan Carvalho de Assis + (2016-06-04). + * arch/arm/src/stm32: STM32 Timer Driver: Change calculation of per- + timer pre-scaler value. Add support for all timers (2016-6-03) + * drivers/lcd: Correct conditional compilation in ST7565 driver. From + Pierre-noel Bouteville (2016-6-03) + * arch/arm/src/stm32: Correct conditional compilation in STM32 timer + capture logic. From Pierre-noel Bouteville (2016-6-03) + * arch/arm/src/efm32: Fix EFM32 FLASH conditional compilation. From + Pierre-noel Bouteville (2016-6-03) diff --git a/arch/arm/src/lpc43xx/lpc43_gpioint.c b/arch/arm/src/lpc43xx/lpc43_gpioint.c index bfe660070e..e8726420c1 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpioint.c +++ b/arch/arm/src/lpc43xx/lpc43_gpioint.c @@ -200,7 +200,7 @@ int lpc43_gpioint_pinconfig(uint16_t gpiocfg) if (pinint < 4) { - pinsel = getreg32(LPC43_SCU_PINTSEL0); + pinsel = getreg32(LPC43_SCU_PINTSEL0); pinsel &= ~SCU_PINTSEL0_MASK(pinint); pinsel |= ((pin << SCU_PINTSEL0_INTPIN_SHIFT(pinint)) | (port << SCU_PINTSEL0_PORTSEL_SHIFT(pinint))); @@ -208,7 +208,7 @@ int lpc43_gpioint_pinconfig(uint16_t gpiocfg) } else { - pinsel = getreg32(LPC43_SCU_PINTSEL1); + pinsel = getreg32(LPC43_SCU_PINTSEL1); pinsel &= ~SCU_PINTSEL1_MASK(pinint); pinsel |= ((pin << SCU_PINTSEL1_INTPIN_SHIFT(pinint)) | (port << SCU_PINTSEL1_PORTSEL_SHIFT(pinint))); From 0bd444ae47a143d4a4d8148b2b55749d60e64037 Mon Sep 17 00:00:00 2001 From: Pierre-noel Bouteville Date: Sun, 5 Jun 2016 15:35:43 -0600 Subject: [PATCH 11/16] Just update duty if frequency is not changed and PSM started. This removeis glitch or blinking when only duty is frequently changed. --- arch/arm/src/stm32/stm32_pwm.c | 152 ++++++++++++++++++++++++++++++--- 1 file changed, 138 insertions(+), 14 deletions(-) diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 06d6b2b080..d0ede86450 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -166,8 +166,8 @@ enum stm32_chanmode_e struct stm32_pwmchan_s { - uint8_t channel; /* Timer output channel: {1,..4} */ - uint32_t pincfg; /* Output pin configuration */ + uint8_t channel; /* Timer output channel: {1,..4} */ + uint32_t pincfg; /* Output pin configuration */ enum stm32_chanmode_e mode; }; @@ -176,21 +176,23 @@ struct stm32_pwmchan_s struct stm32_pwmtimer_s { FAR const struct pwm_ops_s *ops; /* PWM operations */ - uint8_t timid; /* Timer ID {1,...,17} */ - struct stm32_pwmchan_s channels[PWM_NCHANNELS]; - uint8_t timtype; /* See the TIMTYPE_* definitions */ - enum stm32_timmode_e mode; + uint8_t timid; /* Timer ID {1,...,17} */ + struct stm32_pwmchan_s channels[PWM_NCHANNELS]; + uint8_t timtype; /* See the TIMTYPE_* definitions */ + enum stm32_timmode_e mode; #ifdef CONFIG_PWM_PULSECOUNT - uint8_t irq; /* Timer update IRQ */ - uint8_t prev; /* The previous value of the RCR (pre-loaded) */ - uint8_t curr; /* The current value of the RCR (pre-loaded) */ - uint32_t count; /* Remaining pluse count */ + uint8_t irq; /* Timer update IRQ */ + uint8_t prev; /* The previous value of the RCR (pre-loaded) */ + uint8_t curr; /* The current value of the RCR (pre-loaded) */ + uint32_t count; /* Remaining pluse count */ +#else + int frequency; /* Current frequency setting */ #endif - uint32_t base; /* The base address of the timer */ - uint32_t pclk; /* The frequency of the peripheral clock + uint32_t base; /* The base address of the timer */ + uint32_t pclk; /* The frequency of the peripheral clock * that drives the timer module. */ #ifdef CONFIG_PWM_PULSECOUNT - FAR void *handle; /* Handle used for upper-half callback */ + FAR void *handle; /* Handle used for upper-half callback */ #endif }; @@ -1634,6 +1636,89 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, return OK; } +#ifndef CONFIG_PWM_PULSECOUNT +/**************************************************************************** + * Name: pwm_update_duty + * + * Description: + * Try to change only channel duty. + * + * Input parameters: + * priv - A reference to the lower half PWM driver state structure + * channel - Channel to by updated + * duty - New duty. + * + * Returned Value: + * Zero on success; a negated errno value on failure + * + ****************************************************************************/ + +static int pwm_update_duty(FAR struct stm32_pwmtimer_s *priv, uint8_t channel, + ub16_t duty) +{ + /* Register offset */ + + int ccr_offset; + + /* Calculated values */ + + uint32_t reload; + uint32_t ccr; + + DEBUGASSERT(priv != NULL); + + pwmvdbg("TIM%d channel: %d duty: %08x\n", + priv->timid, channel, duty); + +#ifndef CONFIG_PWM_MULTICHAN + DEBUGASSERT(channel == priv->channels[0].channel); + DEBUGASSERT(chan->duty >= 0 && chan->duty < uitoub16(100)); +#endif + + /* Get the reload values */ + + reload = pwm_getreg(priv, STM32_GTIM_ARR_OFFSET); + + /* Duty cycle: + * + * duty cycle = ccr / reload (fractional value) + */ + + ccr = b16toi(duty * reload + b16HALF); + + pwmvdbg("ccr: %d\n", ccr); + + switch (channel) + { + case 1: /* Register offset for Channel 1 */ + ccr_offset = STM32_GTIM_CCR1_OFFSET; + break; + + case 2: /* Register offset for Channel 2 */ + ccr_offset = STM32_GTIM_CCR2_OFFSET; + break; + + case 3: /* Register offset for Channel 3 */ + ccr_offset = STM32_GTIM_CCR3_OFFSET; + break; + + case 4: /* Register offset for Channel 4 */ + ccr_offset = STM32_GTIM_CCR4_OFFSET; + break; + + default: + pwmdbg("No such channel: %d\n", channel); + return -EINVAL; + } + + /* Set the duty cycle by writing to the CCR register for this channel */ + + pwm_putreg(priv, ccr_offset, (uint16_t)ccr); + + return OK; +} +#endif + /**************************************************************************** * Name: pwm_interrupt * @@ -2082,8 +2167,43 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev, static int pwm_start(FAR struct pwm_lowerhalf_s *dev, FAR const struct pwm_info_s *info) { + int ret = OK; FAR struct stm32_pwmtimer_s *priv = (FAR struct stm32_pwmtimer_s *)dev; - return pwm_timer(priv, info); + +#ifndef CONFIG_PWM_PULSECOUNT + /* if frequency has not changed we just update duty */ + + if ( info->frequency == priv->frequency ) + { +#ifdef CONFIG_PWM_MULTICHAN + int i; + + for (i = 0; ret == OK && i < CONFIG_PWM_NCHANNELS; i++) + { + ret = pwm_update_duty(priv,info->channels[i].channel, + info->channels[i].duty); + } +#else + ret = pwm_update_duty(priv,priv->channels[0].channel,info->duty); +#endif + } + else +#endif + { + ret = pwm_timer(priv, info); + +#ifndef CONFIG_PWM_PULSECOUNT + + /* Save current frequency */ + + if ( ret == OK ) + { + priv->frequency = info->frequency; + } +#endif + } + + return ret; } #endif @@ -2122,6 +2242,10 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev) flags = enter_critical_section(); + /* Stopped so frequency is zero */ + + priv->frequency = 0; + /* Disable further interrupts and stop the timer */ pwm_putreg(priv, STM32_GTIM_DIER_OFFSET, 0); From 053ac343fd7dbb39061de356068d9a6f7ce1d218 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 16:01:29 -0600 Subject: [PATCH 12/16] STM32 PWM: More review changes from last commit; improve handling of unsigned types --- arch/arm/src/stm32/stm32_pwm.c | 47 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index d0ede86450..8d43ddd551 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -186,7 +186,7 @@ struct stm32_pwmtimer_s uint8_t curr; /* The current value of the RCR (pre-loaded) */ uint32_t count; /* Remaining pluse count */ #else - int frequency; /* Current frequency setting */ + uint32_t frequency; /* Current frequency setting */ #endif uint32_t base; /* The base address of the timer */ uint32_t pclk; /* The frequency of the peripheral clock @@ -760,7 +760,7 @@ static struct stm32_pwmtimer_s g_pwm13dev = .irq = STM32_IRQ_TIM13, #endif .base = STM32_TIM13_BASE, - .pclk = STM32_APB1_TIM13_CLKIN, + .pclk = STM32_APB1_TIM13_CLKIN, }; #endif @@ -1068,14 +1068,14 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, DEBUGASSERT(priv != NULL && info != NULL); #if defined(CONFIG_PWM_MULTICHAN) - pwmvdbg("TIM%d frequency: %d\n", + pwmvdbg("TIM%u frequency: %u\n", priv->timid, info->frequency); #elif defined(CONFIG_PWM_PULSECOUNT) - pwmvdbg("TIM%d channel: %d frequency: %d duty: %08x count: %d\n", + pwmvdbg("TIM%u channel: %u frequency: %u duty: %08x count: %u\n", priv->timid, priv->channel, info->frequency, info->duty, info->count); #else - pwmvdbg("TIM%d channel: %d frequency: %d duty: %08x\n", + pwmvdbg("TIM%u channel: %u frequency: %u duty: %08x\n", priv->timid, priv->channel, info->frequency, info->duty); #endif @@ -1146,7 +1146,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, reload = 65535; } - pwmvdbg("TIM%d PCLK: %d frequency: %d TIMCLK: %d prescaler: %d reload: %d\n", + pwmvdbg("TIM%u PCLK: %u frequency: %u TIMCLK: %u prescaler: %u reload: %u\n", priv->timid, priv->pclk, info->frequency, timclk, prescaler, reload); /* Set up the timer CR1 register: @@ -1209,7 +1209,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, break; default: - pwmdbg("No such timer mode: %d\n", (int)priv->mode); + pwmdbg("No such timer mode: %u\n", (unsigned int)priv->mode); return -EINVAL; } } @@ -1336,7 +1336,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, if (j >= PWM_NCHANNELS) { - pwmdbg("No such channel: %d\n", channel); + pwmdbg("No such channel: %u\n", channel); return -EINVAL; } #else @@ -1352,7 +1352,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, ccr = b16toi(duty * reload + b16HALF); - pwmvdbg("ccr: %d\n", ccr); + pwmvdbg("ccr: %u\n", ccr); switch (mode) { @@ -1387,7 +1387,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, #endif default: - pwmdbg("No such mode: %d\n", (int)mode); + pwmdbg("No such mode: %u\n", (unsigned int)mode); return -EINVAL; } @@ -1494,7 +1494,7 @@ static int pwm_timer(FAR struct stm32_pwmtimer_s *priv, break; default: - pwmdbg("No such channel: %d\n", channel); + pwmdbg("No such channel: %u\n", channel); return -EINVAL; } } @@ -1667,7 +1667,7 @@ static int pwm_update_duty(FAR struct stm32_pwmtimer_s *priv, uint8_t channel, DEBUGASSERT(priv != NULL); - pwmvdbg("TIM%d channel: %d duty: %08x\n", + pwmvdbg("TIM%u channel: %u duty: %08x\n", priv->timid, channel, duty); #ifndef CONFIG_PWM_MULTICHAN @@ -1686,7 +1686,7 @@ static int pwm_update_duty(FAR struct stm32_pwmtimer_s *priv, uint8_t channel, ccr = b16toi(duty * reload + b16HALF); - pwmvdbg("ccr: %d\n", ccr); + pwmvdbg("ccr: %u\n", ccr); switch (channel) { @@ -1707,7 +1707,7 @@ static int pwm_update_duty(FAR struct stm32_pwmtimer_s *priv, uint8_t channel, break; default: - pwmdbg("No such channel: %d\n", channel); + pwmdbg("No such channel: %u\n", channel); return -EINVAL; } @@ -1795,7 +1795,7 @@ static int pwm_interrupt(struct stm32_pwmtimer_s *priv) /* Now all of the time critical stuff is done so we can do some debug output */ - pwmllvdbg("Update interrupt SR: %04x prev: %d curr: %d count: %d\n", + pwmllvdbg("Update interrupt SR: %04x prev: %u curr: %u count: %u\n", regval, priv->prev, priv->curr, priv->count); return OK; @@ -2030,7 +2030,7 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev) uint32_t pincfg; int i; - pwmvdbg("TIM%d\n", priv->timid); + pwmvdbg("TIM%u\n", priv->timid); pwm_dumpregs(priv, "Initially"); /* Enable APB1/2 clocking for timer. */ @@ -2078,7 +2078,7 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) uint32_t pincfg; int i; - pwmvdbg("TIM%d\n", priv->timid); + pwmvdbg("TIM%u\n", priv->timid); /* Make sure that the output has been stopped */ @@ -2149,7 +2149,7 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev, if (priv->timtype != TIMTYPE_ADVANCED) { - pwmdbg("ERROR: TIM%d cannot support pulse count: %d\n", + pwmdbg("ERROR: TIM%u cannot support pulse count: %u\n", priv->timid, info->count); return -EPERM; } @@ -2173,7 +2173,7 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev, #ifndef CONFIG_PWM_PULSECOUNT /* if frequency has not changed we just update duty */ - if ( info->frequency == priv->frequency ) + if (info->frequency == priv->frequency) { #ifdef CONFIG_PWM_MULTICHAN int i; @@ -2193,10 +2193,9 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev, ret = pwm_timer(priv, info); #ifndef CONFIG_PWM_PULSECOUNT - /* Save current frequency */ - if ( ret == OK ) + if (ret == OK) { priv->frequency = info->frequency; } @@ -2234,7 +2233,7 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev) uint32_t regval; irqstate_t flags; - pwmvdbg("TIM%d\n", priv->timid); + pwmvdbg("TIM%u\n", priv->timid); /* Disable interrupts momentary to stop any ongoing timer processing and * to prevent any concurrent access to the reset register. @@ -2389,7 +2388,7 @@ static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg /* There are no platform-specific ioctl commands */ - pwmvdbg("TIM%d\n", priv->timid); + pwmvdbg("TIM%u\n", priv->timid); #endif return -ENOTTY; } @@ -2419,7 +2418,7 @@ FAR struct pwm_lowerhalf_s *stm32_pwminitialize(int timer) { FAR struct stm32_pwmtimer_s *lower; - pwmvdbg("TIM%d\n", timer); + pwmvdbg("TIM%u\n", timer); switch (timer) { From dbca089c96bd609d74bf37a834712438a791a353 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 6 Jun 2016 06:48:32 -0600 Subject: [PATCH 13/16] Update TODO list --- TODO | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index b131d0205e..0ce0c457ef 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated May 28, 2016) +NuttX TODO List (Last updated June 6, 2016) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This file summarizes known NuttX bugs, limitations, inconsistencies with @@ -23,7 +23,7 @@ nuttx/: (11) Libraries (libc/, libm/) (11) File system/Generic drivers (fs/, drivers/) (8) Graphics subsystem (graphics/) - (1) Build system / Toolchains + (2) Build system / Toolchains (3) Linux/Cywgin simulation (arch/sim) (4) ARM (arch/arm/) @@ -1601,6 +1601,14 @@ o Build system Status: Open Priority: Low. + Title: NATIVE WINDOWS BUILD BROKEN + Description: The way that apps/ no generates Kmenu files depends on changes added + to apps/tools/mkkconfig.sh. Similar changes need to be made to + apps/tools/mkkconfig.bat to restore the Windows Native build. + Status: Open + Priority: Low, since I am not aware of anyone using the Windows Native build. + But, of course, very high if you want to use it. + o Other drivers (drivers/) ^^^^^^^^^^^^^^^^^^^^^^^^ From 85c6263a303f90ba9c702815abc2488b36981b7e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 14:21:02 -0600 Subject: [PATCH 14/16] tools/testbuild.sh was testing .config before configured. --- tools/testbuild.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tools/testbuild.sh b/tools/testbuild.sh index 0a6ecb0bdf..31b0f9b4ea 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -136,15 +136,6 @@ function distclean { fi } -# Check if build is NxWM and clean - -function nxcheck { - unset nxconfig - if [ -d $NXWDIR ]; then - nxconfig=`grep CONFIG_NXWM=y $nuttx/.config` - fi -} - # Configure for the next build function configure { @@ -226,6 +217,11 @@ function nxbuild { $UNLINK $APPSDIR/external fi + unset nxconfig + if [ -d $NXWDIR ]; then + nxconfig=`grep CONFIG_NXWM=y $nuttx/.config` + fi + if [ ! -z "$nxconfig" ]; then echo " Building NxWidgets..." echo "------------------------------------------------------------------------------------" @@ -261,7 +257,6 @@ function build { function dotest { echo "------------------------------------------------------------------------------------" - nxcheck distclean configure nxbuild From 3f7840f009b94bbac225103e0d08ed433acfc123 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 14:21:24 -0600 Subject: [PATCH 15/16] Fix some NxWM configuration errors --- configs/shenzhou/nxwm/defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/shenzhou/nxwm/defconfig b/configs/shenzhou/nxwm/defconfig index 22489a72ce..37411bc91f 100644 --- a/configs/shenzhou/nxwm/defconfig +++ b/configs/shenzhou/nxwm/defconfig @@ -751,7 +751,7 @@ CONFIG_INPUT=y # CONFIG_INPUT_TSC2007 is not set CONFIG_INPUT_ADS7843E=y # CONFIG_ADS7843E_MULTIPLE is not set -CONFIG_ADS7843E_SPIDEV=0 +CONFIG_ADS7843E_SPIDEV=3 CONFIG_ADS7843E_DEVMINOR=0 CONFIG_ADS7843E_SPIMODE=0 CONFIG_ADS7843E_FREQUENCY=100000 @@ -1661,7 +1661,7 @@ CONFIG_NXWM_TOUCHSCREEN_DEVINIT=y CONFIG_NXWM_TOUCHSCREEN_DEVNO=0 CONFIG_NXWM_TOUCHSCREEN_DEVPATH="/dev/input0" CONFIG_NXWM_TOUCHSCREEN_SIGNO=5 -CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO=100 +CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO=101 CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK=1596 # From 56b018d5dbec89e9200eb15256367dc9c928346e Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Mon, 6 Jun 2016 12:01:13 -0400 Subject: [PATCH 16/16] STM32: Fix typo --- arch/arm/include/stm32/chip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/stm32/chip.h b/arch/arm/include/stm32/chip.h index 98d0073c50..0a920ccee0 100644 --- a/arch/arm/include/stm32/chip.h +++ b/arch/arm/include/stm32/chip.h @@ -2430,7 +2430,7 @@ # if defined(CONFIG_ARCH_CHIP_STM32F469A) # define STM32_NETHERNET 0 /* No Ethernet MAC */ # elif defined(CONFIG_ARCH_CHIP_STM32F469I) || \ -# defined(CONFIG_ARCH_CHIP_STM32F469B) || \ + defined(CONFIG_ARCH_CHIP_STM32F469B) || \ defined(CONFIG_ARCH_CHIP_STM32F469N) # define STM32_NETHERNET 1 /* 100/100 Ethernet MAC */ # endif