This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "esp_log.h" | |
#include "driver/i2c.h" | |
#include "sdkconfig.h" | |
static const char *TAG = "sht31 example"; | |
static i2c_port_t i2c_port = I2C_NUM_0; | |
#define I2C_MASTER_TX_BUF_DISABLE 0 | |
#define I2C_MASTER_RX_BUF_DISABLE 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.1) | |
add_subdirectory(src) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.1) | |
project(samples) | |
add_executable(main main.c) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.1) | |
project(samples) | |
add_executable(main main.c) | |
install(TARGETS main | |
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/ | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.1) | |
project(func) | |
add_library(func func.c) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.1) | |
project(samples) | |
add_subdirectory(func) | |
add_executable(main main.c) | |
# Install target | |
install(TARGETS main | |
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/ | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.1) | |
project(samples) | |
add_subdirectory(func) | |
add_executable(main main.c) | |
# Install target | |
install(TARGETS main | |
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/ | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Execute command | |
execute_process(COMMAND echo -e "\\033[0;33mHello command\\033[0m") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.1) | |
project(app) | |
file(GLOB APP_SOURCES "*.c") | |
foreach(sourcefile ${APP_SOURCES}) | |
string(REPLACE ".c" "" appname ${sourcefile}) | |
string(REPLACE "${PROJECT_SOURCE_DIR}/" "" appname ${appname}) | |
add_executable(${appname} ${sourcefile}) | |
endforeach(sourcefile ${APP_SOURCES}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.1) | |
project(func) | |
add_library(func func.c) | |
option(UNITTEST_ENABLE "Build the unittest code" OFF) | |
file(GLOB func_SRC "*.c") | |
file(GLOB unittest_SRC "*unittest*") |