bool scan_dir_() { char tmp[256]; strcpy(tmp, path_org_); char* p = strrchr(tmp, '*'); if(p != nullptr) { p[0] = 0; utils::format("Dir List Start: '%s'\n") % tmp; if(!dir_list_.start(tmp)) { debug_format("Can't start dir list: '%s'\n") % tmp; } return true; } else { return false; } }
int main(void) { uint8_t t=0; SystemInit(); systick_init(); init_usart(usart1); //init_rtc(); // init_net(); len=0; //buffer[0]=1; //send(usart1,buffer,1); while (1) { process_net(); //if(t!=timer.sec) if(rtc_flag==1) { rtc_flag=0; //time_get(); //t=timer.sec; //debug_format("%d-----\r\n",l); //l++; //debug_format("Time: %0.4dÄê%0.2dÔÂ%0.2dÈÕ %0.2d:%0.2d:%0.2d\r\n",timer.w_year,timer.w_month,timer.w_date,timer.hour,timer.min,timer.sec); } //send(usart4,buffer,len); if(delay>30) { //time_show(); len=receive(usart1,buffer); if(len>0) { //send(usart1,buffer,len); debug_format("the receive len is %d \r\n",len); len=0; } delay=0; } } }
void make_wildcards_(uint16_t idx) { if(idx > 0 && idx < 1000) ; else return; const char* ptr = std::strrchr(path_org_, '*'); if(ptr != nullptr) { char tmp[256]; strcpy(tmp, path_org_); uint32_t ofs = ptr - path_org_; tmp[ofs] = 0; utils::sformat("%s%03d%s", path_, sizeof(path_)) % tmp % idx % &tmp[ofs + 1]; } else { utils::sformat("/%s", path_, sizeof(path_)) % path_org_; } if(std::strrchr(path_, '*') != nullptr) { debug_format("Illegual character for path: '%s'\n") % path_; path_[0] = 0; } utils::format("Write file org: '%s'\n") % path_org_; utils::format("Write file mak: '%s'\n") % path_; }