Skip to content

Commit

Permalink
Create basic mbed project
Browse files Browse the repository at this point in the history
  • Loading branch information
jrvollmer committed Sep 2, 2023
1 parent f2177b2 commit d480208
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.build
.mbed
BUILD
cmake_build
mbed-os
30 changes: 30 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "")
set(APP_TARGET embedded-mbed)

include(${MBED_PATH}/tools/cmake/app.cmake)

project(${APP_TARGET})

add_subdirectory(${MBED_PATH})

add_executable(${APP_TARGET} testRunner.cpp)

target_sources(${APP_TARGET}
PRIVATE
testRunner.cpp
)

target_link_libraries(${APP_TARGET}
PRIVATE
mbed-os
)

mbed_set_post_build(${APP_TARGET})

option(VERBOSE_BUILD "Have a verbose build process")
if(VERBOSE_BUILD)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
1 change: 1 addition & 0 deletions mbed-os.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/ARMmbed/mbed-os/#17dc3dc2e6e2817a8bd3df62f38583319f0e4fed
8 changes: 8 additions & 0 deletions mbed_app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"target_overrides": {
"*": {
"target.printf_lib": "std",
"target.c_lib": "small"
}
}
}
8 changes: 8 additions & 0 deletions testRunner.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "mbed.h"

int main()
{
printf("Hello World!\n");

while(1) {}
}

0 comments on commit d480208

Please sign in to comment.