This commit is contained in:
2020-07-02 23:06:37 +02:00
parent 1bd3eb79dc
commit 1fa80250fe
3 changed files with 86 additions and 50 deletions

16
Debug.h
View File

@@ -75,12 +75,16 @@ extern "C" {
#endif
#include "esp_log.h"
#define debug(str) ESP_LOGI("", str);
#define debugMod(module, str) ESP_LOGI(module, str);
#define debugMod1(module, str, val) ESP_LOGI(module, str, val);
#define debugMod2(module, str, v1, v2) ESP_LOGI(module, str, v1, v2);
#define debugMod3(module, str, v1, v2, v3) ESP_LOGI(module, str, v1, v2, v3);
#define debugMod4(module, str, v1, v2, v3, v4) ESP_LOGI(module, str, v1, v2, v3, v4);
#define debug(str) printf(str);
#define debugMod(module, str) printf("i[%-10s] ", module); printf(str); printf("\n");
#define debugMod1(module, str, v1) printf("i[%-10s] ", module); printf(str, v1); printf("\n");
#define debugMod2(module, str, v1, v2) printf("i[%-10s] ", module); printf(str, v1, v2); printf("\n");
#define debugMod3(module, str, v1, v2, v3) printf("i[%-10s] ", module); printf(str, v1, v2, v3); printf("\n");
#define debugMod4(module, str, v1, v2, v3, v4) printf("i[%-10s] ", module); printf(str, v1, v2, v3, v4); printf("\n");
#define errorMod(module, str) printf("e[%-10s] ", module); printf(str); printf("\n"); esp_restart();
#define errorMod1(module, str, v1) printf("e[%-10s] ", module); printf(str, v1); printf("\n"); esp_restart();
#define IF_DEBUG(a) a
#define debugShow(buf, len) hexdump(buf,len)