![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Arianna autonomous DAQ firmware
Dependencies: mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW
Diff: SnSDUtils.cpp
- Revision:
- 36:87865913ae6f
- Parent:
- 31:b5bd3b189150
- Child:
- 38:9070c17536cd
diff -r 549714a257a4 -r 87865913ae6f SnSDUtils.cpp --- a/SnSDUtils.cpp Thu Feb 07 23:06:36 2013 +0000 +++ b/SnSDUtils.cpp Thu May 23 22:26:39 2013 +0000 @@ -112,8 +112,14 @@ printf("making dir %s\r\n",dirname); #endif mkdir(dirname, 0777); +#ifdef DEBUG + printf("opening dir %s\r\n",dirname); +#endif rd = opendir(dirname); } +#ifdef DEBUG + printf("returning rd=%p\r\n",(void*)rd); +#endif return rd; } @@ -129,8 +135,17 @@ FATDirHandle* rd(dynamic_cast<FATDirHandle*>( OpenOrMakeDir(rdnm) )); struct dirent* rdent; uint16_t dseq(0), maxs(0); +#ifdef DEBUG + printf("starting readdir loop over %p\r\n",(void*)rd); +#endif while ( (rdent = readdir(rd))!=NULL ) { +#ifdef DEBUG + printf("rdent = %p\r\n",(void*)rdent); +#endif if ((rd->filinfo()->fattrib & AM_DIR)!=0) { +#ifdef DEBUG + printf("is a dir\r\n"); +#endif // is a directory const int ncm = sscanf(rdent->d_name, "s%hu", &dseq); if (ncm==1) { @@ -139,7 +154,15 @@ } } } +#ifdef DEBUG + else { + printf("not a dir\r\n"); + } +#endif } +#ifdef DEBUG + printf("closing directory %p\r\n",(void*)rd); +#endif closedir(rd); #ifdef DEBUG printf("Found max seq dir num %hu for run %u\r\n",run,maxs);