minor changes, added ALL required externals

This commit is contained in:
2021-03-14 15:20:44 +01:00
parent 3da4722748
commit 5e8ba82e6e
22 changed files with 1853 additions and 30 deletions

55
user/ESP8266lib/Debug.h Normal file
View File

@@ -0,0 +1,55 @@
#ifndef DEBUG_H
#define DEBUG_H
#include <cstdint>
extern "C" {
#include "ets_sys.h"
#include "c_types.h"
#include "osapi.h"
//#include "gpio.h"
//#include "os_type.h"
//#include "user_config.h"
#include "user_interface.h"
//#include "wpa2_enterprise.h"
//#include "inttypes.h"
#include "mem.h"
#include "espconn.h"
#include "ESP8266lib/c++.h"
#include "driver/uart.h"
}
void hexdump(const uint8_t* buf, uint8_t len) {
for (int i = 0; i < len; ++i) {
os_printf("%02x ", buf[i]);
}
os_printf("\n");
}
#ifdef DEBUG
#define debug(str) os_printf(str)
#define debugMod(module, str) os_printf("[%s] %s\n", module, str)
#define debugMod1(module, str, val) os_printf("[%s] ", module); os_printf(str, val); os_printf("\n");
#define debugMod2(module, str, v1, v2) os_printf("[%s] ", module); os_printf(str, v1, v2); os_printf("\n");
#define debugMod3(module, str, v1, v2, v3) os_printf("[%s] ", module); os_printf(str, v1, v2, v3); os_printf("\n");
#define IF_DEBUG(a) a
#define debugShow(buf, len) hexdump(buf,len)
#else
#define debug(module, str)
#define debugMod(module, str)
#define debugMod1(module, str, val)
#define debugMod2(module, str, v1, v2)
#define debugMod3(module, str, v1, v2, v3)
#define IF_DEBUG(a)
#define debugShow(a, b)
#endif
#endif // DEBUG_H