Skip to content

Commit 582aff8

Browse files
committed
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
2 parents 516711d + 2fdef81 commit 582aff8

24 files changed

+3245
-42
lines changed

components/dfs/src/dfs_posix.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,17 @@ struct dirent *readdir(DIR *d)
540540
if (fd == RT_NULL)
541541
{
542542
rt_set_errno(-DFS_STATUS_EBADF);
543-
544543
return RT_NULL;
545544
}
546545

547-
if (!d->num ||
548-
(d->cur += ((struct dirent *)(d->buf + d->cur))->d_reclen) >= d->num)
546+
if (d->num)
547+
{
548+
struct dirent* dirent_ptr;
549+
dirent_ptr = (struct dirent*)&d->buf[d->cur];
550+
d->cur += dirent_ptr->d_reclen;
551+
}
552+
553+
if (!d->num || d->cur >= d->num)
549554
{
550555
/* get a new entry */
551556
result = dfs_file_getdents(fd,

components/drivers/spi/SConscript

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
from building import *
22

3-
cwd = GetCurrentDir()
4-
src = Glob('*.c')
3+
cwd = GetCurrentDir()
4+
src = ['spi_core.c', 'spi_dev.c']
55
CPPPATH = [cwd + '/../include']
6+
7+
src_device = []
8+
9+
if GetDepend('RT_USING_SPI_WIFI'):
10+
src_device += ['spi_wifi_rw009.c']
11+
12+
if GetDepend('RT_USING_W25QXX'):
13+
src_device += ['spi_flash_w25qxx.c']
14+
15+
if GetDepend('RT_USING_ENC28J60'):
16+
src_device += ['enc28j60.c']
17+
18+
if GetDepend('RT_USING_AT45DBXX'):
19+
src_device += ['spi_flash_at45dbxx.c']
20+
21+
if GetDepend('RT_USING_SST25VFXX'):
22+
src_device += ['spi_flash_sst25vfxx.c']
23+
24+
src += src_device
25+
626
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SPI'], CPPPATH = CPPPATH)
727

828
Return('group')
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
spi_wifi_rw009.c/spi_wifi_rw009.h
2+
RW009
3+
http://www.rt-thread.com/
4+
5+
enc28j60.c/enc28j60.h
6+
http://www.microchip.com/
7+
8+
spi_flash_at45dbxx.c/spi_flash_at45dbxx.h
9+
http://www.atmel.com/
10+
11+
spi_flash_sst25vfxx.c/spi_flash_sst25vfxx.h
12+
http://www.microchip.com/
13+
14+
spi_flash_w25qxx.c/spi_flash_w25qxx.h
15+
http://www.winbond.com/

0 commit comments

Comments
 (0)