Skip to content

Commit 8ae94fb

Browse files
committed
解决Arduino.h中max/min与std::冲突
1 parent e749943 commit 8ae94fb

File tree

9 files changed

+19
-8
lines changed

9 files changed

+19
-8
lines changed

examples/hello_world/arduino_output_handler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515

1616
#include <algorithm>
1717

18-
#include "Arduino.h"
18+
#include "tensorflow/Arduino.h"
1919
#include "constants.h"
2020
#include "output_handler.h"
2121
#include "tensorflow/lite/micro/micro_log.h"

examples/hello_world/hello_world.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ limitations under the License.
1414
==============================================================================*/
1515

1616
#include <TensorFlowLite.h>
17-
#include <RTduino.h>
1817
#include "constants.h"
1918
#include "model.h"
2019
#include "output_handler.h"
20+
#include "tensorflow/Arduino.h"
2121
#include "tensorflow/lite/micro/all_ops_resolver.h"
2222
#include "tensorflow/lite/micro/micro_interpreter.h"
2323
#include "tensorflow/lite/micro/micro_log.h"

examples/micro_speech/arduino_command_responder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License.
1919

2020
#ifndef ARDUINO_EXCLUDE_CODE
2121

22-
#include "Arduino.h"
22+
#include "tensorflow/Arduino.h"
2323
#include "command_responder.h"
2424
#include "tensorflow/lite/micro/micro_log.h"
2525

examples/person_detection/arduino_detection_responder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ limitations under the License.
2121

2222
#include <cmath>
2323

24-
#include "Arduino.h"
24+
#include "tensorflow/Arduino.h"
2525
#include "detection_responder.h"
2626
#include "tensorflow/lite/micro/micro_log.h"
2727

examples/person_detection/arduino_image_provider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using namespace test_over_serial;
3030

3131
#ifndef ARDUINO_EXCLUDE_CODE
3232

33-
#include "Arduino.h"
33+
#include "tensorflow/Arduino.h"
3434

3535
namespace {
3636

src/tensorflow/Arduino.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef TensorFlowLite_Arduino_h
2+
#define TensorFlowLite_Arduino_h
3+
4+
5+
#include <RTduino.h> /* has inclued rtthread.h and Arduino.h */
6+
7+
/* avoid conflict with std::min and std::max */
8+
#undef min
9+
#undef max
10+
11+
#endif /* TensorFlowLite_Arduino_h */

src/tensorflow/lite/micro/micro_string.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020
// more code.
2121

2222
#include "tensorflow/lite/micro/micro_string.h"
23-
#include <rtthread.h>
23+
#include "tensorflow/Arduino.h"
2424

2525
extern "C" int MicroVsnprintf(char* output, int len, const char* format,
2626
va_list args) {

src/tensorflow/lite/micro/micro_time.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ limitations under the License.
2828
#include "tensorflow/lite/micro/micro_time.h"
2929

3030
#if !defined(TF_LITE_USE_CTIME)
31-
#include <Arduino.h>
31+
#include "tensorflow/Arduino.h"
3232
#else
3333
#include <ctime>
3434
#endif

src/tensorflow/lite/micro/system_setup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License.
1919

2020
#include "tensorflow/lite/micro/debug_log.h"
2121

22-
#include "Arduino.h"
22+
#include "tensorflow/Arduino.h"
2323

2424
#define DEBUG_SERIAL_OBJECT (Serial)
2525

0 commit comments

Comments
 (0)