From 79831e64fd5e6b8cfdb2dcd858b0496754e8b06f Mon Sep 17 00:00:00 2001 From: KonstantinKondrashov Date: Thu, 2 Apr 2020 17:54:43 +0800 Subject: [PATCH] spi_flash: Add into sim/stubs the esp_timer --- components/spi_flash/sim/Makefile.files | 2 ++ components/spi_flash/sim/stubs/Makefile.files | 3 +++ .../sim/stubs/esp_timer/include/esp_timer.h | 15 ++++++++++++++ .../sim/stubs/esp_timer/src/esp_timer.c | 20 +++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 components/spi_flash/sim/stubs/esp_timer/include/esp_timer.h create mode 100644 components/spi_flash/sim/stubs/esp_timer/src/esp_timer.c diff --git a/components/spi_flash/sim/Makefile.files b/components/spi_flash/sim/Makefile.files index 88babdaa36..3983b05ceb 100644 --- a/components/spi_flash/sim/Makefile.files +++ b/components/spi_flash/sim/Makefile.files @@ -15,6 +15,7 @@ INCLUDE_DIRS := \ app_update/include \ driver/include \ esp32/include \ + esp_timer/include \ freertos/include \ log/include \ newlib/include \ @@ -29,6 +30,7 @@ INCLUDE_DIRS := \ soc/esp32/include \ soc/include \ esp32/include \ + esp_timer/include \ bootloader_support/include \ app_update/include \ spi_flash/include \ diff --git a/components/spi_flash/sim/stubs/Makefile.files b/components/spi_flash/sim/stubs/Makefile.files index 91c034768d..b8627aff46 100644 --- a/components/spi_flash/sim/stubs/Makefile.files +++ b/components/spi_flash/sim/stubs/Makefile.files @@ -4,6 +4,7 @@ SOURCE_FILES := \ newlib/lock.c \ esp32/crc.cpp \ esp32/esp_random.c \ + esp_timer/src/esp_timer.c \ bootloader_support/src/bootloader_common.c INCLUDE_DIRS := \ @@ -12,6 +13,7 @@ INCLUDE_DIRS := \ app_update/include \ driver/include \ esp32/include \ + esp_timer/include \ freertos/include \ log/include \ newlib/include \ @@ -24,6 +26,7 @@ INCLUDE_DIRS := \ xtensa/include \ xtensa/esp32/include \ esp32/include \ + esp_timer/include \ bootloader_support/include \ app_update/include \ spi_flash/include \ diff --git a/components/spi_flash/sim/stubs/esp_timer/include/esp_timer.h b/components/spi_flash/sim/stubs/esp_timer/include/esp_timer.h new file mode 100644 index 0000000000..954448b0d1 --- /dev/null +++ b/components/spi_flash/sim/stubs/esp_timer/include/esp_timer.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int64_t esp_timer_get_time(void); + +#ifdef __cplusplus +} +#endif + diff --git a/components/spi_flash/sim/stubs/esp_timer/src/esp_timer.c b/components/spi_flash/sim/stubs/esp_timer/src/esp_timer.c new file mode 100644 index 0000000000..657873cad9 --- /dev/null +++ b/components/spi_flash/sim/stubs/esp_timer/src/esp_timer.c @@ -0,0 +1,20 @@ +// Copyright 2020 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "esp_timer.h" + +int64_t esp_timer_get_time(void) +{ + return 0; +}