void CardReader::openAndPrintFile(const char *name) { char cmd[4 + strlen(name) + 1]; // Room for "M23 ", filename, and null sprintf_P(cmd, PSTR("M23 %s"), name); for (char *c = &cmd[4]; *c; c++) *c = tolower(*c); enqueue_and_echo_command(cmd); enqueue_and_echo_commands_P(PSTR("M24")); }
static void menu_action_sdfile(const char* filename) { char cmd[30]; char* c; sprintf_P(cmd, PSTR("M23 %s"), filename); for(c = &cmd[4]; *c; c++) *c = tolower(*c); enqueue_and_echo_command(cmd); enqueue_and_echo_commands_P(PSTR("M24")); setpageInfo(); }