28 lines
586 B
C
28 lines
586 B
C
#ifndef JANITZA104_ESP32_COMMON_H_
|
|
#define JANITZA104_ESP32_COMMON_H_
|
|
|
|
#include <stdlib.h>
|
|
#include <Arduino.h>
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define PRINTLN(s) Serial.println(s)
|
|
#define PRINT(s) Serial.print(s)
|
|
#define PRINTF(fmt, ...) Serial.printf(fmt, ##__VA_ARGS__)
|
|
|
|
static void printWithPadding(String str, int totalLength);
|
|
|
|
#else
|
|
|
|
#define PRINTLN(s)
|
|
#define PRINT(s)
|
|
#define PRINTF(...)
|
|
#define printWithPadding(s, l)
|
|
|
|
#endif
|
|
|
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
|
|
|
|
bool startsWith(const char* source, const char* prefix);
|
|
|
|
#endif //JANITZA104_ESP32_COMMON_H_
|