Added i2c tools

This commit is contained in:
Sebastien Leclerc
2019-06-25 11:53:12 -04:00
parent 463d66f6ac
commit 375a5aec2a
13 changed files with 519 additions and 54 deletions

View File

@@ -15,6 +15,7 @@ extern "C" {
#include "cmd_system.h"
#include "cmd_wifi.h"
#include "cmd_nvs.h"
#include "cmd_i2ctools.h"
#ifdef __cplusplus
}

View File

@@ -31,7 +31,7 @@ pthread_t thread_console;
static void * console_thread();
void console_start();
static const char * TAG = "console";
extern char current_namespace[];
/* Prompt to be printed before each line.
* This can be customized, made dynamic, etc.
*/
@@ -238,6 +238,7 @@ void console_start() {
register_wifi();
register_nvs();
register_squeezelite();
register_i2ctools();
printf("\n"
"Type 'help' to get the list of commands.\n"
"Use UP/DOWN arrows to navigate through command history.\n"

View File

@@ -16,7 +16,7 @@
#define SET_MIN_MAX_SIZED(val,var,siz) var=val; if(var<min_##var) min_##var=var; if(var>max_##var) max_##var=var; count_##var++; avgtot_##var+= var;size_##var=siz
#define RESET_MIN_MAX(var) min_##var=PERF_MAX; max_##var=0; avgtot_##var=0;count_##var=0;var=0;size_##var=0
#define RESET_MIN_MAX_DURATION(var) min_##var=PERF_MAX; max_##var=0; avgtot_##var=0;count_##var=0;var=0
#define DECLARE_MIN_MAX(var) static uint32_t min_##var = PERF_MAX, max_##var = 0, size_##var = 0, count_##var=0;uint64_t avgtot_##var = 0; uint32_t var=0
#define DECLARE_MIN_MAX(var) static uint32_t min_##var = PERF_MAX, max_##var = 0, size_##var = 0, count_##var=0;static uint64_t avgtot_##var = 0; static uint32_t var=0
#define DECLARE_MIN_MAX_DURATION(var) static uint32_t min_##var = PERF_MAX, max_##var = 0, count_##var=0; uint64_t avgtot_##var = 0; uint32_t var=0
#define LINE_MIN_MAX_AVG(var) (uint32_t)(count_##var>0?avgtot_##var/count_##var:0)