Changeset 331 for EcnlProtoTool/trunk/ntshell/fatfs
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/ntshell/fatfs
- Files:
-
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/ntshell/fatfs/ff.c
r321 r331 19 19 #include "ff.h" /* Declarations of FatFs API */ 20 20 #include "diskio.h" /* Declarations of disk I/O functions */ 21 21 #include "util/ntstdio.h" 22 #include "shellif.h" 22 23 23 24 /*-------------------------------------------------------------------------- … … 3909 3910 if (dir[DIR_Attr] & AM_DIR) { /* The new object is a directory */ 3910 3911 temp_new_path = (TCHAR *)ff_memalloc((_MAX_LFN + 1) * sizeof(WCHAR)); 3911 snprintf(temp_new_path, _MAX_LFN, "%s/%s", path_new, basename((char *)path_old));3912 ntstdio_snprintf(temp_new_path, _MAX_LFN, "%s/%s", path_new, basename((char *)path_old)); 3912 3913 res = follow_path(&djn, temp_new_path); 3913 3914 } -
EcnlProtoTool/trunk/ntshell/fatfs/ff.h
r321 r331 162 162 const TCHAR* pat; /* Pointer to the name matching pattern */ 163 163 #endif 164 struct dirent *dirent;165 164 } DIR; 166 165 -
EcnlProtoTool/trunk/ntshell/fatfs/ffarch.c
r321 r331 39 39 */ 40 40 41 #include "shellif.h" 41 42 #include <kernel.h> 42 43 #include <stdlib.h> … … 50 51 #include "ff.h" 51 52 #include "tlsf.h" 52 #include " ntstdio.h"53 #include "util/ntstdio.h" 53 54 54 55 #define SIO_PORTID 1 … … 58 59 static pool_t sys_pool; 59 60 60 uint32_t __HeapBase; 61 uint32_t __HeapLimit; 61 uint8_t shell_heap[64 * 1024]; 62 62 FATFS RomDisk; 63 63 … … 118 118 void sys_init(void) 119 119 { 120 sys_tlsf = tlsf_create(& __HeapBase);120 sys_tlsf = tlsf_create(&shell_heap); 121 121 if (sys_tlsf == NULL) 122 122 return; 123 123 124 sys_pool = tlsf_add_pool(sys_tlsf, ((uint8_t *)& __HeapBase) + tlsf_size(), ((size_t)&__HeapLimit - (size_t)&__HeapBase) - tlsf_size());124 sys_pool = tlsf_add_pool(sys_tlsf, ((uint8_t *)&shell_heap) + tlsf_size(), sizeof(shell_heap) - tlsf_size()); 125 125 } 126 126 -
EcnlProtoTool/trunk/ntshell/fatfs/fftime.c
r330 r331 30 30 #include "ff.h" 31 31 32 int shell_errno; 33 32 34 /* 2000-03-01 (mod 400 year, immediately after feb29 */ 33 35 #define LEAPOCH (946684800LL + 86400*(31+29)) … … 200 202 * __secs_to_zone cannot safely handle them. */ 201 203 if (*t < INT_MIN * 31622400LL || *t > INT_MAX * 31622400LL) { 202 errno = EOVERFLOW;204 shell_errno = EOVERFLOW; 203 205 return 0; 204 206 } 205 207 //TODO:__secs_to_zone(*t, 0, &tm->tm_isdst, &tm->__tm_gmtoff, 0, &tm->__tm_zone); 206 208 if (__secs_to_tm((long long)*t /*+ tm->__tm_gmtoff*/, tm) < 0) { 207 errno = EOVERFLOW;209 shell_errno = EOVERFLOW; 208 210 return 0; 209 211 } … … 220 222 { 221 223 if (__secs_to_tm(*t, tm) < 0) { 222 errno = EOVERFLOW;224 shell_errno = EOVERFLOW; 223 225 return 0; 224 226 } … … 249 251 250 252 error: 251 errno = EOVERFLOW;253 shell_errno = EOVERFLOW; 252 254 return -1; 253 255 } … … 258 260 struct tm _tm; 259 261 260 t ime(&temp);262 temp = rtc_read(); 261 263 gmtime_r(&temp, &_tm); 262 264 -
EcnlProtoTool/trunk/ntshell/fatfs/sdfs.h
r321 r331 24 24 25 25 #include <stdint.h> 26 #include <time.h> 26 //#include <time.h> 27 #define __NEED_time_t 28 #include "../musl-1.1.18/include/bits/alltypes.h" 27 29 #include "gpio_api.h" 28 30 #include "spi_api.h"
Note:
See TracChangeset
for help on using the changeset viewer.