Explorar o código

spi_flash: Add into sim/stubs the esp_timer

KonstantinKondrashov %!s(int64=5) %!d(string=hai) anos
pai
achega
79831e64fd

+ 2 - 0
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 \

+ 3 - 0
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 \

+ 15 - 0
components/spi_flash/sim/stubs/esp_timer/include/esp_timer.h

@@ -0,0 +1,15 @@
+#pragma once
+
+#include <stdint.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int64_t esp_timer_get_time(void);
+
+#ifdef __cplusplus
+}
+#endif
+

+ 20 - 0
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;
+}