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

Fix submodule? #90

Merged
merged 2 commits into from
Dec 23, 2024
Merged
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "Embedded-Base"]
path = Embedded-Base
url = https://github.com/Northeastern-Electric-Racing/Embedded-Base.git
url = https://github.com/Northeastern-Electric-Racing/Embedded-Base.git
branch = main
2 changes: 1 addition & 1 deletion Embedded-Base
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn main() {
Ok(()) => {}
Err(errors) => {
for error in errors {
// The \x1b[...m is an ANSI escape sequence for colored terminal output
// The \x1b[...m is an ANSI escape sequence for colored terminal output
println!("\x1b[31;1mCAN spec error:\x1b[0m {}", error);
}
process::exit(1);
Expand Down
15 changes: 9 additions & 6 deletions libs/calypso-cangen/src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ fn validate_msg(_msg: CANMsg) -> Result<(), Vec<CANSpecError>> {
// Check Sim enum frequencies add to 1 (roughly, f32s are approximate)
if let Some(Sim::SimEnum { options }) = _field.sim {
let mut _sim_total: f32 = 0.0;
options.iter().for_each(|opt| { _sim_total += opt[1]; });
options.iter().for_each(|opt| {
_sim_total += opt[1];
});
if (_sim_total - 1.0).abs() > 0.00001 {
_errors.push(CANSpecError::FieldSimEnumFrequencySum(
_name.clone(),
Expand All @@ -142,10 +144,7 @@ fn validate_msg(_msg: CANMsg) -> Result<(), Vec<CANSpecError>> {
}
}

let _send = match _field.send {
Some(false) => false,
_ => true
};
let _send = !matches!(_field.send, Some(false));

for (_i, _point) in _field.points.iter().enumerate() {
_bit_count += _point.size;
Expand Down Expand Up @@ -181,7 +180,11 @@ fn validate_msg(_msg: CANMsg) -> Result<(), Vec<CANSpecError>> {
));
}
// Check little endian point bit count
else if s == "little" && _point.size != 8 && _point.size != 16 && _point.size != 32 {
else if s == "little"
&& _point.size != 8
&& _point.size != 16
&& _point.size != 32
{
_errors.push(CANSpecError::PointLittleEndianBitCount(
_i,
_name.clone(),
Expand Down
Loading