Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into lfc-generate-num-events
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingrj committed Nov 28, 2024
2 parents cdcdc99 + 3eb9517 commit bfa8a74
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/flexpret/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ project(fp-lf)
include(src-gen/Smoke/CMakeLists.txt)
add_subdirectory(${REACTOR_UC_PATH})

add_executable(fp-smoke main.c ${LF_SOURCES_ABSOLUTE})
add_executable(fp-smoke main.c ${LF_SOURCES})
target_link_libraries(fp-smoke PUBLIC reactor-uc)
target_include_directories(fp-smoke PRIVATE ${LF_INCLUDE_DIRS})

Expand Down
2 changes: 1 addition & 1 deletion examples/zephyr/hello_lf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set(PLATFORM "ZEPHYR" CACHE STRING "Set platform to Zephyr")
include(src-gen/HelloLF/CMakeLists.txt)
add_subdirectory(${REACTOR_UC_PATH})

target_sources(app PRIVATE main.c ${LF_SOURCES_ABSOLUTE})
target_sources(app PRIVATE main.c ${LF_SOURCES})
target_link_libraries(app PRIVATE reactor-uc)
target_include_directories(app PRIVATE ${LF_INCLUDE_DIRS})
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import java.time.LocalDateTime
class UcCmakeGenerator(private val main: Reactor, private val targetConfig: TargetConfig, private val fileConfig: FileConfig) {
private val S = '$' // a little trick to escape the dollar sign with $S
private val platform = targetConfig.get(PlatformProperty.INSTANCE).platform
private val platformName = if (platform == PlatformType.Platform.AUTO) "POSIX" else platform.name.uppercase()

fun generateCmake(sources: List<Path>) =
if (platform == PlatformType.Platform.AUTO) {
Expand All @@ -31,12 +30,10 @@ class UcCmakeGenerator(private val main: Reactor, private val targetConfig: Targ

fun generateCmakeEmbedded(sources: List<Path>) = with(PrependOperator) {
"""
|# This is a generated CMakeLists file for ${fileConfig.name} at ${LocalDateTime.now()}
|# This file is generated by LFC. It is meant to be included in
|# an existing CMake project.
|
|set(LF_SOURCES_RELATIVE
${" | "..sources.joinWithLn { it.toUnixString() }}
|)
|set(LF_SOURCES_ABSOLUTE
|set(LF_SOURCES
${" | "..sources.joinWithLn { "$S{CMAKE_CURRENT_LIST_DIR}/${it.toUnixString()}"}}
|)
|set(REACTOR_UC_PATH $S{CMAKE_CURRENT_LIST_DIR}/reactor-uc)
Expand All @@ -51,7 +48,7 @@ class UcCmakeGenerator(private val main: Reactor, private val targetConfig: Targ
"""
|cmake_minimum_required(VERSION 3.5)
|project(${fileConfig.name} VERSION 0.0.0 LANGUAGES C)
|set(PLATFORM $platformName CACHE STRING "Target platform")
|set(PLATFORM POSIX CACHE STRING "Target platform")
|set(REACTION_QUEUE_SIZE ${main.getReactionQueueSize()} CACHE STRING "Size of the reaction queue")
|set(EVENT_QUEUE_SIZE ${main.getEventQueueSize()} CACHE STRING "Size of the event queue")
|
Expand All @@ -66,7 +63,8 @@ class UcCmakeGenerator(private val main: Reactor, private val targetConfig: Targ
|)
|
|add_subdirectory(reactor-uc)
|target_link_libraries($S{LF_MAIN_TARGET} PUBLIC reactor-uc)
|target_link_libraries($S{LF_MAIN_TARGET} PRIVATE reactor-uc)
|target_include_directories($S{LF_MAIN_TARGET} PRIVATE $S{CMAKE_CURRENT_LIST_DIR})
|
""".trimMargin()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class UcMakeGenerator(private val main: Reactor, private val targetConfig: Targe
private val S = '$' // a little trick to escape the dollar sign with $S
fun generateMake(sources: List<Path>) = with(PrependOperator) {
"""
| # Makefile genrated for ${fileConfig.name} at ${LocalDateTime.now()}
|LF_SOURCES_RELATIVE = \
| # Makefile genrated for ${fileConfig.name}
|LF_SOURCES = \
${" | "..sources.joinWithLn { it.toUnixString() + " \\ "}}
|REACTION_QUEUE_SIZE = ${main.getReactionQueueSize()}
|EVENT_QUEUE_SIZE = ${main.getEventQueueSize()}
Expand Down
2 changes: 1 addition & 1 deletion src/platform/flexpret/flexpret.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void Platform_ctor(Platform *self) {
self->leave_critical_section = PlatformFlexpret_leave_critical_section;
self->get_physical_time = PlatformFlexpret_get_physical_time;
self->wait_until = PlatformFlexpret_wait_until;
self->wait_until = PlatformFlexpret_wait_for;
self->wait_for = PlatformFlexpret_wait_for;
self->initialize = PlatformFlexpret_initialize;
self->wait_until_interruptible = PlatformFlexpret_wait_until_interruptible;
self->new_async_event = PlatformFlexpret_new_async_event;
Expand Down

0 comments on commit bfa8a74

Please sign in to comment.