From 0f6fe0c8e9a81ba4f0de47e4a199e8bf18b719ee 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 8cbd1e6fc..98b55c554 100644 --- a/components/spi_flash/sim/Makefile.files +++ b/components/spi_flash/sim/Makefile.files @@ -17,6 +17,7 @@ INCLUDE_DIRS := \ app_update/include \ driver/include \ esp32/include \ + esp_timer/include \ freertos/include \ log/include \ newlib/include \ @@ -32,6 +33,7 @@ INCLUDE_DIRS := \ soc/include \ soc/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 6c5dc266e..8807a39bd 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 \ @@ -25,6 +27,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 000000000..954448b0d --- /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 000000000..657873cad --- /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; +}