Skip to content

Commit 124ebc3

Browse files
committed
[tfkernel][micro_time] 使用Arduino原生API代替peripherals API
1 parent 8eaa5bf commit 124ebc3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tensorflow/lite/micro/micro_time.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ limitations under the License.
2727

2828
#include "tensorflow/lite/micro/micro_time.h"
2929

30-
#include "peripherals/utility.h"
31-
32-
#if defined(TF_LITE_USE_CTIME)
30+
#if !defined(TF_LITE_USE_CTIME)
31+
#include <Arduino.h>
32+
#else
3333
#include <ctime>
3434
#endif
3535

@@ -47,7 +47,7 @@ uint32_t ticks_per_second() { return 1000000; }
4747
// required for a platform to support Tensorflow Lite for Microcontrollers
4848
// profiling. This returns 0 by default because timing is an optional feature
4949
// that builds without errors on platforms that do not need it.
50-
uint32_t GetCurrentTimeTicks() { return peripherals::MicrosecondsCounter(); }
50+
uint32_t GetCurrentTimeTicks() { return micros(); }
5151

5252
#else // defined(TF_LITE_USE_CTIME)
5353

0 commit comments

Comments
 (0)