Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating init and stop funtion #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

144 changes: 144 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 94 additions & 0 deletions MSB/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions MSB/msb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
#include "api/msb_can.h"
#include "cmsis_os.h"

//Thread ID identifies the thread.
osThreadId_t canTaskHandle;

void init_msb() {
// spawn CAN output thread
start_can_publisher();
// Create a thread to run start_can_publisher
canTaskHandle = osThreadNew(start_can_publisher, NULL, NULL);
if (canTaskHandle == NULL) {
// Handle error, need implementation in the future
}
}

// test
void start_msb() {

init_msb();
Expand All @@ -21,5 +26,9 @@ void start_msb() {
}

void stop_msb() {

if (canTaskHandle != NULL) {
osThreadTerminate(canTaskHandle);
//put Null for now, implementation in the future
canTaskHandle = NULL;
}
}
Loading