diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 6b8c74e518d77f5c632aee70a51ee4070a179da5..dbb48611d55c3908d7f0fbeb5d9ebcf07912aed4 100755 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -410,6 +410,29 @@ "cStandard": "c17", "intelliSenseMode": "linux-gcc-x64", "cppStandard": "c++20" + }, + { + "name": "stm32f429zi_skyward_groundstation_v2", + "cStandard": "c11", + "cppStandard": "c++14", + "compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++", + "defines": [ + "{defaultDefines}", + "_MIOSIX_BOARDNAME=stm32f429zi_skyward_groundstation_v2", + "_BOARD_STM32F429ZI_SKYWARD_GS_V2", + "_ARCH_CORTEXM4_STM32F4", + "STM32F429xx", + "HSE_VALUE=8000000", + "SYSCLK_FREQ_168MHz=168000000", + "__ENABLE_XRAM", + "V_DDA_VOLTAGE=3.0f" + ], + "includePath": [ + "${defaultIncludePaths}", + "${workspaceFolder}/skyward-boardcore/libs/miosix-kernel/miosix/arch/cortexM4_stm32f4/common", + "${workspaceFolder}/skyward-boardcore/libs/miosix-kernel/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_v2", + "${workspaceFolder}/skyward-boardcore/libs/miosix-kernel/miosix/config/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_v2" + ] } ], "version": 4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 15113e630fb8bae96a18bf3896489d5989593da8..993c16b6b44c9e5dd9f4e2a2b1110dc9850e000d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,4 +96,11 @@ add_executable(base-groundstation-entry ${GROUNDSTATION_COMMON} ${GROUNDSTATION_BASE} ) target_include_directories(base-groundstation-entry PRIVATE ${OBSW_INCLUDE_DIRS}) -sbs_target(base-groundstation-entry stm32f767zi_gemini_gs) \ No newline at end of file +sbs_target(base-groundstation-entry stm32f767zi_gemini_gs) + +add_executable(nokia-groundstation-entry + src/entrypoints/Groundstation/nokia-groundstation-entry.cpp + ${GROUNDSTATION_COMMON} ${GROUNDSTATION_NOKIA} +) +target_include_directories(nokia-groundstation-entry PRIVATE ${OBSW_INCLUDE_DIRS}) +sbs_target(nokia-groundstation-entry stm32f429zi_skyward_groundstation_v2) \ No newline at end of file diff --git a/src/boards/Groundstation/Nokia/Hub.cpp b/src/boards/Groundstation/Nokia/Hub.cpp index ab06368e13450c6af99606ff8291560584f188f1..0a89a8bba5547ea53b703ad5a68bfcb6801c5604 100644 --- a/src/boards/Groundstation/Nokia/Hub.cpp +++ b/src/boards/Groundstation/Nokia/Hub.cpp @@ -34,8 +34,7 @@ void Hub::dispatchOutgoingMsg(const mavlink_message_t& msg) { Radio* radio = ModuleManager::getInstance().get<Radio>(); - if (!radio->sendMsg(msg)) - { + if(!radio->sendMsg(msg)) { sendNack(msg); } } diff --git a/src/boards/Groundstation/Nokia/Radio/Radio.cpp b/src/boards/Groundstation/Nokia/Radio/Radio.cpp index 2e27dfac357304bfcc07248e2bc505819a19b03c..8a3911b82039ae4a2114ed7b787b18cdfdb5f0c8 100644 --- a/src/boards/Groundstation/Nokia/Radio/Radio.cpp +++ b/src/boards/Groundstation/Nokia/Radio/Radio.cpp @@ -58,7 +58,7 @@ bool Radio::start() #error "Backup RF not supported on nokia" #else std::unique_ptr<SX1278::ISX1278Frontend> frontend = - std::make_unique<RA01Frontend>(); + std::make_unique<Skyward433Frontend>(); #endif std::unique_ptr<Boardcore::SX1278Fsk> sx1278 = diff --git a/src/entrypoints/Groundstation/base-groundstation-entry.cpp b/src/entrypoints/Groundstation/base-groundstation-entry.cpp index 8afa9771f86c3de2373eb5effb361664e5946c8e..dc56725a930777a06ef43aa3d16f99a1ec124bb3 100644 --- a/src/entrypoints/Groundstation/base-groundstation-entry.cpp +++ b/src/entrypoints/Groundstation/base-groundstation-entry.cpp @@ -32,11 +32,11 @@ using namespace Groundstation; using namespace Boardcore; using namespace miosix; -void spinLoop() +void idleLoop() { while (1) { - Thread::sleep(1000); + Thread::wait(); } } @@ -130,6 +130,6 @@ int main() } led1On(); - spinLoop(); + idleLoop(); return 0; } \ No newline at end of file diff --git a/src/entrypoints/Groundstation/nokia-groundstation-entry.cpp b/src/entrypoints/Groundstation/nokia-groundstation-entry.cpp index da685704b93e00882cb953e9e0a398d95714abd6..c33676910ce655412ef1803deb4020c4a9c5e1b7 100644 --- a/src/entrypoints/Groundstation/nokia-groundstation-entry.cpp +++ b/src/entrypoints/Groundstation/nokia-groundstation-entry.cpp @@ -78,8 +78,7 @@ int main() printf("[error] Failed to start radio!\n"); } - if (ok) - { + if(ok) { printf("Init complete!\n"); }