瀏覽代碼

Integrated linux log into fatfs and spiffs host tests

Jakob Hasse 4 年之前
父節點
當前提交
ef2dba3921

+ 1 - 1
components/fatfs/test_fatfs_host/Makefile.files

@@ -17,7 +17,6 @@ INCLUDE_DIRS := \
 		app_update/include \
 		driver/include \
 		freertos/include \
-		log/include \
 		newlib/include \
 		sdmmc/include \
 		vfs/include \
@@ -27,6 +26,7 @@ INCLUDE_DIRS := \
 		esp_hw_support/include \
 		esp_hw_support/include/soc \
 		esp_system/include \
+		log/include \
 		xtensa/include \
 		xtensa/esp32/include \
 		soc/esp32/include \

+ 5 - 0
components/fatfs/test_fatfs_host/sdkconfig/sdkconfig.h

@@ -1,7 +1,12 @@
 # pragma once
 #define CONFIG_IDF_TARGET_ESP32 1
 #define CONFIG_WL_SECTOR_SIZE   4096
+
+// for the Linux log component
+#define CONFIG_LOG_TIMESTAMP_SOURCE_RTOS 1
 #define CONFIG_LOG_DEFAULT_LEVEL 3
+#define CONFIG_LOG_MAXIMUM_LEVEL 3
+
 #define CONFIG_PARTITION_TABLE_OFFSET 0x8000
 #define CONFIG_ESPTOOLPY_FLASHSIZE "8MB"
 //currently use the legacy implementation, since the stubs for new HAL are not done yet

+ 1 - 0
components/spiffs/include/spiffs_config.h

@@ -19,6 +19,7 @@
 #include <unistd.h>
 #include <sdkconfig.h>
 #include <esp_log.h>
+#include <assert.h>
 
 // compile time switches
 #define SPIFFS_TAG "SPIFFS"

+ 1 - 1
components/spiffs/test_spiffs_host/Makefile.files

@@ -17,7 +17,6 @@ INCLUDE_DIRS := \
 	app_update/include \
 	driver/include \
 	freertos/include \
-	log/include \
 	newlib/include \
 	sdmmc/include \
 	vfs/include \
@@ -28,6 +27,7 @@ INCLUDE_DIRS := \
 	esp_hw_support/include \
 	esp_hw_support/include/soc \
 	esp_system/include \
+	log/include \
 	xtensa/include \
 	xtensa/esp32/include \
 	soc/esp32/include \

+ 8 - 0
components/spiffs/test_spiffs_host/sdkconfig/sdkconfig.h

@@ -13,9 +13,17 @@
 #define CONFIG_SPIFFS_USE_MTIME 1
 
 #define CONFIG_WL_SECTOR_SIZE 4096
+
+// for log component with linux target
 #define CONFIG_LOG_DEFAULT_LEVEL 3
+#define CONFIG_LOG_MAXIMUM_LEVEL 3
+#define CONFIG_LOG_TIMESTAMP_SOURCE_RTOS 1
+
 #define CONFIG_PARTITION_TABLE_OFFSET 0x8000
 
 #define CONFIG_ESPTOOLPY_FLASHSIZE "8MB"
 //currently use the legacy implementation, since the stubs for new HAL are not done yet
 #define CONFIG_SPI_FLASH_USE_LEGACY_IMPL 1
+
+#undef _Static_assert
+#define _Static_assert(cond, message)