- Timestamp:
- Feb 2, 2016, 9:54:35 PM (7 years ago)
- Location:
- uKadecot/trunk
- Files:
-
- 4 added
- 1 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
uKadecot/trunk/csp/flash/ukadecot_cat.bat
r101 r154 2 2 set fn=%date:~-10,4%%date:~-5,2%%date:~-2,2%%time2:~0,2%%time2:~3,2%%time2:~6,2% 3 3 4 ..\..\srecord\srec_cat --address-length=4 --line-length=70 ..\ukadecot\DefaultBuild\ukadecot.mot ..\..\uip\apps\webserver\httpd-fs.bin -binary -offset 0xFFF00000 ..\..\kadecot\kadecot_names.bin -binary -offset 0xFFFE0000 -o ukadecot_%fn%.mot4 ..\..\srecord\srec_cat --address-length=4 --line-length=70 ..\ukadecot\DefaultBuild\ukadecot.mot ..\..\uip\apps\webserver\httpd-fs.bin -binary -offset 0xFFF00000 ..\..\kadecot\kadecot_names.bin -binary -offset 0xFFFE0000 -o ..\flash\ukadecot_%fn%.mot -
uKadecot/trunk/csp/ukadecot/cfg/cfg.mtsp
r101 r154 150 150 <GeneralOptionSaveAcc-DefaultValue>False</GeneralOptionSaveAcc-DefaultValue> 151 151 <IsLockedByUser>False</IsLockedByUser> 152 <TimeTagModified--0>-8587 688952440286552</TimeTagModified--0>152 <TimeTagModified--0>-8587473084430197473</TimeTagModified--0> 153 153 <BuildMode-0>DefaultBuild</BuildMode-0> 154 154 <Memo-0 /> … … 156 156 <FormatBuildOptionList-0>%TargetFiles% : %Program% %Options%</FormatBuildOptionList-0> 157 157 <PreBuildCommands-0>if exist "%OutputDir%\%ProjectName%.syms" del "%OutputDir%\%ProjectName%.syms" 158 ..\..\..\ssp\cfg\cfg\cfg.exe --pass 1 --kernel ssp --api-table ..\..\..\ssp\kernel\ssp_kernel_api.csv --api-table ..\..\..\ecnl_ssp\echonet_api.csv --cfg1-def-table ..\..\..\ssp\kernel\ssp_kernel_def.csv --cfg1-def-table ..\..\..\ssp\syssvc\syssvc_def.csv --cfg1-def-table ..\..\..\ssp\arch\rx630_ccrx\prc_def.csv --cfg1-def-table ..\..\..\ssp\target\grsakura_ccrx\target_def.csv --cfg1-def-table ..\..\..\ecnl_ssp\echonet_def.csv -I ..\..\..\ssp -I ..\..\..\ssp\arch -I ..\..\..\ssp\include -I ..\..\..\ssp\target\grsakura_ccrx -I ..\..\..\uip\task -I ..\..\..\uip\target\if_rx62n -I ..\..\..\ ecnl_ssp -I ..\..\..\src\ukadecot ..\..\..\src\ukadecot\main.cfg158 ..\..\..\ssp\cfg\cfg\cfg.exe --pass 1 --kernel ssp --api-table ..\..\..\ssp\kernel\ssp_kernel_api.csv --api-table ..\..\..\ecnl_ssp\echonet_api.csv --cfg1-def-table ..\..\..\ssp\kernel\ssp_kernel_def.csv --cfg1-def-table ..\..\..\ssp\syssvc\syssvc_def.csv --cfg1-def-table ..\..\..\ssp\arch\rx630_ccrx\prc_def.csv --cfg1-def-table ..\..\..\ssp\target\grsakura_ccrx\target_def.csv --cfg1-def-table ..\..\..\ecnl_ssp\echonet_def.csv -I ..\..\..\ssp -I ..\..\..\ssp\arch -I ..\..\..\ssp\include -I ..\..\..\ssp\target\grsakura_ccrx -I ..\..\..\uip\task -I ..\..\..\uip\target\if_rx62n -I ..\..\..\pfatfs -I ..\..\..\ecnl_ssp -I ..\..\..\src\ukadecot ..\..\..\src\ukadecot\main.cfg 159 159 </PreBuildCommands-0> 160 160 <PostBuildCommands-0>..\..\..\ssp\arch\ccrx\gensyms.exe "%OutputDir%\%ProjectName%.map" 161 161 %WinDir%\cscript //Nologo ..\..\tools\update.js "%OutputDir%\%ProjectName%.mot" cfg1_out.srec 162 ..\..\..\ssp\cfg\cfg\cfg.exe --pass 2 --kernel ssp --api-table ..\..\..\ssp\kernel\ssp_kernel_api.csv --api-table ..\..\..\ecnl_ssp\echonet_api.csv --cfg1-def-table ..\..\..\ssp\kernel\ssp_kernel_def.csv --cfg1-def-table ..\..\..\ssp\syssvc\syssvc_def.csv --cfg1-def-table ..\..\..\ssp\arch\rx630_ccrx\prc_def.csv --cfg1-def-table ..\..\..\ssp\target\grsakura_ccrx\target_def.csv --cfg1-def-table ..\..\..\ecnl_ssp\echonet_def.csv -I ..\..\..\ssp -I ..\..\..\ssp\arch -I ..\..\..\ssp\arch\rx630_ccrx -I ..\..\..\ssp\include -I ..\..\..\ssp\kernel -I ..\..\..\ssp\target\grsakura_ccrx -I ..\..\..\uip\task -I ..\..\..\uip\target\if_rx62n -I ..\..\..\ ecnl_ssp -I ..\..\..\src\ukadecot --template-file ..\..\..\ssp\target\grsakura_ccrx\target_echonet.tf ..\..\..\src\ukadecot\main.cfg162 ..\..\..\ssp\cfg\cfg\cfg.exe --pass 2 --kernel ssp --api-table ..\..\..\ssp\kernel\ssp_kernel_api.csv --api-table ..\..\..\ecnl_ssp\echonet_api.csv --cfg1-def-table ..\..\..\ssp\kernel\ssp_kernel_def.csv --cfg1-def-table ..\..\..\ssp\syssvc\syssvc_def.csv --cfg1-def-table ..\..\..\ssp\arch\rx630_ccrx\prc_def.csv --cfg1-def-table ..\..\..\ssp\target\grsakura_ccrx\target_def.csv --cfg1-def-table ..\..\..\ecnl_ssp\echonet_def.csv -I ..\..\..\ssp -I ..\..\..\ssp\arch -I ..\..\..\ssp\arch\rx630_ccrx -I ..\..\..\ssp\include -I ..\..\..\ssp\kernel -I ..\..\..\ssp\target\grsakura_ccrx -I ..\..\..\uip\task -I ..\..\..\uip\target\if_rx62n -I ..\..\..\pfatfs -I ..\..\..\ecnl_ssp -I ..\..\..\src\ukadecot --template-file ..\..\..\ssp\target\grsakura_ccrx\target_echonet.tf ..\..\..\src\ukadecot\main.cfg 163 163 %WinDir%\cscript //Nologo ..\..\tools\cmp_update.js kernel_cfg.c ..\kernel_cfg.c 164 164 %WinDir%\cscript //Nologo ..\..\tools\cmp_update.js kernel_cfg.h ..\kernel_cfg.h … … 252 252 <COptionShowExpansions-DefaultValue>False</COptionShowExpansions-DefaultValue> 253 253 <COptionCommandLine-DefaultValue>-cpu=rx600 254 -fpu 254 255 -include=. 255 256 -include=..\..\..\ssp … … 262 263 -include=..\..\..\uip\task 263 264 -include=..\..\..\uip\target\if_rx62n 265 -include=..\..\..\pfatfs 264 266 -include=..\..\..\ecnl_ssp 265 267 -include=..\..\..\src\ukadecot … … 268 270 -obj_path=%BuildModeName% 269 271 -debug 270 -fpu271 272 -nologo 272 273 </COptionCommandLine-DefaultValue> … … 323 324 <COptionIncode-DefaultValue>Sjis</COptionIncode-DefaultValue> 324 325 <IsLockedByUser>False</IsLockedByUser> 325 <TimeTagModified--0>-8587 805601566661072</TimeTagModified--0>326 <TimeTagModified--0>-8587473084216714553</TimeTagModified--0> 326 327 <COptionLangC-0>C99</COptionLangC-0> 327 328 <COptionListfile-0>False</COptionListfile-0> … … 349 350 ..\..\..\uip\task 350 351 ..\..\..\uip\target\if_rx62n 352 ..\..\..\pfatfs 351 353 ..\..\..\ecnl_ssp 352 354 ..\..\..\src\ukadecot … … 369 371 <COptionShowExpansions-0>False</COptionShowExpansions-0> 370 372 <COptionCommandLine-0>-cpu=rx600 373 -fpu 371 374 -include=. 372 375 -include=..\..\..\ssp … … 379 382 -include=..\..\..\uip\task 380 383 -include=..\..\..\uip\target\if_rx62n 384 -include=..\..\..\pfatfs 381 385 -include=..\..\..\ecnl_ssp 382 386 -include=..\..\..\src\ukadecot … … 385 389 -obj_path=%BuildModeName% 386 390 -debug 387 -fpu388 391 -nologo 389 392 </COptionCommandLine-0> … … 456 459 <AsmOptionPostAssembleCommands-DefaultValue /> 457 460 <AsmOptionOtherAdditionalOptions-DefaultValue /> 458 <AsmOptionCommandLine-DefaultValue /> 461 <AsmOptionCommandLine-DefaultValue>-cpu=rx600 462 -fpu 463 -output=obj 464 -obj_path=%BuildModeName% 465 -debug 466 -nologo 467 </AsmOptionCommandLine-DefaultValue> 459 468 <IsLockedByUser>False</IsLockedByUser> 460 469 <TimeTagModified--0>-8588053503357851523</TimeTagModified--0> … … 477 486 <AsmOptionPostAssembleCommands-0 /> 478 487 <AsmOptionOtherAdditionalOptions-0 /> 479 <AsmOptionCommandLine-0 /> 488 <AsmOptionCommandLine-0>-cpu=rx600 489 -fpu 490 -output=obj 491 -obj_path=%BuildModeName% 492 -debug 493 -nologo 494 </AsmOptionCommandLine-0> 480 495 </Instance> 481 496 <Instance Guid="dbb16727-3e81-4169-956a-790355cab4a1"> -
uKadecot/trunk/csp/ukadecot/ukadecot.mtpj
r152 r154 493 493 <Property>de34d294-295e-4251-bd6b-48cc727775f3</Property> 494 494 </Instance> 495 <Instance Guid="d0c23ad0-6fec-42a7-8e61-72b8e19d5edb"> 496 <Name>mmc_rspi.c</Name> 497 <Type>File</Type> 498 <RelativePath>..\..\pfatfs\mmc_rspi.c</RelativePath> 499 <TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid> 500 <ParentItem>fba78777-38ea-4ff3-b3f8-b7e7823ae080</ParentItem> 501 <Property>83a38444-6bd9-4d09-acd0-b4b45d3a092e</Property> 502 </Instance> 495 503 </Class> 496 504 <Class Guid="9033e9fb-2b12-4437-a25e-27b28d42582b"> … … 672 680 </Instance> 673 681 <Instance Guid="de34d294-295e-4251-bd6b-48cc727775f3"> 682 <MemoCount>0</MemoCount> 683 </Instance> 684 <Instance Guid="83a38444-6bd9-4d09-acd0-b4b45d3a092e"> 674 685 <MemoCount>0</MemoCount> 675 686 </Instance> … … 841 852 <SourceItemGuid55>f80fdc1d-1a42-4612-9e72-6cec4e709c34</SourceItemGuid55> 842 853 <SourceItemType55>CSource</SourceItemType55> 843 <SourceItemCount>56</SourceItemCount> 854 <SourceItemGuid56>d0c23ad0-6fec-42a7-8e61-72b8e19d5edb</SourceItemGuid56> 855 <SourceItemType56>CSource</SourceItemType56> 856 <SourceItemCount>57</SourceItemCount> 844 857 <LastDeviceChangedCounter>0</LastDeviceChangedCounter> 845 858 </Instance> … … 923 936 <GeneralOptionSaveAcc-DefaultValue>False</GeneralOptionSaveAcc-DefaultValue> 924 937 <IsLockedByUser>False</IsLockedByUser> 925 <TimeTagModified--0>-8587 688952440286552</TimeTagModified--0>938 <TimeTagModified--0>-8587472822773086219</TimeTagModified--0> 926 939 <BuildMode-0>DefaultBuild</BuildMode-0> 927 940 <Memo-0 /> … … 929 942 <FormatBuildOptionList-0>%TargetFiles% : %Program% %Options%</FormatBuildOptionList-0> 930 943 <PreBuildCommands-0 /> 931 <PostBuildCommands-0 /> 944 <PostBuildCommands-0>call ..\flash\ukadecot_cat.bat 945 </PostBuildCommands-0> 932 946 <GeneralOptionIsa-0>None</GeneralOptionIsa-0> 933 947 <GeneralOptionOutput-0>LoadModuleFile</GeneralOptionOutput-0> … … 1021 1035 -include=..\..\ssp\pdic 1022 1036 -include=..\..\ssp\target\grsakura_ccrx 1023 -include=..\..\ccrx\sim\rx63n1024 1037 -include=..\..\uip\uip 1025 1038 -include=..\..\uip\task … … 1029 1042 -include=..\..\pfatfs 1030 1043 -include=..\..\ecnl_ssp 1044 -include=..\..\kadecot 1031 1045 -include=..\..\src\ukadecot 1032 1046 -define=__LIT,TARGET_KERNEL_SSP,SUPPORT_UIP,JSONSL_NO_JPR … … 1143 1157 -include=..\..\ssp\pdic 1144 1158 -include=..\..\ssp\target\grsakura_ccrx 1145 -include=..\..\ccrx\sim\rx63n1146 1159 -include=..\..\uip\uip 1147 1160 -include=..\..\uip\task … … 1151 1164 -include=..\..\pfatfs 1152 1165 -include=..\..\ecnl_ssp 1166 -include=..\..\kadecot 1153 1167 -include=..\..\src\ukadecot 1154 1168 -define=__LIT,TARGET_KERNEL_SSP,SUPPORT_UIP,JSONSL_NO_JPR … … 1899 1913 <ItemAddTime>635681959164315263</ItemAddTime> 1900 1914 <ItemAddTimeCount>1</ItemAddTimeCount> 1915 </Instance> 1916 <Instance Guid="d0c23ad0-6fec-42a7-8e61-72b8e19d5edb"> 1917 <ItemAddTime>635899275212434767</ItemAddTime> 1918 <ItemAddTimeCount>0</ItemAddTimeCount> 1901 1919 </Instance> 1902 1920 <Instance Guid="a7be515f-f007-45ed-9059-4e1500c0f74d"> … … 2113 2131 <SourceItem55-BuildingTarget-0>True</SourceItem55-BuildingTarget-0> 2114 2132 <SourceItem55-IndividualCompileOption-0>False</SourceItem55-IndividualCompileOption-0> 2133 <TimeTagModified-SourceItem56--0>-8587473085642341041</TimeTagModified-SourceItem56--0> 2134 <SourceItem56-IsLockedByUser>False</SourceItem56-IsLockedByUser> 2135 <SourceItem56-BuildingTarget-0>True</SourceItem56-BuildingTarget-0> 2136 <SourceItem56-IndividualCompileOption-0>False</SourceItem56-IndividualCompileOption-0> 2115 2137 </Instance> 2116 2138 <Instance Guid="c20a78d9-8038-46fe-9b87-bc2fa2aa9bdc"> -
uKadecot/trunk/ecnl_ssp/echonet_fbs.c
r153 r154 89 89 ER ret = E_OK; 90 90 91 if ((buf < mpfid->blockes[0]) || (buf >=mpfid->blockes[NUM_ECHONET_MEMPOOL_BLOCK]))91 if ((buf < (void *)&mpfid->blockes[0]) || (buf >= (void *)&mpfid->blockes[NUM_ECHONET_MEMPOOL_BLOCK])) 92 92 return E_PAR; 93 93 -
uKadecot/trunk/pfatfs/diskio.c
r108 r154 21 21 #define RamDisk ((unsigned char *)0xfff00000) 22 22 #else 23 #include <windows.h>24 #include <tchar.h>25 #include <winioctl.h>26 27 23 unsigned char RamDisk[SZ_RAMDISK * 1024]; 24 extern void win_disk_initialize(void *ramDisk, int size); 28 25 #endif 29 26 … … 34 31 DWORD wip; 35 32 DWORD n_sectors; 36 } STAT;33 } RD_STAT; 37 34 38 35 static volatile 39 STAT Stat[MAX_DRIVES];36 RD_STAT Stat[MAX_DRIVES]; 40 37 41 38 static … … 43 40 44 41 static 45 int get_status(volatile STAT *stat) {42 int get_status(volatile RD_STAT *stat) { 46 43 stat->sz_sector = SS_RAMDISK; 47 44 if(stat->sz_sector < _MIN_SS || stat->sz_sector > _MAX_SS) return 0; … … 54 51 /* Initialize Disk Drive */ 55 52 /*-----------------------------------------------------------------------*/ 56 DSTATUS disk_initialize (void)53 DSTATUS ramdisk_initialize (void) 57 54 { 58 55 DSTATUS sta; 59 56 #ifdef _MSC_VER 60 HANDLE h; 61 DWORD br; 62 63 h = CreateFile(_T("..\\..\\..\\..\\uip\\apps\\webserver\\httpd-fs.bin"), GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0); 64 if (h != INVALID_HANDLE_VALUE) { 65 ReadFile(h, RamDisk, sizeof(RamDisk), &br, 0); 66 CloseHandle(h); 67 } 57 win_disk_initialize(RamDisk, sizeof(RamDisk)); 68 58 #endif 69 59 get_status(&Stat[0]); … … 77 67 /* Get Disk Status */ 78 68 /*-----------------------------------------------------------------------*/ 79 DSTATUS disk_get_status (void)69 DSTATUS ramdisk_get_status (void) 80 70 { 81 71 return Stat[0].status; … … 85 75 /* Read Partial Sector */ 86 76 /*-----------------------------------------------------------------------*/ 87 DRESULT disk_readp (77 DRESULT ramdisk_readp ( 88 78 BYTE* buff, /* Data read buffer */ 89 79 DWORD sector, /* Sector number (LBA) */ … … 118 108 /* Write Partial Sector */ 119 109 /*-----------------------------------------------------------------------*/ 120 DRESULT disk_writep (110 DRESULT ramdisk_writep ( 121 111 const BYTE* buff, /* Pointer to the write data */ 122 112 DWORD sc /* Sector number (LBA), Number of bytes to send */ -
uKadecot/trunk/pfatfs/diskio.h
r108 r154 19 19 /* Results of Disk Functions */ 20 20 typedef enum { 21 RES_OK = 0, /* 0: Function succeeded */ 22 RES_ERROR, /* 1: Disk error */ 23 RES_NOTRDY, /* 2: Not ready */ 24 RES_PARERR /* 3: Invalid parameter */ 21 RES_OK = 0, /* 0: Successful */ 22 RES_ERROR, /* 1: R/W Error */ 23 RES_WRPRT, /* 2: Write Protected */ 24 RES_NOTRDY, /* 3: Not Ready */ 25 RES_PARERR /* 4: Invalid Parameter */ 25 26 } DRESULT; 26 27 … … 29 30 /* Prototypes for disk control functions */ 30 31 31 DSTATUS disk_initialize (void);32 DSTATUS disk_get_status (void);33 DRESULT disk_readp (BYTE* buff, DWORD sector, UINT offset, UINT count);34 DRESULT disk_writep (const BYTE* buff, DWORD sc);32 DSTATUS ramdisk_initialize (void); 33 DSTATUS ramdisk_get_status (void); 34 DRESULT ramdisk_readp (BYTE* buff, DWORD sector, UINT offset, UINT count); 35 DRESULT ramdisk_writep (const BYTE* buff, DWORD sc); 35 36 36 37 #define STA_NOINIT 0x01 /* Drive not initialized */ 37 38 #define STA_NODISK 0x02 /* No medium in the drive */ 39 #define STA_PROTECT 0x04 /* Write protected */ 38 40 41 /* Generic command (Used by FatFs) */ 42 #define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */ 43 #define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */ 44 #define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */ 45 #define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */ 46 #define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */ 47 48 /* MMC/SDC specific command (Not used by FatFs) */ 49 #define MMC_GET_TYPE 50 /* Get card type */ 50 #define MMC_GET_CSD 51 /* Get CSD */ 51 #define MMC_GET_CID 52 /* Get CID */ 52 #define MMC_GET_OCR 53 /* Get OCR */ 53 #define MMC_GET_SDSTAT 54 /* Get SD status */ 54 55 /* MMC card type flags (MMC_GET_TYPE) */ 56 #define CT_MMC 0x01 /* MMC ver 3 */ 57 #define CT_SD1 0x02 /* SD ver 1 */ 58 #define CT_SD2 0x04 /* SD ver 2 */ 59 #define CT_SDC (CT_SD1|CT_SD2) /* SD */ 60 #define CT_BLOCK 0x08 /* Block addressing */ 39 61 40 62 #ifdef __cplusplus -
uKadecot/trunk/pfatfs/pff.c
r108 r154 58 58 #define ABORT(err) {fs->flag = 0; return err;} 59 59 60 #if _USE_LFN61 static WCHAR LfnBuf[_MAX_LFN+1];62 #endif63 64 60 /*--------------------------------------------------------*/ 65 61 /* DBCS code ranges and SBCS extend char conversion table */ … … 509 505 ofs = bc % 512; bc /= 512; 510 506 if (ofs != 511) { 511 if ( disk_readp(buf, fs->fatbase + bc, ofs, 2)) break;507 if (fs->disk_readp(buf, fs->fatbase + bc, ofs, 2)) break; 512 508 } else { 513 if ( disk_readp(buf, fs->fatbase + bc, 511, 1)) break;514 if ( disk_readp(buf+1, fs->fatbase + bc + 1, 0, 1)) break;509 if (fs->disk_readp(buf, fs->fatbase + bc, 511, 1)) break; 510 if (fs->disk_readp(buf+1, fs->fatbase + bc + 1, 0, 1)) break; 515 511 } 516 512 wc = LD_WORD(buf); … … 520 516 #if _FS_FAT16 521 517 case FS_FAT16 : 522 if ( disk_readp(buf, fs->fatbase + clst / 256, ((UINT)clst % 256) * 2, 2)) break;518 if (fs->disk_readp(buf, fs->fatbase + clst / 256, ((UINT)clst % 256) * 2, 2)) break; 523 519 return LD_WORD(buf); 524 520 #endif 525 521 #if _FS_FAT32 526 522 case FS_FAT32 : 527 if ( disk_readp(buf, fs->fatbase + clst / 128, ((UINT)clst % 128) * 4, 4)) break;523 if (fs->disk_readp(buf, fs->fatbase + clst / 128, ((UINT)clst % 128) * 4, 4)) break; 528 524 return LD_DWORD(buf) & 0x0FFFFFFF; 529 525 #endif … … 673 669 BYTE a, ord, sum; 674 670 #endif 671 FATFS *fs = dj->fs; 675 672 676 673 res = dir_rewind(dj); /* Rewind directory object */ … … 681 678 #endif 682 679 do { 683 res = disk_readp(dir, dj->sect, (dj->index % 16) * 32, 32) /* Read an entry */680 res = fs->disk_readp(dir, dj->sect, (dj->index % 16) * 32, 32) /* Read an entry */ 684 681 ? FR_DISK_ERR : FR_OK; 685 682 if (res != FR_OK) break; … … 735 732 BYTE ord = 0xFF, sum = 0xFF; 736 733 #endif 734 FATFS *fs = dj->fs; 737 735 738 736 res = FR_NO_FILE; 739 737 while (dj->sect) { 740 res = disk_readp(dir, dj->sect, (dj->index % 16) * 32, 32) /* Read an entry */738 res = fs->disk_readp(dir, dj->sect, (dj->index % 16) * 32, 32) /* Read an entry */ 741 739 ? FR_DISK_ERR : FR_OK; 742 740 if (res != FR_OK) break; … … 1072 1070 ) 1073 1071 { 1074 if ( disk_readp(buf, sect, 510, 2)) /* Read the boot record */1072 if (fs->disk_readp(buf, sect, 510, 2)) /* Read the boot record */ 1075 1073 return 3; 1076 1074 if (LD_WORD(buf) != 0xAA55) /* Check record signature */ 1077 1075 return 2; 1078 1076 1079 if (!_FS_32ONLY && ! disk_readp(buf, sect, BS_FilSysType, 2) && LD_WORD(buf) == 0x4146) /* Check FAT12/16 */1077 if (!_FS_32ONLY && !fs->disk_readp(buf, sect, BS_FilSysType, 2) && LD_WORD(buf) == 0x4146) /* Check FAT12/16 */ 1080 1078 return 0; 1081 if (_FS_FAT32 && ! disk_readp(buf, sect, BS_FilSysType32, 2) && LD_WORD(buf) == 0x4146) /* Check FAT32 */1079 if (_FS_FAT32 && !fs->disk_readp(buf, sect, BS_FilSysType32, 2) && LD_WORD(buf) == 0x4146) /* Check FAT32 */ 1082 1080 return 0; 1083 1081 return 1; … … 1106 1104 DWORD bsect, fsize, tsect, mclst; 1107 1105 1108 if ( disk_get_status() & STA_NOINIT) /* Check if the drive is ready or not */1106 if (fs->disk_get_status() & STA_NOINIT) /* Check if the drive is ready or not */ 1109 1107 return FR_NOT_READY; 1110 1108 … … 1114 1112 if (fmt == 1) { /* Not an FAT boot record, it may be FDISK format */ 1115 1113 /* Check a partition listed in top of the partition table */ 1116 if ( disk_readp(buf, bsect, MBR_Table, 16)) { /* 1st partition entry */1114 if (fs->disk_readp(buf, bsect, MBR_Table, 16)) { /* 1st partition entry */ 1117 1115 fmt = 3; 1118 1116 } else { … … 1127 1125 1128 1126 /* Initialize the file system object */ 1129 if ( disk_readp(buf, bsect, 13, sizeof (buf))) return FR_DISK_ERR;1127 if (fs->disk_readp(buf, bsect, 13, sizeof (buf))) return FR_DISK_ERR; 1130 1128 1131 1129 fsize = LD_WORD(buf+BPB_FATSz16-13); /* Number of sectors per FAT */ … … 1187 1185 dj.fn = sp; 1188 1186 #if _USE_LFN 1189 dj.lfn = LfnBuf;1187 dj.lfn = fs->LfnBuf; 1190 1188 #endif 1191 1189 res = follow_path(&dj, dir, path); /* Follow the file path */ … … 1249 1247 rcnt = 512 - (UINT)fs->fptr % 512; /* Get partial sector data from sector buffer */ 1250 1248 if (rcnt > btr) rcnt = btr; 1251 dr = disk_readp(!buff ? 0 : rbuff, fs->dsect, (UINT)fs->fptr % 512, rcnt);1249 dr = fs->disk_readp(!buff ? 0 : rbuff, fs->dsect, (UINT)fs->fptr % 512, rcnt); 1252 1250 if (dr) ABORT(FR_DISK_ERR); 1253 1251 fs->fptr += rcnt; rbuff += rcnt; /* Update pointers and counters */ … … 1286 1284 1287 1285 if (!btw) { /* Finalize request */ 1288 if ((fs->flag & FA__WIP) && disk_writep(0, 0)) ABORT(FR_DISK_ERR);1286 if ((fs->flag & FA__WIP) && fs->disk_writep(0, 0)) ABORT(FR_DISK_ERR); 1289 1287 fs->flag &= ~FA__WIP; 1290 1288 return FR_OK; … … 1310 1308 if (!sect) ABORT(FR_DISK_ERR); 1311 1309 fs->dsect = sect + cs; 1312 if ( disk_writep(0, fs->dsect)) ABORT(FR_DISK_ERR); /* Initiate a sector write operation */1310 if (fs->disk_writep(0, fs->dsect)) ABORT(FR_DISK_ERR); /* Initiate a sector write operation */ 1313 1311 fs->flag |= FA__WIP; 1314 1312 } 1315 1313 wcnt = 512 - (UINT)fs->fptr % 512; /* Number of bytes to write to the sector */ 1316 1314 if (wcnt > btw) wcnt = btw; 1317 if ( disk_writep(p, wcnt)) ABORT(FR_DISK_ERR); /* Send data to the sector */1315 if (fs->disk_writep(p, wcnt)) ABORT(FR_DISK_ERR); /* Send data to the sector */ 1318 1316 fs->fptr += wcnt; p += wcnt; /* Update pointers and counters */ 1319 1317 btw -= wcnt; *bw += wcnt; 1320 1318 if ((UINT)fs->fptr % 512 == 0) { 1321 if ( disk_writep(0, 0)) ABORT(FR_DISK_ERR); /* Finalize the currtent secter write operation */1319 if (fs->disk_writep(0, 0)) ABORT(FR_DISK_ERR); /* Finalize the currtent secter write operation */ 1322 1320 fs->flag &= ~FA__WIP; 1323 1321 } … … 1401 1399 dj->fn = sp; 1402 1400 #if _USE_LFN 1403 dj->lfn = LfnBuf;1401 dj->lfn = fs->LfnBuf; 1404 1402 #endif 1405 1403 res = follow_path(dj, dir, path); /* Follow the path to the directory */ -
uKadecot/trunk/pfatfs/pff.h
r108 r154 24 24 #include "integer.h" 25 25 #include "pffconf.h" 26 #include "diskio.h" 26 27 27 28 #if _PFATFS != _PFFCONF … … 39 40 40 41 typedef struct { 42 DSTATUS (* disk_get_status)(void); 43 DRESULT (* disk_readp)(BYTE* buff, DWORD sector, UINT offset, UINT count); 44 DRESULT (* disk_writep)(const BYTE* buff, DWORD sc); 41 45 BYTE fs_type; /* FAT sub type */ 42 46 BYTE flag; /* File status flags */ … … 53 57 CLUST curr_clust; /* File current cluster */ 54 58 DWORD dsect; /* File current data sector */ 59 #if _USE_LFN 60 WCHAR LfnBuf[_MAX_LFN + 1]; 61 #endif 55 62 } FATFS; 56 63 -
uKadecot/trunk/pfatfs/pffconf.h
r108 r154 14 14 #define _USE_LSEEK 1 /* Enable pf_lseek() function */ 15 15 #define _USE_WRITE 1 /* Enable pf_write() function */ 16 #define _USE_IOCTL 1 /* Enable pf_ioctl() function */ 16 17 17 18 #define _FS_FAT12 1 /* Enable FAT12 */ -
uKadecot/trunk/src/ukadecot/main.cfg
r107 r154 48 48 INCLUDE("nic_ssp.cfg"); 49 49 INCLUDE("uip_task.cfg"); 50 INCLUDE("mmc_rspi.cfg"); 50 51 INCLUDE("echonet_ssp.cfg"); 51 52 -
uKadecot/trunk/ssp/arch/rx630_ccrx/prc_sil.h
r108 r154 43 43 #define TOPPERS_PRC_SIL_H 44 44 45 #define TOPPERS_OMIT_SIL_ACCESS 45 46 46 47 #ifndef TOPPERS_MACRO_ONLY … … 106 107 * プロセッサのエンディアン 107 108 */ 109 #ifdef __LIT 108 110 #define SIL_ENDIAN_LITTLE /* リトルエンディアン */ 109 111 #endif 112 #ifdef __BIG 113 #define SIL_ENDIAN_BIG /* ビッグエンディアン */ 114 #endif 115 116 117 /* 118 * 8ビット単位の読出し/書込み 119 */ 120 #ifdef UINT8_MAX 121 122 #pragma inline(sil_reb_mem) 123 static uint8_t 124 sil_reb_mem(const volatile uint8_t __evenaccess *mem) 125 { 126 uint8_t data; 127 128 data = *mem; 129 return(data); 130 } 131 132 #pragma inline(sil_wrb_mem) 133 static void 134 sil_wrb_mem(volatile uint8_t __evenaccess *mem, uint8_t data) 135 { 136 *mem = data; 137 } 138 139 #endif /* UINT8_MAX */ 140 141 /* 142 * 16ビット単位の読出し/書込み 143 */ 144 145 #pragma inline(sil_reh_mem) 146 static uint16_t 147 sil_reh_mem(const volatile uint16_t __evenaccess *mem) 148 { 149 uint16_t data; 150 151 data = *mem; 152 return(data); 153 } 154 155 #pragma inline(sil_wrh_mem) 156 static void 157 sil_wrh_mem(volatile uint16_t __evenaccess *mem, uint16_t data) 158 { 159 *mem = data; 160 } 161 162 #ifdef SIL_ENDIAN_BIG /* ビッグエンディアンプロセッサ */ 163 164 #define sil_reh_bem(mem) sil_reh_mem(mem) 165 #define sil_wrh_bem(mem, data) sil_wrh_mem(mem, data) 166 167 #ifndef TOPPERS_OMIT_SIL_REH_LEM 168 169 #pragma inline(sil_reh_lem) 170 static uint16_t 171 sil_reh_lem(const volatile uint16_t __evenaccess *mem) 172 { 173 uint16_t data; 174 175 data = *mem; 176 return(TOPPERS_SIL_REV_ENDIAN_UINT16(data)); 177 } 178 179 #endif /* TOPPERS_OMIT_SIL_REH_LEM */ 180 #ifndef TOPPERS_OMIT_SIL_WRH_LEM 181 182 #pragma inline(sil_wrh_lem) 183 static void 184 sil_wrh_lem(volatile uint16_t __evenaccess *mem, uint16_t data) 185 { 186 *mem = TOPPERS_SIL_REV_ENDIAN_UINT16(data); 187 } 188 189 #endif /* TOPPERS_OMIT_SIL_WRH_LEM */ 190 #else /* SIL_ENDIAN_BIG */ 191 #ifdef SIL_ENDIAN_LITTLE /* リトルエンディアンプロセッサ */ 192 193 #define sil_reh_lem(mem) sil_reh_mem(mem) 194 #define sil_wrh_lem(mem, data) sil_wrh_mem(mem, data) 195 196 #ifndef TOPPERS_OMIT_SIL_REH_BEM 197 198 #pragma inline(sil_reh_bem) 199 static uint16_t 200 sil_reh_bem(const volatile uint16_t __evenaccess *mem) 201 { 202 uint16_t data; 203 204 data = *mem; 205 return(TOPPERS_SIL_REV_ENDIAN_UINT16(data)); 206 } 207 208 #endif /* TOPPERS_OMIT_SIL_REH_BEM */ 209 #ifndef TOPPERS_OMIT_SIL_WRH_BEM 210 211 #pragma inline(sil_wrh_bem) 212 static void 213 sil_wrh_bem(volatile uint16_t __evenaccess *mem, uint16_t data) 214 { 215 *mem = TOPPERS_SIL_REV_ENDIAN_UINT16(data); 216 } 217 218 #endif /* TOPPERS_OMIT_SIL_WRH_BEM */ 219 #else /* SIL_ENDIAN_LITTLE */ 220 221 #error Neither SIL_ENDIAN_BIG nor SIL_ENDIAN_LITTLE is defined. 222 223 #endif /* SIL_ENDIAN_LITTLE */ 224 #endif /* SIL_ENDIAN_BIG */ 225 226 /* 227 * 32ビット単位の読出し/書込み 228 */ 229 230 #pragma inline(sil_rew_mem) 231 static uint32_t 232 sil_rew_mem(const volatile uint32_t __evenaccess *mem) 233 { 234 uint32_t data; 235 236 data = *mem; 237 return(data); 238 } 239 240 #pragma inline(sil_wrw_mem) 241 static void 242 sil_wrw_mem(volatile uint32_t __evenaccess *mem, uint32_t data) 243 { 244 *mem = data; 245 } 246 247 #ifdef SIL_ENDIAN_BIG /* ビッグエンディアンプロセッサ */ 248 249 #define sil_rew_bem(mem) sil_rew_mem(mem) 250 #define sil_wrw_bem(mem, data) sil_wrw_mem(mem, data) 251 252 #ifndef TOPPERS_OMIT_SIL_REW_LEM 253 254 #pragma inline(sil_rew_lem) 255 static uint32_t 256 sil_rew_lem(const volatile uint32_t __evenaccess *mem) 257 { 258 uint32_t data; 259 260 data = *mem; 261 return(TOPPERS_SIL_REV_ENDIAN_UINT32(data)); 262 } 263 264 #endif /* TOPPERS_OMIT_SIL_REW_LEM */ 265 #ifndef TOPPERS_OMIT_SIL_WRW_LEM 266 267 #pragma inline(sil_wrw_lem) 268 static void 269 sil_wrw_lem(volatile uint32_t __evenaccess *mem, uint32_t data) 270 { 271 *mem = TOPPERS_SIL_REV_ENDIAN_UINT32(data); 272 } 273 274 #endif /* TOPPERS_OMIT_SIL_WRW_LEM */ 275 #else /* SIL_ENDIAN_BIG */ /* リトルエンディアンプロセッサ */ 276 277 #define sil_rew_lem(mem) sil_rew_mem(mem) 278 #define sil_wrw_lem(mem, data) sil_wrw_mem(mem, data) 279 280 #ifndef TOPPERS_OMIT_SIL_REW_BEM 281 282 #pragma inline(sil_rew_bem) 283 static uint32_t 284 sil_rew_bem(const volatile uint32_t __evenaccess *mem) 285 { 286 uint32_t data; 287 288 data = *mem; 289 return(TOPPERS_SIL_REV_ENDIAN_UINT32(data)); 290 } 291 292 #endif /* TOPPERS_OMIT_SIL_REW_BEM */ 293 #ifndef TOPPERS_OMIT_SIL_WRW_BEM 294 295 #pragma inline(sil_wrw_bem) 296 static void 297 sil_wrw_bem(volatile uint32_t __evenaccess *mem, uint32_t data) 298 { 299 *mem = TOPPERS_SIL_REV_ENDIAN_UINT32(data); 300 } 301 302 #endif /* TOPPERS_OMIT_SIL_WRW_BEM */ 303 #endif /* SIL_ENDIAN_BIG */ 110 304 111 305 #endif /* TOPPERS_PRC_SIL_H */ -
uKadecot/trunk/ssp/arch/rx630_ccrx/rx630.h
r108 r154 1475 1475 #define PORT_PCR_B6_BIT ( 0x01U << 6U ) 1476 1476 #define PORT_PCR_B7_BIT ( 0x01U << 7U ) 1477 #define PORT0_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C080 ) 1478 #define PORT1_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C082 ) 1479 #define PORT2_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C084 ) 1480 #define PORT3_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C086 ) 1481 #define PORT4_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C088 ) 1482 #define PORT5_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C08A ) 1483 #define PORT6_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C08C ) 1484 #define PORT7_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C08E ) 1485 #define PORT8_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C090 ) 1486 #define PORT9_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C092 ) 1487 #define PORTA_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C094 ) 1488 #define PORTB_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C096 ) 1489 #define PORTC_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C098 ) 1490 #define PORTD_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C09A ) 1491 #define PORTE_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C09C ) 1492 #define PORTF_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C09E ) 1493 #define PORTG_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C0A0 ) 1494 #define PORTJ_ODR0_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C0A4 ) 1495 #define PORT0_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C081 ) 1496 #define PORT1_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C083 ) 1497 #define PORT2_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C085 ) 1498 #define PORT3_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C087 ) 1499 #define PORT4_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C089 ) 1500 #define PORT5_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C08B ) 1501 #define PORT6_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C08D ) 1502 #define PORT7_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C08F ) 1503 #define PORT8_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C091 ) 1504 #define PORT9_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C093 ) 1505 #define PORTA_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C095 ) 1506 #define PORTB_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C097 ) 1507 #define PORTC_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C099 ) 1508 #define PORTD_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C09B ) 1509 #define PORTE_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C09D ) 1510 #define PORTF_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C09F ) 1511 #define PORTG_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C0A1 ) 1512 #define PORTJ_ODR1_ADDR ( ( volatile uint8_t __evenaccess * )0x0008C0A5 ) 1477 1513 1478 1514 /* … … 1767 1803 1768 1804 /* 1805 * RSPI 1806 */ 1807 #define RSPI0_SPCR_ADDR ( ( volatile uint8_t __evenaccess * )0x00088380 ) 1808 #define RSPI1_SPCR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883A0 ) 1809 #define RSPI2_SPCR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883C0 ) 1810 #define RSPI_SPCR_SPMS_BIT ( 0x01U << 0U ) 1811 #define RSPI_SPCR_TXMD_BIT ( 0x01U << 1U ) 1812 #define RSPI_SPCR_MODFEN_BIT ( 0x01U << 2U ) 1813 #define RSPI_SPCR_MSTR_BIT ( 0x01U << 3U ) 1814 #define RSPI_SPCR_SPEIE_BIT ( 0x01U << 4U ) 1815 #define RSPI_SPCR_SPTIE_BIT ( 0x01U << 5U ) 1816 #define RSPI_SPCR_SPE_BIT ( 0x01U << 6U ) 1817 #define RSPI_SPCR_SPRIE_BIT ( 0x01U << 7U ) 1818 1819 #define RSPI0_SSLP_ADDR ( ( volatile uint8_t __evenaccess * )0x00088381 ) 1820 #define RSPI1_SSLP_ADDR ( ( volatile uint8_t __evenaccess * )0x000883A1 ) 1821 #define RSPI2_SSLP_ADDR ( ( volatile uint8_t __evenaccess * )0x000883C1 ) 1822 1823 #define RSPI0_SPPCR_ADDR ( ( volatile uint8_t __evenaccess * )0x00088382 ) 1824 #define RSPI1_SPPCR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883A2 ) 1825 #define RSPI2_SPPCR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883C2 ) 1826 1827 #define RSPI0_SPSR_ADDR ( ( volatile uint8_t __evenaccess * )0x00088383 ) 1828 #define RSPI1_SPSR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883A3 ) 1829 #define RSPI2_SPSR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883C3 ) 1830 1831 #define RSPI0_SPDR_ADDR ( ( volatile uint32_t __evenaccess * )0x00088384 ) 1832 #define RSPI1_SPDR_ADDR ( ( volatile uint32_t __evenaccess * )0x000883A4 ) 1833 #define RSPI2_SPDR_ADDR ( ( volatile uint32_t __evenaccess * )0x000883C4 ) 1834 1835 #define RSPI0_SPSCR_ADDR ( ( volatile uint8_t __evenaccess * )0x00088388 ) 1836 #define RSPI1_SPSCR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883A8 ) 1837 #define RSPI2_SPSCR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883C8 ) 1838 1839 #define RSPI0_SPSSR_ADDR ( ( volatile uint8_t __evenaccess * )0x00088389 ) 1840 #define RSPI1_SPSSR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883A9 ) 1841 #define RSPI2_SPSSR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883C9 ) 1842 1843 #define RSPI0_SPBR_ADDR ( ( volatile uint8_t __evenaccess * )0x0008838A ) 1844 #define RSPI1_SPBR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883AA ) 1845 #define RSPI2_SPBR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883CA ) 1846 1847 #define RSPI0_SPDCR_ADDR ( ( volatile uint8_t __evenaccess * )0x0008838B ) 1848 #define RSPI1_SPDCR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883AB ) 1849 #define RSPI2_SPDCR_ADDR ( ( volatile uint8_t __evenaccess * )0x000883CB ) 1850 1851 #define RSPI0_SPCKD_ADDR ( ( volatile uint8_t __evenaccess * )0x0008838C ) 1852 #define RSPI1_SPCKD_ADDR ( ( volatile uint8_t __evenaccess * )0x000883AC ) 1853 #define RSPI2_SPCKD_ADDR ( ( volatile uint8_t __evenaccess * )0x000883CC ) 1854 1855 #define RSPI0_SSLND_ADDR ( ( volatile uint8_t __evenaccess * )0x0008838D ) 1856 #define RSPI1_SSLND_ADDR ( ( volatile uint8_t __evenaccess * )0x000883AD ) 1857 #define RSPI2_SSLND_ADDR ( ( volatile uint8_t __evenaccess * )0x000883CD ) 1858 1859 #define RSPI0_SPND_ADDR ( ( volatile uint8_t __evenaccess * )0x0008838E ) 1860 #define RSPI1_SPND_ADDR ( ( volatile uint8_t __evenaccess * )0x000883AE ) 1861 #define RSPI2_SPND_ADDR ( ( volatile uint8_t __evenaccess * )0x000883CE ) 1862 1863 #define RSPI0_SPCR2_ADDR ( ( volatile uint8_t __evenaccess * )0x0008838F ) 1864 #define RSPI1_SPCR2_ADDR ( ( volatile uint8_t __evenaccess * )0x000883AF ) 1865 #define RSPI2_SPCR2_ADDR ( ( volatile uint8_t __evenaccess * )0x000883CF ) 1866 1867 #define RSPI0_SPCMD0_ADDR ( ( volatile uint16_t __evenaccess * )0x00088390 ) 1868 #define RSPI0_SPCMD1_ADDR ( ( volatile uint16_t __evenaccess * )0x00088392 ) 1869 #define RSPI0_SPCMD2_ADDR ( ( volatile uint16_t __evenaccess * )0x00088394 ) 1870 #define RSPI0_SPCMD3_ADDR ( ( volatile uint16_t __evenaccess * )0x00088396 ) 1871 #define RSPI0_SPCMD4_ADDR ( ( volatile uint16_t __evenaccess * )0x00088398 ) 1872 #define RSPI0_SPCMD5_ADDR ( ( volatile uint16_t __evenaccess * )0x0008839A ) 1873 #define RSPI0_SPCMD6_ADDR ( ( volatile uint16_t __evenaccess * )0x0008839C ) 1874 #define RSPI0_SPCMD7_ADDR ( ( volatile uint16_t __evenaccess * )0x0008839E ) 1875 #define RSPI1_SPCMD0_ADDR ( ( volatile uint16_t __evenaccess * )0x000883B0 ) 1876 #define RSPI1_SPCMD1_ADDR ( ( volatile uint16_t __evenaccess * )0x000883B2 ) 1877 #define RSPI1_SPCMD2_ADDR ( ( volatile uint16_t __evenaccess * )0x000883B4 ) 1878 #define RSPI1_SPCMD3_ADDR ( ( volatile uint16_t __evenaccess * )0x000883B6 ) 1879 #define RSPI1_SPCMD4_ADDR ( ( volatile uint16_t __evenaccess * )0x000883B8 ) 1880 #define RSPI1_SPCMD5_ADDR ( ( volatile uint16_t __evenaccess * )0x000883BA ) 1881 #define RSPI1_SPCMD6_ADDR ( ( volatile uint16_t __evenaccess * )0x000883BC ) 1882 #define RSPI1_SPCMD7_ADDR ( ( volatile uint16_t __evenaccess * )0x000883BE ) 1883 #define RSPI2_SPCMD0_ADDR ( ( volatile uint16_t __evenaccess * )0x000883D0 ) 1884 #define RSPI2_SPCMD1_ADDR ( ( volatile uint16_t __evenaccess * )0x000883D2 ) 1885 #define RSPI2_SPCMD2_ADDR ( ( volatile uint16_t __evenaccess * )0x000883D4 ) 1886 #define RSPI2_SPCMD3_ADDR ( ( volatile uint16_t __evenaccess * )0x000883D6 ) 1887 #define RSPI2_SPCMD4_ADDR ( ( volatile uint16_t __evenaccess * )0x000883D8 ) 1888 #define RSPI2_SPCMD5_ADDR ( ( volatile uint16_t __evenaccess * )0x000883DA ) 1889 #define RSPI2_SPCMD6_ADDR ( ( volatile uint16_t __evenaccess * )0x000883DC ) 1890 #define RSPI2_SPCMD7_ADDR ( ( volatile uint16_t __evenaccess * )0x000883DE ) 1891 #define RSPI_SPCMD_SPB_OFFSET (8) 1892 #define RSPI_SPCMD_SPB_MASK (0xF << RSPI_SPCMD_SPB_OFFSET) 1893 1894 /* 1769 1895 * UART関連の定義 1770 1896 * -
uKadecot/trunk/uip/apps/webserver/httpd-fs.c
r108 r154 38 38 #include "pff.h" 39 39 #include "diskio.h" 40 #include "mmc_rspi.h" 41 #include <string.h> 40 42 41 43 //#define FILE_DUMP 42 44 #ifdef FILE_DUMP 43 #include <string.h>44 45 char path[256] = ""; 45 46 FATFS fs; … … 98 99 FRESULT res; 99 100 #endif 100 disk_initialize(); 101 ramdisk_initialize(); 102 mmc_rspi_initialize(); 101 103 #ifdef FILE_DUMP 102 104 if((res = pf_mount(&fs)) != FR_OK){ … … 112 114 /*-----------------------------------------------------------------------------------*/ 113 115 int 114 httpd_fs_open( const char *name, struct httpd_fs_file *file)116 httpd_fs_open(int drv, const char *name, struct httpd_fs_file *file) 115 117 { 116 118 FRESULT res; 117 FATFS *fs = (FATFS *)&file->fs; 119 FATFS *fs = (FATFS *)file->fs; 120 121 file->pos = 0; 122 file->len = 0; 123 file->drv = drv; 124 file->name = name; 125 memset(fs, 0, sizeof(FATFS)); 126 127 if (drv == 0) { 128 fs->disk_get_status = ramdisk_get_status; 129 fs->disk_readp = ramdisk_readp; 130 fs->disk_writep = ramdisk_writep; 131 } 132 else { 133 fs->disk_get_status = mmc_rspi_get_status; 134 fs->disk_readp = mmc_rspi_readp; 135 fs->disk_writep = mmc_rspi_writep; 136 } 118 137 119 138 if (fs->fs_type == 0){ … … 125 144 126 145 if((res = pf_open(fs, name)) != FR_OK){ 127 printf("pf_open(% s) => %d\n", name, res);146 printf("pf_open(%d:%s) => %d\n", drv, name, res); 128 147 return 0; 129 148 } 130 149 131 file->pos = 0;132 150 file->len = fs->fsize; 133 file->name = name;134 151 135 //printf("httpd_fs_open(% s) %d\n", name, file->len);152 //printf("httpd_fs_open(%d:%s) %d\n", drv, name, file->len); 136 153 137 154 return 1; … … 143 160 FRESULT ret; 144 161 UINT rlen; 145 FATFS *fs = (FATFS *) &file->fs;162 FATFS *fs = (FATFS *)file->fs; 146 163 147 164 if((ret = pf_lseek(fs, file->pos)) != FR_OK){ 148 printf("pf_lseek(%d ) => %d\n", file->pos, ret);165 printf("pf_lseek(%d:%s, %d) => %d\n", file->drv, file->name, file->pos, ret); 149 166 return 0; 150 167 } 151 168 152 169 if(file->pos != fs->fptr){ 153 printf("pf_lseek(%d ) != %d\n", file->pos, fs->fptr);170 printf("pf_lseek(%d:%s, %d) != %d\n", file->drv, file->name, file->pos, fs->fptr); 154 171 } 155 172 156 173 if((ret = pf_read(fs, dst, len, &rlen)) != FR_OK){ 157 printf("pf_read(% x, %d) => %d\n", dst, len, ret);174 printf("pf_read(%d:%s, 0x%p, %d) => %d\n", file->drv, file->name, dst, len, ret); 158 175 return 0; 159 176 } 160 177 161 //printf("httpd_fs_read(% s, %d, %d) => %d\n", file->name, file->pos, len, rlen);178 //printf("httpd_fs_read(%d:%s, %d, %d) => %d\n", file->drv, file->name, file->pos, len, rlen); 162 179 163 180 return rlen; -
uKadecot/trunk/uip/apps/webserver/httpd-fs.h
r108 r154 41 41 int pos; 42 42 int len; 43 int drv; 43 44 const char *name; 44 char fs[64/*>sizeof(FATFS)*/];45 void *fs; 45 46 }; 46 47 47 48 /* file must be allocated by caller and will be filled in 48 49 by the function. */ 49 int httpd_fs_open( const char *name, struct httpd_fs_file *file);50 int httpd_fs_open(int drv, const char *name, struct httpd_fs_file *file); 50 51 int httpd_fs_read(struct httpd_fs_file *file, void *dst, int len); 51 52 -
uKadecot/trunk/uip/apps/webserver/httpd.c
r152 r154 198 198 memcpy(pos, statushdr, len); pos += len; 199 199 200 len = strlen(http_content_encoding_gzip); 201 memcpy(pos, http_content_encoding_gzip, len); pos += len; 200 if (s->drv == 0) { 201 len = strlen(http_content_encoding_gzip); 202 memcpy(pos, http_content_encoding_gzip, len); pos += len; 203 } 202 204 203 205 ptr = strrchr(s->message.request_url, ISO_period); … … 244 246 PT_THREAD(handle_output(struct httpd_state *s)) 245 247 { 246 char *ptr;247 248 248 PT_BEGIN(&s->outputpt); 249 249 250 if (!httpd_fs_open(s->message.request_url, &s->file)) { 251 httpd_fs_open(http_404_html, &s->file); 250 s->file.fs = ((char *)&s[1]) - 64 - 512; 251 252 if (!httpd_fs_open(s->drv, s->filename, &s->file)) { 253 s->drv = 0; 254 httpd_fs_open(s->drv, http_404_html, &s->file); 252 255 strcpy_s(s->message.request_url, sizeof(s->message.request_url), http_404_html); 253 256 PT_WAIT_THREAD(&s->outputpt, … … 259 262 send_headers(s, 260 263 http_header_200)); 261 ptr = strchr(s->message.request_url, ISO_period);262 264 PT_WAIT_THREAD(&s->outputpt, send_file(s)); 263 265 } … … 406 408 if ((s->message.request_url[0] == '\0') || ((s->message.request_url[0] == '/') && (s->message.request_url[1] == '\0'))) { 407 409 strncpy_s(s->message.request_url, sizeof(s->message.request_url), http_index_html, sizeof(s->message.request_url)); 410 s->filename = s->message.request_url; 411 } 412 /* "/~/"ならSDカードから読み込み */ 413 else if ((s->message.request_url[0] == '/') && (s->message.request_url[1] == '~') && (s->message.request_url[2] == '/')) { 414 s->drv = 1; 415 s->filename = &s->message.request_url[2]; 416 } 417 else { 418 s->drv = 0; 419 s->filename = s->message.request_url; 408 420 } 409 421 -
uKadecot/trunk/uip/apps/webserver/httpd.h
r108 r154 47 47 char inputbuf[50]; 48 48 char state; 49 int drv; 50 char *filename; 51 int len; 49 52 struct httpd_fs_file file; 50 int len;51 unsigned short count;52 53 int parse_pos; 53 54 int parse_len;
Note:
See TracChangeset
for help on using the changeset viewer.