diff options
| author | Bernard Xiong <[email protected]> | 2017-12-11 19:16:23 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2017-12-11 19:16:23 +0800 |
| commit | 7515fb9d83c4673f5b1f679b7f4febf02efed9d5 (patch) | |
| tree | e76abd1f415825b7415b2efc1076a58ff8a43268 /components | |
| parent | b6fef984a65bc5b49727eafed54c61432a40f34c (diff) | |
| parent | 2e0c91a950ebdece533bda44a53bacde2c070346 (diff) | |
[lwIP] merge net/Kconfig
Diffstat (limited to 'components')
| -rw-r--r-- | components/drivers/spi/SConscript | 8 | ||||
| -rw-r--r-- | components/drivers/spi/spi_flash_sfud.c | 11 | ||||
| -rw-r--r-- | components/net/Kconfig | 4 | ||||
| -rw-r--r-- | components/net/lwip-1.4.1/src/lwipopts.h | 5 | ||||
| -rw-r--r-- | components/net/lwip-2.0.2/src/lwipopts.h | 5 |
5 files changed, 24 insertions, 9 deletions
diff --git a/components/drivers/spi/SConscript b/components/drivers/spi/SConscript index 5608bdcab6..01cc608c2b 100644 --- a/components/drivers/spi/SConscript +++ b/components/drivers/spi/SConscript @@ -1,8 +1,10 @@ from building import * +import rtconfig cwd = GetCurrentDir() src = ['spi_core.c', 'spi_dev.c'] CPPPATH = [cwd, cwd + '/../include'] +LOCAL_CCFLAGS = '' src_device = [] @@ -32,9 +34,13 @@ if GetDepend('RT_USING_SFUD'): CPPPATH += [cwd + '/sfud/inc'] if GetDepend('RT_SFUD_USING_SFDP'): src_device += ['sfud/src/sfud_sfdp.c'] + if rtconfig.CROSS_TOOL == 'gcc': + LOCAL_CCFLAGS += ' -std=c99' + elif rtconfig.CROSS_TOOL == 'keil': + LOCAL_CCFLAGS += ' --c99' src += src_device -group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SPI'], CPPPATH = CPPPATH) +group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SPI'], CPPPATH = CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS) Return('group') diff --git a/components/drivers/spi/spi_flash_sfud.c b/components/drivers/spi/spi_flash_sfud.c index aef6babe0e..c94effa613 100644 --- a/components/drivers/spi/spi_flash_sfud.c +++ b/components/drivers/spi/spi_flash_sfud.c @@ -165,11 +165,6 @@ static void spi_unlock(const sfud_spi *spi) { rt_mutex_release(&(rtt_dev->lock)); } -static void retry_delay_ms(void) { - /* millisecond delay */ - rt_tick_from_millisecond(1); -} - static void retry_delay_100us(void) { /* 100 microsecond delay */ rt_thread_delay((RT_TICK_PER_SECOND * 1 + 9999) / 10000); @@ -242,6 +237,9 @@ rt_spi_flash_device_t rt_sfud_flash_probe(const char *spi_flash_dev_name, const rt_spi_flash_device_t rtt_dev = RT_NULL; sfud_flash *sfud_dev = RT_NULL; char *spi_flash_dev_name_bak = RT_NULL, *spi_dev_name_bak = RT_NULL; + /* using default flash SPI configuration for initialize SPI Flash + * @note you also can change the SPI to other configuration after initialized finish */ + struct rt_spi_configuration cfg = RT_SFUD_DEFAULT_SPI_CFG; extern sfud_err sfud_device_init(sfud_flash *flash); RT_ASSERT(spi_flash_dev_name); @@ -269,9 +267,6 @@ rt_spi_flash_device_t rt_sfud_flash_probe(const char *spi_flash_dev_name, const goto error; } sfud_dev->spi.name = spi_dev_name_bak; - /* using default flash SPI configuration for initialize SPI Flash - * @note you also can change the SPI to other configuration after initialized finish */ - struct rt_spi_configuration cfg = RT_SFUD_DEFAULT_SPI_CFG; rt_spi_configure(rtt_dev->rt_spi_device, &cfg); /* initialize lock */ rt_mutex_init(&(rtt_dev->lock), spi_flash_dev_name, RT_IPC_FLAG_FIFO); diff --git a/components/net/Kconfig b/components/net/Kconfig index e81b966093..af375e6c03 100644 --- a/components/net/Kconfig +++ b/components/net/Kconfig @@ -97,6 +97,10 @@ config RT_USING_LWIP default n endif + config RT_MEMP_NUM_NETCONN + int "the number of struct netconns" + default 8 + config RT_LWIP_PBUF_NUM int "the number of PBUF" default 16 diff --git a/components/net/lwip-1.4.1/src/lwipopts.h b/components/net/lwip-1.4.1/src/lwipopts.h index 0b177b5894..8b4d38961e 100644 --- a/components/net/lwip-1.4.1/src/lwipopts.h +++ b/components/net/lwip-1.4.1/src/lwipopts.h @@ -93,6 +93,11 @@ should be set high. */ #define MEMP_NUM_PBUF 16 +/* the number of struct netconns */ +#ifdef RT_MEMP_NUM_NETCONN +#define MEMP_NUM_NETCONN RT_MEMP_NUM_NETCONN +#endif + /* the number of UDP protocol control blocks. One per active RAW "connection". */ #ifdef RT_LWIP_RAW_PCB_NUM #define MEMP_NUM_RAW_PCB RT_LWIP_RAW_PCB_NUM diff --git a/components/net/lwip-2.0.2/src/lwipopts.h b/components/net/lwip-2.0.2/src/lwipopts.h index 76e3a0f948..988b9668db 100644 --- a/components/net/lwip-2.0.2/src/lwipopts.h +++ b/components/net/lwip-2.0.2/src/lwipopts.h @@ -105,6 +105,11 @@ should be set high. */ #define MEMP_NUM_PBUF 32 //16 +/* the number of struct netconns */ +#ifdef RT_MEMP_NUM_NETCONN +#define MEMP_NUM_NETCONN RT_MEMP_NUM_NETCONN +#endif + /* the number of UDP protocol control blocks. One per active RAW "connection". */ #ifdef RT_LWIP_RAW_PCB_NUM #define MEMP_NUM_RAW_PCB RT_LWIP_RAW_PCB_NUM |
