mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-05 14:20:41 +08:00
parent
b3f3af997f
commit
bb2b7a8e62
@ -242,9 +242,10 @@
|
||||
//DEBUG_OUTPUT_SERIAL2 3
|
||||
//DEBUG_OUTPUT_TELNET 4
|
||||
//DEBUG_OUTPUT_WEBSOCKET 5
|
||||
//#define ESP_DEBUG_FEATURE DEBUG_OUTPUT_SERIAL0
|
||||
//#define ESP_DEBUG_FEATURE DEBUG_OUTPUT_SERIAL2
|
||||
|
||||
#ifdef ESP_DEBUG_FEATURE
|
||||
#define DEBUG_BAUDRATE 115200
|
||||
#define DEBUG_ESP3D_OUTPUT_PORT 8000
|
||||
#endif //ESP_DEBUG_FEATURE
|
||||
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include "../include/esp3d_config.h"
|
||||
#if defined(ESP_DEBUG_FEATURE)
|
||||
|
||||
#ifndef DEBUG_BAUDRATE
|
||||
#define DEBUG_BAUDRATE 115200
|
||||
#ndif //~DEBUG_BAUDRATE
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
const char * pathToFileName(const char * path)
|
||||
{
|
||||
@ -38,6 +42,19 @@ const char * pathToFileName(const char * path)
|
||||
}
|
||||
#endif //ARDUINO_ARCH_ESP8266
|
||||
|
||||
void initDebug()
|
||||
{
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
DEBUG_OUTPUT_SERIAL.begin(DEBUG_BAUDRATE, SERIAL_8N1, SERIAL_FULL, (ESP_DEBUG_TX_PIN == -1)?1:ESP_DEBUG_TX_PIN);
|
||||
#if ESP_DEBUG_RX_PIN != -1
|
||||
DEBUG_OUTPUT_SERIAL.pins((ESP_DEBUG_TX_PIN == -1)?1:ESP_DEBUG_TX_PIN, ESP_DEBUG_RX_PIN)
|
||||
#endif //ESP_DEBUG_RX_PIN != -1
|
||||
#endif //ARDUINO_ARCH_ESP8266
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
DEBUG_OUTPUT_SERIAL.begin (DEBUG_BAUDRATE, SERIAL_8N1, ESP_DEBUG_RX_PIN, ESP_DEBUG_TX_PIN);
|
||||
#endif //ARDUINO_ARCH_ESP32
|
||||
}
|
||||
|
||||
//Telnet
|
||||
#if ESP_DEBUG_FEATURE == DEBUG_OUTPUT_TELNET
|
||||
Telnet_Server telnet_debug;
|
||||
|
@ -37,6 +37,8 @@ extern const char * pathToFileName(const char * path);
|
||||
//Serial
|
||||
#if (ESP_DEBUG_FEATURE == DEBUG_OUTPUT_SERIAL0) || (ESP_DEBUG_FEATURE == DEBUG_OUTPUT_SERIAL1) || (ESP_DEBUG_FEATURE == DEBUG_OUTPUT_SERIAL2)
|
||||
|
||||
extern void initDebug();
|
||||
|
||||
#if ESP_DEBUG_FEATURE == DEBUG_OUTPUT_SERIAL0
|
||||
#define DEBUG_OUTPUT_SERIAL Serial
|
||||
#endif //DEBUG_OUTPUT_SERIAL0
|
||||
@ -46,8 +48,9 @@ extern const char * pathToFileName(const char * path);
|
||||
#if ESP_DEBUG_FEATURE == DEBUG_OUTPUT_SERIAL2
|
||||
#define DEBUG_OUTPUT_SERIAL Serial2
|
||||
#endif //DEBUG_OUTPUT_SERIAL2
|
||||
|
||||
#undef DEBUG_ESP3D_INIT
|
||||
#define DEBUG_ESP3D_INIT DEBUG_OUTPUT_SERIAL.begin(115200);
|
||||
#define DEBUG_ESP3D_INIT initDebug();
|
||||
#define log_esp3d(format, ...) DEBUG_OUTPUT_SERIAL.printf("[ESP3D][%s:%u] %s(): " format "\r\n", pathToFileName(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__)
|
||||
#define log_esp3dS(format, ...) DEBUG_OUTPUT_SERIAL.printf(format "\r\n", ##__VA_ARGS__)
|
||||
#endif //DEBUG_OUTPUT_SERIAL0 || DEBUG_OUTPUT_SERIAL1 || DEBUG_OUTPUT_SERIAL2
|
||||
|
@ -29,6 +29,13 @@
|
||||
#define ESP_TX_PIN -1
|
||||
#endif //~ESP_TX_PIN
|
||||
|
||||
#ifndef ESP_DEBUG_RX_PIN
|
||||
#define ESP_DEBUG_RX_PIN -1
|
||||
#endif //~ESP_DEBUG_RX_PIN
|
||||
#ifndef ESP_DEBUG_TX_PIN
|
||||
#define ESP_DEBUG_TX_PIN -1
|
||||
#endif //~ESP_DEBUG_TX_PIN
|
||||
|
||||
//I2C Pins
|
||||
#ifndef ESP_SDA_PIN
|
||||
#define ESP_SDA_PIN SDA
|
||||
|
@ -22,7 +22,7 @@
|
||||
#define _VERSION_ESP3D_H
|
||||
|
||||
//version and sources location
|
||||
#define FW_VERSION "3.0.0.a67"
|
||||
#define FW_VERSION "3.0.0.a68"
|
||||
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
|
||||
|
||||
#endif //_VERSION_ESP3D_H
|
||||
|
@ -90,7 +90,7 @@ bool SerialService::begin()
|
||||
}
|
||||
ESP3D_SERIAL.setRxBufferSize (SERIAL_RX_BUFFER_SIZE);
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
ESP3D_SERIAL.begin(br, SERIAL_8N1, SERIAL_FULL, (ESP_TX_PIN == -1)?1:ESP_TX_PIN);
|
||||
ESP3D_SERIAL.begin(br, ESP_SERIAL_PARAM, SERIAL_FULL, (ESP_TX_PIN == -1)?1:ESP_TX_PIN);
|
||||
#if ESP_RX_PIN != -1
|
||||
ESP3D_SERIAL.pins((ESP_TX_PIN == -1)?1:ESP_TX_PIN, ESP_RX_PIN)
|
||||
#endif //ESP_RX_PIN != -1
|
||||
|
Loading…
x
Reference in New Issue
Block a user