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

SNS - Brakes sensor #72

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

SNS - Brakes sensor #72

wants to merge 14 commits into from

Conversation

tahn1234
Copy link

No description provided.

@TomLonergan03 TomLonergan03 changed the title Brakes sensor SNS - Brakes sensor Feb 14, 2024
lib/sensors/brakes.hpp Outdated Show resolved Hide resolved
lib/sensors/brakes.cpp Outdated Show resolved Hide resolved
lib/sensors/brakes.cpp Outdated Show resolved Hide resolved
@licornes-fluos
Copy link
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
Contributor

Choose a reason for hiding this comment

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

delete this file

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

if (reading == core::DigitalSignal::kHigh) { return false; }
Copy link
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 :)

Brakes::Brakes(core::ILogger &logger, std::shared_ptr<io::IGpioReader> gpio_reader)
: gpio_reader_(gpio_reader),
logger_(logger),
pin_()
Copy link
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