Skip to content

SNS - Brakes sensor - #72

Open
tahn1234 wants to merge 14 commits into
masterfrom
brakesSensor
Open

SNS - Brakes sensor#72
tahn1234 wants to merge 14 commits into
masterfrom
brakesSensor

Conversation

@tahn1234

Copy link
Copy Markdown

No description provided.

@TomLonergan03 TomLonergan03 changed the title Brakes sensor SNS - Brakes sensor Feb 14, 2024
Comment thread lib/sensors/brakes.hpp Outdated
Comment thread lib/sensors/brakes.cpp Outdated
Comment thread lib/sensors/brakes.cpp Outdated
@licornes-fluos

Copy link
Copy Markdown
Contributor

Make modifications so that it build and push.
You need to clang-format your two files. For this, go to the folder where they are and in the command line write clang-format -i nameOfFile.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this file

Comment thread lib/sensors/brakes.cpp Outdated
Comment thread lib/sensors/brakes.cpp Outdated
Comment thread lib/sensors/brakes.cpp Outdated
Comment thread lib/sensors/brakes.cpp Outdated
Comment thread lib/sensors/brakes.hpp Outdated
Comment thread lib/sensors/brakes.hpp Outdated
Comment thread lib/sensors/brakes.cpp
Comment thread lib/sensors/brakes.cpp
if (!optional_reading) { return std::nullopt; }
const auto reading = *optional_reading;

if (reading == core::DigitalSignal::kHigh) { return false; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need an if statement here - you can just return the condition :)

Comment thread lib/sensors/brakes.cpp
Brakes::Brakes(core::ILogger &logger, std::shared_ptr<io::IGpioReader> gpio_reader)
: gpio_reader_(gpio_reader),
logger_(logger),
pin_()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this here? Either pass the pin into the constructor if it may need to be accessible in the future (i.e. if something else might want to know which pin it's using) or remove it from here and the header file

@davidbeechey davidbeechey added the needs-testing Awaiting testing in the lab before merge label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-testing Awaiting testing in the lab before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants