diff --git a/software/MySrc/Common/cli.c b/software/MySrc/Common/cli.c index 189447a..27cf175 100644 --- a/software/MySrc/Common/cli.c +++ b/software/MySrc/Common/cli.c @@ -182,7 +182,7 @@ void cli_rx_callback(cli_handle_t* CLI_h) { #define RETRY_DELAY_US 100 //us int _write(int file, char *ptr, int len) { - if (cli_h.cli_disable_log_opt) return 0; //return 0 "success but no bytes were sent" + if (cli_h.disable_log_opt) return 0; //return 0 "success but no bytes were sent" if (file == STDOUT_FILENO || file == STDERR_FILENO) { if (cli_h.enable_tx_buffering_opt && cli_h.cli_connected_flag) { diff --git a/software/MySrc/Common/cli.h b/software/MySrc/Common/cli.h index 7474e71..bbecb37 100644 --- a/software/MySrc/Common/cli.h +++ b/software/MySrc/Common/cli.h @@ -24,7 +24,7 @@ typedef struct { typedef struct { // flags/options bool halt_until_connected_opt; // set to true if you want to wait for a "connect" command before starting the main application (useful for debugging) - bool cli_disable_log_opt; // set to true if you want to disable logging from the CLI, AND SAVE CPU TIME + bool disable_log_opt; // set to true if you want to disable logging from the CLI, AND SAVE CPU TIME bool cli_connected_flag; bool new_data_flag; diff --git a/software/MySrc/Common/log.c b/software/MySrc/Common/log.c index 5760d37..08b1103 100644 --- a/software/MySrc/Common/log.c +++ b/software/MySrc/Common/log.c @@ -68,7 +68,7 @@ void log_msg(log_level_t log_level, const char *format, va_list args) { } void LOGD(const char *format, ...) { - if (cli_h.cli_disable_log_opt) return; // to save cpu time when needed + if (cli_h.disable_log_opt) return; // to save cpu time when needed va_list args; va_start(args, format); log_msg(LOG_LEVEL_DEBUG, format, args); @@ -76,7 +76,7 @@ void LOGD(const char *format, ...) { } void LOGI(const char *format, ...) { - if (cli_h.cli_disable_log_opt) return; // to save cpu time when needed + if (cli_h.disable_log_opt) return; // to save cpu time when needed va_list args; va_start(args, format); log_msg(LOG_LEVEL_INFO, format, args); @@ -84,7 +84,7 @@ void LOGI(const char *format, ...) { } void LOGW(const char *format, ...) { - if (cli_h.cli_disable_log_opt) return; // to save cpu time when needed + if (cli_h.disable_log_opt) return; // to save cpu time when needed va_list args; va_start(args, format); log_msg(LOG_LEVEL_WARN, format, args); @@ -92,7 +92,7 @@ void LOGW(const char *format, ...) { } void LOGE(const char *format, ...) { - if (cli_h.cli_disable_log_opt) return; // to save cpu time when needed + if (cli_h.disable_log_opt) return; // to save cpu time when needed va_list args; va_start(args, format); log_msg(LOG_LEVEL_ERROR, format, args); @@ -100,7 +100,7 @@ void LOGE(const char *format, ...) { } void LOG(const char *format, ...) { - if (cli_h.cli_disable_log_opt) return; // to save cpu time when needed + if (cli_h.disable_log_opt) return; // to save cpu time when needed va_list args; va_start(args, format); diff --git a/software/MySrc/mymain.c b/software/MySrc/mymain.c index d9100c3..d4e3855 100644 --- a/software/MySrc/mymain.c +++ b/software/MySrc/mymain.c @@ -67,7 +67,7 @@ static void flight_ctrl_cycle(void); void myinit(void) { cli_h.halt_until_connected_opt = false; //set to false if you don't want to wait for a connection cli_h.enable_tx_buffering_opt = false; //false for init (procces has to be runned to put out buffered data) - cli_h.cli_disable_log_opt = false; // completely disables logging (returns from log functions immediately to save CPU time) + cli_h.disable_log_opt = false; // completely disables logging (returns from log functions immediately to save CPU time) @@ -106,8 +106,8 @@ void myinit(void) { LED_blink_pattern(20, 2, 50, 50); LED_off(); - cli_h.enable_tx_buffering_opt = false; //enable tx buffering NOTE: data will be buffered from now on, and ONLY be sent when cli_process is called!! - cli_h.cli_disable_log_opt = true; + cli_h.enable_tx_buffering_opt = true; //enable tx buffering NOTE: data will be buffered from now on, and ONLY be sent when cli_process is called!! + cli_h.disable_log_opt = false; }