mirror of
https://github.com/SpacehuhnTech/esp8266_deauther.git
synced 2025-12-21 14:51:08 -08:00
Added debug.h
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
#ifndef config_h
|
#ifndef config_h
|
||||||
#define config_h
|
#define config_h
|
||||||
|
|
||||||
|
#define ENABLE_DEBUG
|
||||||
|
#define DEBUG_PORT Serial
|
||||||
|
#define DEBUG_BAUD 115200
|
||||||
|
|
||||||
#define DEFAULT_ESP8266
|
#define DEFAULT_ESP8266
|
||||||
|
|
||||||
/* ---------------------------------------------------------- */
|
/* ---------------------------------------------------------- */
|
||||||
/* ===>> !!! Uncomment the board taht you're using: !!! <<=== */
|
/* ===>> !!! Uncomment the board that you're using: !!! <<=== */
|
||||||
/* ---------------------------------------------------------- */
|
/* ---------------------------------------------------------- */
|
||||||
|
|
||||||
// #define NODEMCU
|
// #define NODEMCU
|
||||||
|
|||||||
45
esp8266_deauther/debug.h
Normal file
45
esp8266_deauther/debug.h
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2020 Stefan Kremser (@Spacehuhn)
|
||||||
|
This software is licensed under the MIT License. See the license file for details.
|
||||||
|
Source: github.com/spacehuhn/esp8266_deauther
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <climits> // LONG_MAX
|
||||||
|
#include <Arduino.h> // Serial
|
||||||
|
|
||||||
|
#ifdef ENABLE_DEBUG
|
||||||
|
|
||||||
|
#define debug_init()\
|
||||||
|
DEBUG_PORT.begin(DEBUG_BAUD);\
|
||||||
|
DEBUG_PORT.setTimeout(LONG_MAX);\
|
||||||
|
DEBUG_PORT.println();
|
||||||
|
|
||||||
|
#define debug(...) DEBUG_PORT.print(__VA_ARGS__)
|
||||||
|
#define debugln(...) DEBUG_PORT.println(__VA_ARGS__)
|
||||||
|
#define debugf(...) DEBUG_PORT.printf(__VA_ARGS__)
|
||||||
|
#define debugF(...) DEBUG_PORT.print(F(__VA_ARGS__))
|
||||||
|
#define debuglnF(...) DEBUG_PORT.println(F(__VA_ARGS__))
|
||||||
|
|
||||||
|
#define debug_available() DEBUG_PORT.available()
|
||||||
|
#define debug_read() DEBUG_PORT.read()
|
||||||
|
#define debug_peek() DEBUG_PORT.peek()
|
||||||
|
|
||||||
|
#else /* ifdef ENABLE_DEBUG */
|
||||||
|
|
||||||
|
#define debug_init() 0
|
||||||
|
|
||||||
|
#define debug(...) 0
|
||||||
|
#define debugln(...) 0
|
||||||
|
#define debugf(...) 0
|
||||||
|
#define debugF(...) 0
|
||||||
|
#define debuglnF(...) 0
|
||||||
|
|
||||||
|
#define debug_available() 0
|
||||||
|
#define debug_read() 0
|
||||||
|
#define debug_peek() 0
|
||||||
|
|
||||||
|
#endif /* ifdef ENABLE_DEBUG */
|
||||||
Reference in New Issue
Block a user