Skip to content

Commit

Permalink
Anjay-esp-idf 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JZimnol committed Sep 7, 2023
0 parents commit 5448c8f
Show file tree
Hide file tree
Showing 13 changed files with 2,513 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
.vscode
__pycache__
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[submodule "deps/anjay"]
path = deps/anjay
url = https://github.com/AVSystem/Anjay.git
[submodule "deps/FreeRTOS-Cellular-Interface"]
path = deps/FreeRTOS-Cellular-Interface
url = https://github.com/AVSystem/FreeRTOS-Cellular-Interface.git
branch = esp32-client-v1.2.0
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## 0.0.1 (September 7th, 2023)

### Features
- Initialized repository with `Anjay` and `FreeRTOS-Cellular-Interface` submodules

59 changes: 59 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 2023 AVSystem <[email protected]>
#
# 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.

file(GLOB_RECURSE ANJAY_SOURCES
"deps/anjay/src/*.c"
"deps/anjay/deps/avs_coap/src/*.c"
"deps/anjay/deps/avs_commons/src/*.c")

idf_component_register(SRCS
${ANJAY_SOURCES}
INCLUDE_DIRS
"config"
"deps/anjay/include_public"
"deps/anjay/deps/avs_coap/include_public"
"deps/anjay/deps/avs_commons/include_public"
PRIV_INCLUDE_DIRS
"deps/anjay/src"
"deps/anjay/deps/avs_coap/src"
"deps/anjay/deps/avs_commons/src"
PRIV_REQUIRES
idf::mbedtls)

if (CONFIG_ANJAY_ESP_IDF_WITH_BG96_SUPPORT)
file(GLOB_RECURSE FREERTOS_CELLULAR_LIBRARY_SOURCES
"deps/FreeRTOS-Cellular-Interface/source/*.c"
"deps/FreeRTOS-Cellular-Interface/modules/bg96/*.c"
"deps/FreeRTOS-Cellular-Interface/modules/cellular_platform.c")
add_library(freertos_cellular_library MODULE ${FREERTOS_CELLULAR_LIBRARY_SOURCES})
target_include_directories(freertos_cellular_library PRIVATE
"deps/FreeRTOS-Cellular-Interface/source/include/private"
"deps/FreeRTOS-Cellular-Interface/modules/bg96")
target_include_directories(freertos_cellular_library PUBLIC
"deps/FreeRTOS-Cellular-Interface/source/include"
"deps/FreeRTOS-Cellular-Interface/source/include/common"
"deps/FreeRTOS-Cellular-Interface/source/logging"
"deps/FreeRTOS-Cellular-Interface/source/cellular_network_transport"
"deps/FreeRTOS-Cellular-Interface/source/interface"
"deps/FreeRTOS-Cellular-Interface/modules")
target_link_libraries(freertos_cellular_library PRIVATE ${COMPONENT_LIB})
endif()

# NOTE: avs_coap contains some assertions that check if allocated memory
# follows alignment requirements. malloc() on ESP-IDF aligns everything
# to 4 bytes, even though alignof(max_align_t) == alignof(int64_t)
# == alignof(long double) == 8. This is just GCC being overly cautious,
# the maximum hardware-imposed alignment on ESP32 is actually 4 bytes.
# We disable assertions within anjay to work around that.
target_compile_definitions(${COMPONENT_TARGET} PRIVATE "NDEBUG")
Loading

0 comments on commit 5448c8f

Please sign in to comment.