Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
dbf404b
Suspension Potentiometer calculation
ManushPatell Oct 19, 2025
02cc1ec
Add windows symlink fix (#528)
BlakeFreer Oct 20, 2025
0ceac54
cantools scripts (#530)
BlakeFreer Oct 25, 2025
20e74f4
Convert TMS to use FreeRTOS (#527)
luaibash Oct 28, 2025
8e43c27
increase speed limit to 75 kmh (#537)
BlakeFreer Nov 2, 2025
7429014
Implement static code analysis on projects (#534)
SpeakBoy Nov 2, 2025
0fe931c
fc suspension (#536)
ManushPatell Nov 8, 2025
7bb0b75
Improve static code analysis time for PRs (#542)
SpeakBoy Nov 9, 2025
13b7a4b
Transmit Git Hash over CAN (#540)
luaibash Nov 20, 2025
29ffb03
cobs library (#547)
BlakeFreer Dec 5, 2025
d996284
rename cobs library (#548)
BlakeFreer Dec 5, 2025
0181eaa
Disable pre-commit static analysis (#549)
BlakeFreer Dec 5, 2025
e3c453c
Remove samparent97 from CODEOWNERS (#554)
samparent97 Jan 10, 2026
5058c52
Remove the CODEOWNERs file (#556)
BlakeFreer Jan 14, 2026
7dbaefc
Sockets for C++ SIL (#551)
noahjaye Jan 22, 2026
0519bf1
Configurable pedal-to-torque mapping (#560)
HarshPatel08 Mar 25, 2026
b137fef
Fix the dashboard (#561)
noahjaye Apr 9, 2026
838e5c2
daq: basic boilerplate setup
TylerStAmour Oct 14, 2025
f541de0
daq: send/enqueue template
TylerStAmour Oct 14, 2025
11081ba
basic caching mechanism for can frames
TylerStAmour Oct 28, 2025
86a5282
daq: interval between repeated frames + handle both CAN busses
TylerStAmour Nov 2, 2025
2a6c00e
feat: completed heartbeat constructor
nicholasching Nov 30, 2025
ce6e10c
feat: completed heartbeat implementation
nicholasching Nov 30, 2025
dc4b238
fix: heartbeat types
nicholasching Nov 30, 2025
96b968a
feat: integrated heartbeat into daq main
nicholasching Nov 30, 2025
eccf64f
feat: rpi logger
nicholasching Mar 17, 2026
e12d4b8
influx-db
ManushPatell May 2, 2026
a36f8fd
test logger & influx db
ManushPatell May 1, 2026
f2f5179
grafana dashboard json file
ManushPatell May 9, 2026
f71104e
include pt.dbc for powertrain can parsing
ManushPatell May 10, 2026
64caf00
testing logger in linux-vm
ManushPatell May 10, 2026
4c58bbc
logger.py issues, need to fix on vm
ManushPatell May 10, 2026
d705756
.
ManushPatell May 10, 2026
666581b
README.md, sh files, .deb file is too large :(
ManushPatell May 10, 2026
72a7df3
clang format ignore file
ManushPatell May 10, 2026
9dddc41
remove clang format file
ManushPatell May 10, 2026
04cc5f4
clang format is annoying me
ManushPatell May 10, 2026
cdacf0f
revert to old config
ManushPatell May 10, 2026
e7a81f7
update erm
ManushPatell May 10, 2026
74efa1b
pls pls pls fix
ManushPatell May 10, 2026
64ad4f9
wow i hate this
ManushPatell May 10, 2026
85df617
update README.md
ManushPatell May 10, 2026
f81eeac
exclude stm32 from format checks
noahjaye May 10, 2026
3b13d6b
Examine bindings failure
noahjaye May 10, 2026
124ec35
.sh file for influxdb cloud, minimal setup
ManushPatell May 12, 2026
67a28f1
Merge branch 'daq-nick-heartbeat' of https://github.com/macformula/ra…
ManushPatell May 12, 2026
96361d1
add APPS and BPPS
ManushPatell May 18, 2026
b0c7614
Update LV FW (#567)
ManushPatell May 29, 2026
513e175
add thresholds and new fields
ManushPatell May 29, 2026
217e8be
lv controller updates, add mapping (#573)
ManushPatell Jun 3, 2026
84f8336
FC Rev4 changes (#569)
noahjaye Jun 6, 2026
8ea1bbb
bypass logo screen (#574)
ManushPatell Jun 7, 2026
4178d09
Merge branch 'main' into daq-nick-heartbeat
ManushPatell Jun 13, 2026
782520e
dont need dashboard changes, restore them
ManushPatell Jun 13, 2026
512dd70
Merge branch 'daq-nick-heartbeat' of https://github.com/macformula/ra…
ManushPatell Jun 13, 2026
938687e
another unneccesary change to dash
ManushPatell Jun 13, 2026
651ec1b
tuning apps & bpps (#577)
ManushPatell Jun 13, 2026
02329d6
make influx optional
ManushPatell Jun 14, 2026
76e03ec
Merge branch 'main' into daq-nick-heartbeat
ManushPatell Jun 14, 2026
75f8271
remove message
ManushPatell Jun 14, 2026
1f046ef
Merge branch 'daq-nick-heartbeat' of https://github.com/macformula/ra…
ManushPatell Jun 14, 2026
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
2 changes: 0 additions & 2 deletions .github/CODEOWNERS

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/build-test-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -48,3 +50,24 @@ jobs:
echo "============================================================"
pio run --project-dir "$dir" -vvv || exit 1
done

- name: Perform Static Code Analysis on PlatformIO Projects
shell: bash
run: |
git ls-files -z 'projects/**/platformio.ini' | grep -zv 'projects/demo/' | while IFS= read -r -d '' ini; do
dir=$(dirname "$ini")
echo "============================================================"
echo "==== Performing Static Code Analysis on $dir"
echo "============================================================"

SUBDIRS=("$dir/src" "$dir/include")
EXCLUDE_PREFIX="stm*"

# Check for changes in $dir/src and $dir/include, excluding files within $dir/src/platforms/stm*
if git diff --name-only origin/main...HEAD -- "${SUBDIRS[@]}" ":!$dir/src/platforms/$EXCLUDE_PREFIX" | grep -q .; then
echo "Changes detected in $dir → running pio check"
pio check --project-dir "$dir" --flags "--checks=bugprone-*,clang-analyzer-*,google-*,performance-*" --fail-on-defect=high || exit 1
else
echo "No changes in $dir → skipping"
fi
done
1 change: 1 addition & 0 deletions .github/workflows/pr-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ jobs:
uses: jidicula/clang-format-action@v4.15.0
with:
check-path: '.'
exclude-regex: '.*/platforms/stm32/Core/.*'
clang-format-version: '20'
18 changes: 0 additions & 18 deletions .gitmodules

This file was deleted.

7 changes: 6 additions & 1 deletion docs/docs/firmware/dev-setup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ CubeMX is a program which generates configuration code for our microcontrollers.

2. Install Git from <https://git-scm.com/downloads>.

3. (Windows only) Enable symbolic links.

1. Enable "Developer Mode" <https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development>
2. Run `git config --global core.symlinks true`

??? warning "Git Bash (for Windows only)"

Git Bash is an alternative terminal shell which is installed alongside `git`. This shell emulates the Linux bash shell, allowing you to use commands like `grep`, `ls`, `rm` and many more on Windows.
Expand Down Expand Up @@ -102,4 +107,4 @@ These extensions are not required but will improve your development experience.

---

You should now check out [Using VS Code and Platformio](../using-vscode-pio/index.md).
You should now check out [Using VS Code and Platformio](../using-vscode-pio/index.md).
5 changes: 5 additions & 0 deletions lib/cobs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
69 changes: 69 additions & 0 deletions lib/cobs/cobs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#include "cobs.hpp"

#include <cstdint>
#include <cstdlib>

namespace macfe::cobs {

Decoder::Decoder(uint8_t* buffer)
: buffer(buffer), length(0), block_remaining_(0), code_(0xff) {}

bool Decoder::Decode(const uint8_t* encoded, size_t encoded_length) {
// adapted from
// https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing
// differences: supports procedural decoding / does not require `encoded` to
// contain the entire message

const uint8_t* input_cursor = encoded;

for (; input_cursor < encoded + encoded_length; --block_remaining_) {
if (block_remaining_ > 0) {
buffer[length++] = *input_cursor++;
} else {
block_remaining_ = *input_cursor++;
if (block_remaining_ == 0) {
return true;
}
if (code_ != 0xff) {
buffer[length++] = 0;
}
code_ = block_remaining_;
}
}
return false;
}

constexpr size_t MaxEncodedLength(size_t raw_length) {
constexpr size_t LEADING_ZERO = 1;
constexpr size_t TERMINATING_ZERO = 1;
size_t MAX_STUFF_BYTES = (raw_length + 253) / 254;
return LEADING_ZERO + raw_length + MAX_STUFF_BYTES + TERMINATING_ZERO;
}

size_t Encode(const uint8_t* raw, size_t length, uint8_t* output) {
uint8_t* encode_cursor = output;

uint8_t zero_offset = 1;
uint8_t* zero_offset_p = encode_cursor++;

for (const uint8_t* byte = raw; length--; ++byte) {
if (*byte != 0) {
*encode_cursor++ = *byte;
++zero_offset;
}
if ((*byte == 0) || (zero_offset == 0xff)) {
*zero_offset_p = zero_offset;
zero_offset = 1;
zero_offset_p = encode_cursor;
if ((*byte == 0) || (length > 0)) {
++encode_cursor;
}
}
}
*zero_offset_p = zero_offset; // write the final zero_offset value
*encode_cursor++ = 0; // write delimiter

return size_t(encode_cursor - output);
}

} // namespace macfe::cobs
25 changes: 25 additions & 0 deletions lib/cobs/cobs.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

#include <stdint.h>
#include <stdlib.h>

namespace macfe::cobs {

class Decoder {
public:
Decoder(uint8_t* buffer);
bool Decode(const uint8_t* encoded, size_t encoded_length);

uint8_t* buffer;
size_t length;

private:
uint8_t block_remaining_;
uint8_t code_;
};

constexpr size_t MaxEncodedLength(size_t raw_length);

size_t Encode(const uint8_t* raw, size_t length, uint8_t* output);

} // namespace macfe::cobs
9 changes: 9 additions & 0 deletions lib/cobs/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[platformio]
include_dir = .
src_dir = .

[env:native]
test_framework = googletest
platform = native
test_build_src = true
build_src_filter = +<cobs.cpp>
157 changes: 157 additions & 0 deletions lib/cobs/test/cobs_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
#include "cobs.hpp"

#include "gtest/gtest.h"

using namespace macfe::cobs;

void EXPECT_ARRAY_EQUAL(uint8_t* expected, size_t expected_len, uint8_t* actual,
size_t actual_len) {
ASSERT_EQ(expected_len, actual_len);
for (size_t i = 0; i < expected_len; i++) {
EXPECT_EQ(expected[i], actual[i]) << "Differ at index " << i;
}
}

TEST(COBS, ZeroString) {
uint8_t decoded[] = {0x00};
size_t dec_length = sizeof(decoded) / sizeof(decoded[0]);

uint8_t encoded[] = {0x01, 0x01, 0x00};
size_t enc_length = sizeof(encoded) / sizeof(encoded[0]);

uint8_t enc_output[256];
size_t enc_length_actual = Encode(decoded, dec_length, enc_output);
EXPECT_ARRAY_EQUAL(encoded, enc_length, enc_output, enc_length_actual);

uint8_t dec_output[256];
Decoder decoder(dec_output);
EXPECT_TRUE(decoder.Decode(encoded, enc_length));
EXPECT_ARRAY_EQUAL(decoded, dec_length, decoder.buffer, decoder.length);
}

TEST(COBS, EmptyString) {
uint8_t decoded[] = {};
size_t dec_length = sizeof(decoded) / sizeof(decoded[0]);

uint8_t encoded[] = {0x01, 0x00};
size_t enc_length = sizeof(encoded) / sizeof(encoded[0]);

uint8_t enc_output[256];
size_t enc_length_actual = Encode(decoded, dec_length, enc_output);
EXPECT_ARRAY_EQUAL(encoded, enc_length, enc_output, enc_length_actual);

uint8_t dec_output[256];
Decoder decoder(dec_output);
EXPECT_TRUE(decoder.Decode(encoded, enc_length));
EXPECT_ARRAY_EQUAL(decoded, dec_length, decoder.buffer, decoder.length);
}

TEST(COBS, Short) {
uint8_t decoded[] = {0x11, 0x22, 0x00, 0x33};
size_t dec_length = sizeof(decoded) / sizeof(decoded[0]);

uint8_t encoded[] = {0x03, 0x11, 0x22, 0x02, 0x33, 0x00};
size_t enc_length = sizeof(encoded) / sizeof(encoded[0]);

uint8_t enc_output[256];
size_t enc_length_actual = Encode(decoded, dec_length, enc_output);
EXPECT_ARRAY_EQUAL(encoded, enc_length, enc_output, enc_length_actual);

uint8_t dec_output[256];
Decoder decoder(dec_output);
EXPECT_TRUE(decoder.Decode(encoded, enc_length));
EXPECT_ARRAY_EQUAL(decoded, dec_length, decoder.buffer, decoder.length);
}

TEST(COBS, ManyZeros) {
uint8_t decoded[] = {0x11, 0x00, 0x00, 0x00};
size_t dec_length = sizeof(decoded) / sizeof(decoded[0]);

uint8_t encoded[] = {0x02, 0x11, 0x01, 0x01, 0x01, 0x00};
size_t enc_length = sizeof(encoded) / sizeof(encoded[0]);

uint8_t enc_output[256];
size_t enc_length_actual = Encode(decoded, dec_length, enc_output);
EXPECT_ARRAY_EQUAL(encoded, enc_length, enc_output, enc_length_actual);

uint8_t dec_output[256];
Decoder decoder(dec_output);
EXPECT_TRUE(decoder.Decode(encoded, enc_length));
EXPECT_ARRAY_EQUAL(decoded, dec_length, decoder.buffer, decoder.length);
}

TEST(COBS, FFBlock) {
uint8_t decoded[] = {
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24,
0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c,
0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54,
0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c,
0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84,
0x85, 0x86, 0x87, 0x88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, 0xee, 0xef,
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb,
0xfc, 0xfd, 0xfe, 0x02, 0xff, 0x00};
size_t enc_length = sizeof(encoded) / sizeof(encoded[0]);

uint8_t enc_output[512];
size_t enc_length_actual = Encode(decoded, dec_length, enc_output);
EXPECT_ARRAY_EQUAL(encoded, enc_length, enc_output, enc_length_actual);

uint8_t dec_output[512] = {0};
Decoder decoder(dec_output);
EXPECT_TRUE(decoder.Decode(encoded, enc_length));
EXPECT_ARRAY_EQUAL(decoded, dec_length, decoder.buffer, decoder.length);

// Test partial decoding
uint8_t dec_output2[512] = {0};
decoder = Decoder(dec_output2);
size_t i;
for (i = 0; i < enc_length - 50; i += 10) {
EXPECT_FALSE(decoder.Decode(encoded + i, 10));
}
EXPECT_TRUE(decoder.Decode(encoded + i, enc_length - i));
EXPECT_ARRAY_EQUAL(decoded, dec_length, decoder.buffer, decoder.length);
}

int main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
1 change: 0 additions & 1 deletion lib/mcal/sil/README

This file was deleted.

Loading
Loading