diff options
| author | Bernard Xiong <[email protected]> | 2015-08-31 17:19:07 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-08-31 17:19:07 +0800 |
| commit | ec87b910114ef76abb50d899f9eb3e1a02df69e8 (patch) | |
| tree | 6a6f1a8b5e469d7ae1f901d173a35b811376d53f /components | |
| parent | 4a6647432937f60256ffc6db504f2d75c792396a (diff) | |
| parent | 918250d7bd4f531a399a331e914921928b266813 (diff) | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'components')
| -rw-r--r-- | components/drivers/serial/serial.c | 3 | ||||
| -rw-r--r-- | components/drivers/spi/spi_flash_w25qxx.c | 6 | ||||
| -rw-r--r-- | components/finsh/msh_cmd.c | 30 |
3 files changed, 38 insertions, 1 deletions
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 8744aa4657..f5a199e10b 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -27,6 +27,8 @@ * the size of ring buffer. * 2014-07-10 bernard rewrite serial framework * 2014-12-31 bernard use open_flag for poll_tx stream mode. + * 2015-05-19 Quintin fix DMA tx mod tx_dma->activated flag !=RT_FALSE BUG + * in open function. */ #include <rthw.h> @@ -302,6 +304,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag) tx_dma = (struct rt_serial_tx_dma*) rt_malloc (sizeof(struct rt_serial_tx_dma)); RT_ASSERT(tx_dma != RT_NULL); + tx_dma->activated = RT_FALSE; rt_data_queue_init(&(tx_dma->data_queue), 8, 4, RT_NULL); serial->serial_tx = tx_dma; diff --git a/components/drivers/spi/spi_flash_w25qxx.c b/components/drivers/spi/spi_flash_w25qxx.c index 6e002c38c8..2237b971c4 100644 --- a/components/drivers/spi/spi_flash_w25qxx.c +++ b/components/drivers/spi/spi_flash_w25qxx.c @@ -34,6 +34,7 @@ #define GD_ID (0xC8) /* JEDEC Device ID: Memory type and Capacity */ +#define MTC_W25Q80_BV (0x4014) /* W25Q80BV */ #define MTC_W25Q16_BV_CL_CV (0x4015) /* W25Q16BV W25Q16CL W25Q16CV */ #define MTC_W25Q16_DW (0x6015) /* W25Q16DW */ #define MTC_W25Q32_BV (0x4016) /* W25Q32BV */ @@ -349,6 +350,11 @@ rt_err_t w25qxx_init(const char * flash_device_name, const char * spi_device_nam FLASH_TRACE("W25Q16DW detection\r\n"); spi_flash_device.geometry.sector_count = 512; } + else if(memory_type_capacity == MTC_W25Q80_BV) + { + FLASH_TRACE("W25Q80BV detection\r\n"); + spi_flash_device.geometry.sector_count = 256; + } else { FLASH_TRACE("Memory Capacity error!\r\n"); diff --git a/components/finsh/msh_cmd.c b/components/finsh/msh_cmd.c index cc8b2dce0a..44c3d8fd88 100644 --- a/components/finsh/msh_cmd.c +++ b/components/finsh/msh_cmd.c @@ -1,7 +1,7 @@ /* * internal commands for RT-Thread module shell * - * COPYRIGHT (C) 2013, Shanghai Real-Thread Technology Co., Ltd + * COPYRIGHT (C) 2013-2015, Shanghai Real-Thread Technology Co., Ltd * * This file is part of RT-Thread (http://www.rt-thread.org) * Maintainer: bernard.xiong <bernard.xiong at gmail.com> @@ -25,6 +25,7 @@ * Change Logs: * Date Author Notes * 2013-03-30 Bernard the first verion for FinSH + * 2015-08-28 Bernard Add mkfs command. */ #include <rtthread.h> @@ -219,6 +220,33 @@ int cmd_mkdir(int argc, char** argv) } FINSH_FUNCTION_EXPORT_ALIAS(cmd_mkdir, __cmd_mkdir, Create the DIRECTORY.); +int cmd_mkfs(int argc, char** argv) +{ + int result = 0; + char* type="elm"; /* use the default file system type as 'fatfs' */ + + if (argc == 2) + { + result = dfs_mkfs(type, argv[1]); + } + else if (argc == 4) + { + if (strcmp(argv[1], "-t") == 0) + { + type = argv[2]; + result = dfs_mkfs(type, argv[1]); + } + } + else + { + rt_kprintf("Usage: mkfs [-t type] device\n"); + return 0; + } + + return 0; +} +FINSH_FUNCTION_EXPORT_ALIAS(cmd_mkfs, __cmd_mkfs, format disk with file system); + #endif #ifdef RT_USING_LWIP |
