Skip to content

Commit

Permalink
pulling remote
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoOhR committed Jun 6, 2024
2 parents 4837825 + e35aa1a commit 0a6d371
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Project/DAQ_System/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-16760729310753763" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1120929799166246936" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand All @@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-16760729310753763" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1120929799166246936" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
29 changes: 27 additions & 2 deletions Project/DAQ_System/Program/Src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ extern uint8_t usb_connected_observer; // USB connected/ejected interrupt
#include "../DFR_Libraries/Application/DataLogger/DataLogger.hpp"
#include "../DFR_Libraries/Application/FileSystem/fat_fs.hpp"
#include "../DFR_Libraries/Application/Mutex/mutex_cmsisv2.hpp"
#include "../DFR_Libraries/Application/Relay/Can_Relay.hpp"
#include "../DFR_Libraries/Platform/STM/F4/CAN/bxcan_stmf4.hpp"
#include "../DFR_Libraries/Platform/Interfaces/ican.hpp"
#include "../DFR_Libraries/Platform/Interfaces/igpio.hpp"
Expand All @@ -74,6 +75,7 @@ extern uint8_t usb_connected_observer; // USB connected/ejected interrupt
void RtosInit();
void DataLoggingThread(void *argument);
void TimestampThread(void *argument);
void RelayThread(void *argument);


/**************************************************************
Expand Down Expand Up @@ -158,6 +160,10 @@ application::CircularQueue<application::DataPayload> queue(size, queue_mutex);

application::DataPayload data_payload(data_mutex);

auto bx_can_peripheral = std::make_shared<platform::BxCanStmF4>(hcan1);
std::shared_ptr<platform::ICan> can_bus = bx_can_peripheral;


bool is_logging_flag = false;


Expand Down Expand Up @@ -188,6 +194,12 @@ const osThreadAttr_t ecuTask_attributes = {
.priority = (osPriority_t) osPriorityNormal,
};

osThreadId_t canRelayHandle;
const osThreadAttr_t canRelayTask_attributes = {
.name = "relayTask",
.stack_size = 128 * 8, //no idea what im doing
.priority = (osPriority_t) osPriorityNormal,
};

/**************************************************************
* RTOS Threads
Expand All @@ -208,6 +220,7 @@ void DataLoggingThread(void *argument) {
}
}


void TimestampThread(void *argument) {
int count = 0;
static constexpr float kTimeDuration = 2.0f; // seconds
Expand Down Expand Up @@ -237,9 +250,21 @@ void TimestampThread(void *argument) {
}
}

void RelayThread(void *argument){
queue.Lock();
auto relay = application::Can_Relay(can_bus, queue);
queue.Unlock();
for(;;){
if(is_logging_flag){ // coupled somewhat strongly with logger function, change after testing
data_payload.Lock();
relay.Generate_Messages(data_payload);
relay.Send_Messages();
data_payload.Unlock();
}
}
}

void EcuThread(void *argument) {
auto bx_can_peripheral = std::make_shared<platform::BxCanStmF4>(hcan1);
std::shared_ptr<platform::ICan> can_bus = bx_can_peripheral;

sensor::Pe3 pe3_ecu(can_bus);
const std::vector<uint32_t>& can_id_list = pe3_ecu.CanIdList();
Expand Down

0 comments on commit 0a6d371

Please sign in to comment.