Firmware Updater: Log avrdude arguments

This commit is contained in:
Vojtech Kral 2019-02-22 10:12:38 +01:00
parent ed5598f59f
commit 91ccdb0a4d
4 changed files with 17 additions and 9 deletions

View file

@ -169,22 +169,22 @@
#define LT_OBJDIR ".libs/"
/* Name of package */
#define PACKAGE "avrdude"
#define PACKAGE "avrdude-slic3r"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "avrdude-dev@nongnu.org"
#define PACKAGE_BUGREPORT "https://github.com/prusa3d/Slic3r/issues"
/* Define to the full name of this package. */
#define PACKAGE_NAME "avrdude"
#define PACKAGE_NAME "avrdude-slic3r"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "avrdude 6.3-20160220"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "avrdude"
#define PACKAGE_TARNAME "avrdude-slic3r"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
#define PACKAGE_URL "https://github.com/prusa3d/Slic3r"
/* Define to the version of this package. */
#define PACKAGE_VERSION "6.3-20160220"

View file

@ -96,13 +96,20 @@ void AvrDude::priv::unset_handlers()
int AvrDude::priv::run_one(const std::vector<std::string> &args) {
std::vector<char*> c_args {{ const_cast<char*>(PACKAGE_NAME) }};
std::vector<char*> c_args {{ const_cast<char*>(PACKAGE) }};
std::string command_line { PACKAGE };
for (const auto &arg : args) {
c_args.push_back(const_cast<char*>(arg.data()));
command_line.push_back(' ');
command_line.append(arg);
}
command_line.push_back('\n');
HandlerGuard guard(*this);
message_fn(command_line.c_str(), command_line.size());
const auto res = ::avrdude_main(static_cast<int>(c_args.size()), c_args.data(), sys_config.c_str());
return res;

View file

@ -1082,6 +1082,7 @@ int avrdude_main(int argc, char * argv [], const char *sys_config)
if (rc < 0) {
exitrc = 1;
pgm->ppidata = 0; /* clear all bits at exit */
avrdude_message(MSG_INFO, "%s: Could not open port: %s\n", progname, port);
goto main_exit;
}
is_open = 1;