add McuLib to ESP32 project

main
Simon Frei 4 years ago
parent 6c6a841daf
commit 0d48829c88
  1. 7
      ADIS_ESP32_Eclipse/.project
  2. 6
      ADIS_ESP32_Eclipse/CMakeLists.txt
  3. 42
      ADIS_ESP32_Eclipse/config/IncludeMcuLibConfig.h
  4. 23
      McuLib/CMakeLists.txt

@ -24,4 +24,11 @@
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures> </natures>
<linkedResources>
<link>
<name>McuLib</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/McuLib</locationURI>
</link>
</linkedResources>
</projectDescription> </projectDescription>

@ -2,5 +2,11 @@
# CMakeLists in this exact order for cmake to work correctly # CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
# add my own component direcotry to the list
list(APPEND EXTRA_COMPONENT_DIRS "./McuLib")
include($ENV{IDF_PATH}/tools/cmake/project.cmake) include($ENV{IDF_PATH}/tools/cmake/project.cmake)
# additional include for IncludeMcuLibConfig
add_compile_options(-I ./config)
add_compile_options(-include "./config/IncludeMcuLibConfig.h")
project(esp32-adis) project(esp32-adis)

@ -0,0 +1,42 @@
/*
* ESP32 IncludeMcuLibConfig
*
* Author: Erich Styger
* License: PDX-License-Identifier: BSD-3-Clause
*/
#ifndef MCULIB_CONFIG_CONFIG_H_
#define MCULIB_CONFIG_CONFIG_H_
/* -------------- Core and McuLib general settings -------------------------- */
#define McuLib_CONFIG_CPU_IS_ARM_CORTEX_M (0) /* ESP32 is detected automatically */
/* -------------- FreeRTOS and McuRTOS settings -------------------------- */
#define configHEAP_SCHEME_IDENTIFICATION (0) /* ESP-IDF RTOS used */
/* -------------- McuShell settings -------------------------- */
#define McuShell_CONFIG_PROJECT_NAME_STRING "ESP32 Shell"
#define McuShell_CONFIG_ECHO_ENABLED (1)
#define McuShell_CONFIG_PROMPT_STRING "ESP32> "
#define McuShell_CONFIG_MULTI_CMD_ENABLED (1)
#define McuShell_CONFIG_MULTI_CMD_SIZE (96)
/* -------------- McuCriticalSections settings -------------------------- */
#define McuCriticalSection_CONFIG_USE_RTOS_CRITICAL_SECTION (1)
/* -------------- McuTimeDate settings -------------------------- */
#define McuTimeDate_CONFIG_TICK_TIME_MS (10)
/* -------------------------------------------------*/
/* McuLog */
#define McuLog_CONFIG_IS_ENABLED (1)
#define McuLog_CONFIG_DEFAULT_LEVEL (McuLog_DEBUG)
#define McuLog_CONFIG_USE_COLOR (1)
#define McuLog_CONFIG_NOF_CONSOLE_LOGGER (1)
#define McuLog_CONFIG_LOG_TIMESTAMP_DATE (1)
#define McuLog_CONFIG_USE_RTT_DATA_LOGGER (0)
#define McuLog_CONFIG_RTT_DATA_LOGGER_BUFFER_SIZE (128)
/* -------------------------------------------------*/
/* McuUART485 */
#define McuUart485_CONFIG_USE_RS_485 (1)
#endif /* MCULIB_CONFIG_CONFIG_H_ */

@ -0,0 +1,23 @@
idf_component_register(
SRCS
"src/McuLib.c"
"src/McuWait.c"
"src/McuArmTools.c"
"src/McuRTOS.c"
"src/McuUtility.c"
"src/McuShell.c"
"src/McuXFormat.c"
"src/McuCriticalSection.c"
"src/McuLog.c"
"src/McuGPIO.c"
"src/McuLED.c"
"src/McuTimeDate.c"
"src/McuButton.c"
"src/McuTrigger.c"
"src/McuTimeout.c"
"src/McuRB.c"
"src/McuUart485.c"
INCLUDE_DIRS
"./config"
"./src"
)
Loading…
Cancel
Save