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

covarience thread #6

Open
wants to merge 1 commit into
base: multithreading
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion nand_teensy/src/sd_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ volatile char gps_buf [20000]; //Ashley
volatile char encoder_buf [20000]; //Gyan
volatile char filter_buf [20000];
volatile char covarience_buf [20000]; //Nnenna
volatile size_t covarience_size = 0;

Threads::Mutex steering_m;
Threads::Mutex gps_m;
Expand All @@ -31,7 +32,12 @@ void sd_thread() {
}

void multithread_covarience() {

char temp_buf[20000];
covarience_m.lock();
snprint(temp_buf, 20000, (const char *)covarience_buf);
covarience_size = 0;
covarience_m.unlock();
File.write(covarience_buf, sizeof(temp_buf), COVARIANCE_FILE);
}

void init() {
Expand Down