Skip to content

Commit

Permalink
Support for Patmos Platform
Browse files Browse the repository at this point in the history
  • Loading branch information
EhsanKhodadad committed Aug 2, 2024
1 parent ec9b96a commit 7b4408f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions low_level_platform/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "nRF52")
target_compile_definitions(lf-low-level-platform-api INTERFACE PLATFORM_NRF52)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Zephyr")
target_compile_definitions(lf-low-level-platform-api INTERFACE PLATFORM_ZEPHYR)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Patmos")
target_compile_definitions(lf-low-level-platform-api INTERFACE PLATFORM_PATMOS)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Rp2040")
target_compile_definitions(lf-low-level-platform-api INTERFACE PLATFORM_RP2040)
target_link_libraries(lf-low-level-platform-api INTERFACE pico_stdlib)
Expand Down
4 changes: 3 additions & 1 deletion low_level_platform/impl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Patmos")
${CMAKE_CURRENT_LIST_DIR}/src/lf_atomic_irq.c
)
else()
message(FATAL_ERROR "Your platform is not supported! The C target supports FlexPRET, Linux, MacOS, nRF52, RP2040, Windows, and Zephyr.")
message(FATAL_ERROR "Your platform is not supported! The C target supports FlexPRET, Patmos, Linux, MacOS, nRF52, RP2040, Windows, and Zephyr.")
endif()

list(APPEND LF_LOW_LEVEL_PLATFORM_FILES ${CMAKE_CURRENT_LIST_DIR}/src/lf_platform_util.c)
Expand Down Expand Up @@ -99,6 +99,8 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FlexPRET")
)
endif()
endif()
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Patmos")
add_library(lf-low-level-platform-impl STATIC ${LF_LOW_LEVEL_PLATFORM_FILES})
else()
add_library(lf-low-level-platform-impl STATIC ${LF_LOW_LEVEL_PLATFORM_FILES})

Expand Down
4 changes: 4 additions & 0 deletions low_level_platform/impl/src/lf_patmos_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ int lf_enable_interrupts_nested() {
return 0;
}

int _lf_single_threaded_notify_of_event() {
_lf_async_event = true;
return 0;
}
#endif // LF_SINGLE_THREADED

#endif // PLATFORM_PATMOS
3 changes: 3 additions & 0 deletions platform/impl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FlexPRET")
add_library(lf-platform-impl STATIC)
target_sources(lf-platform-impl PUBLIC ${LF_PLATFORM_FILES})
target_link_libraries(lf-platform-impl PRIVATE fp-sdk)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Patmos")
add_library(lf-platform-impl STATIC)
target_sources(lf-platform-impl PUBLIC ${LF_PLATFORM_FILES})
else()
add_library(lf-platform-impl STATIC)
target_sources(lf-platform-impl PUBLIC ${LF_PLATFORM_FILES})
Expand Down

0 comments on commit 7b4408f

Please sign in to comment.