Fixes
This commit is contained in:
17
marlin2.cpp
17
marlin2.cpp
@@ -218,6 +218,23 @@ namespace esphome {
|
||||
return;
|
||||
}
|
||||
|
||||
size_t first_space = MarlinOutput.find(' ');
|
||||
size_t second_space = MarlinOutput.find(' ', first_space + 1);
|
||||
|
||||
if(second_space == std::string::npos && first_space == std::string::npos) {
|
||||
std::string short_name = MarlinOutput.substr(0, first_space);
|
||||
std::string long_name = MarlinOutput.substr(second_space + 1);
|
||||
|
||||
file_table_[long_name] = short_name;
|
||||
|
||||
ESP_LOGD(TAG, "Uloženo do tabulky: %s => %s", long_name.c_str(), short_name.c_str());
|
||||
|
||||
//reset string for next line
|
||||
MarlinOutput="";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ESP_LOGD(TAG, "#%s#",MarlinOutput.c_str());
|
||||
MarlinOutput="";
|
||||
return;
|
||||
|
Reference in New Issue
Block a user