Skip to content

Commit 7ad401c

Browse files
committed
Changed PYTHONLIB to SWIGLIB in ifdef's. This way, it is no longer Python specifics since one could use swig create libraries for other languages.
1 parent 526c88d commit 7ad401c

5 files changed

Lines changed: 16 additions & 16 deletions

File tree

python/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ SRC_DIR = ../src
2424
TEST_DIR = ../test
2525

2626
INCLUDES = -I$(SRC_DIR) -I$(TEST_DIR)
27-
DEFFLAGS = -DUNIT_TEST -DPYTHONLIB
27+
DEFFLAGS = -DUNIT_TEST -DSWIGLIB
2828
# Flags passed to the preprocessor.
2929
# Set Google Test's header directory as a system directory, such that
3030
# the compiler doesn't generate warnings in Google Test headers.

src/IRac.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#else
2020
using ::roundf;
2121
#endif
22-
#ifdef PYTHONLIB
22+
#ifdef SWIGLIB
2323
#include <vector>
2424
extern std::vector<int> timingList;
2525
#endif
@@ -79,7 +79,7 @@ extern std::vector<int> timingList;
7979
#ifndef UNIT_TEST
8080
#define OUTPUT_DECODE_RESULTS_FOR_UT(ac)
8181
#else
82-
#ifndef PYTHONLIB
82+
#ifndef SWIGLIB
8383
/* NOTE: THIS IS NOT A DOXYGEN COMMENT (would require ENABLE_PREPROCESSING-YES)
8484
/// If compiling for UT *and* a test receiver @c IRrecv is provided via the
8585
/// @c _utReceived param, this injects an "output" gadget @c _lastDecodeResults
@@ -107,7 +107,7 @@ extern std::vector<int> timingList;
107107
}
108108
#else
109109
#define OUTPUT_DECODE_RESULTS_FOR_UT(ac)
110-
#endif // PYTHONLIB
110+
#endif // SWIGLIB
111111
#endif // UNIT_TEST
112112

113113
/// Class constructor
@@ -191,7 +191,7 @@ stdAc::state_t IRac::getState(void) { return next; }
191191
/// @return A Ptr to a state containing the previously sent settings.
192192
stdAc::state_t IRac::getStatePrev(void) { return _prev; }
193193

194-
#ifdef PYTHONLIB
194+
#ifdef SWIGLIB
195195
std::vector<int> IRac::getTiming(void) { return timingList; }
196196
void IRac::resetTiming(void) { timingList.clear(); }
197197
#endif

src/IRac.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#else
99
#include <memory>
1010
#endif
11-
#ifdef PYTHONLIB
11+
#ifdef SWIGLIB
1212
#include <vector>
1313
#endif
1414
#include "IRremoteESP8266.h"
@@ -111,14 +111,14 @@ class IRac {
111111
static String swinghToString(const stdAc::swingh_t swingh);
112112
stdAc::state_t getState(void);
113113
stdAc::state_t getStatePrev(void);
114-
#ifdef PYTHONLIB
114+
#ifdef SWIGLIB
115115
std::vector<int> getTiming(void);
116116
void resetTiming(void);
117117
#endif
118118
bool hasStateChanged(void);
119119
stdAc::state_t next; ///< The state we want the device to be in after we send
120120
#ifdef UNIT_TEST
121-
#ifndef PYTHONLIB
121+
#ifndef SWIGLIB
122122
/// @cond IGNORE
123123
/// UT-specific
124124
/// See @c OUTPUT_DECODE_RESULTS_FOR_UT macro description in IRac.cpp

src/IRsend.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#endif
1616
#include "IRtimer.h"
1717

18-
#ifdef PYTHONLIB
18+
#ifdef SWIGLIB
1919
std::vector<int> timingList;
2020
#endif
2121

@@ -159,7 +159,7 @@ void IRsend::_delayMicroseconds(uint32_t usec) {
159159
/// Ref:
160160
/// https://www.analysir.com/blog/2017/01/29/updated-esp8266-nodemcu-backdoor-upwm-hack-for-ir-signals/
161161
uint16_t IRsend::mark(uint16_t usec) {
162-
#ifdef PYTHONLIB
162+
#ifdef SWIGLIB
163163
// std::cout << usec << " ";
164164
timingList.push_back(usec);
165165
return 1;
@@ -206,7 +206,7 @@ uint16_t IRsend::mark(uint16_t usec) {
206206
void IRsend::space(uint32_t time) {
207207
ledOff();
208208
if (time == 0) return;
209-
#ifdef PYTHONLIB
209+
#ifdef SWIGLIB
210210
// std::cout << time << " ";
211211
timingList.push_back(time);
212212
#else

src/IRsend.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
#define __STDC_LIMIT_MACROS
88
#include <stdint.h>
9-
#ifdef PYTHONLIB
9+
#ifdef SWIGLIB
1010
#include <vector>
11-
#endif // PYTHONLIB
11+
#endif // SWIGLIB
1212
#include "IRremoteESP8266.h"
1313

1414
// Originally from https://github.com/shirriff/Arduino-IRremote/
@@ -17,11 +17,11 @@
1717

1818
#if TEST || UNIT_TEST
1919
#define VIRTUAL virtual
20-
#ifdef PYTHONLIB
20+
#ifdef SWIGLIB
2121
#define VIRTUALMS
2222
#else
2323
#define VIRTUALMS virtual
24-
#endif // PYTHONLIB
24+
#endif // SWIGLIB
2525
#else
2626
#define VIRTUAL
2727
#define VIRTUALMS
@@ -52,7 +52,7 @@ const uint32_t kDefaultMessageGap = 100000;
5252
/// @note Not using "-1" as it may be a valid external temp
5353
const float kNoTempValue = -100.0;
5454

55-
#ifdef PYTHONLIB
55+
#ifdef SWIGLIB
5656
// Global
5757
extern std::vector<int> timingList;
5858
#endif

0 commit comments

Comments
 (0)