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

AC_Sprayer: create and use an AP_Sprayer_config.h #27454

Merged
merged 1 commit into from
Jul 5, 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
3 changes: 2 additions & 1 deletion libraries/AC_Sprayer/AC_Sprayer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "AC_Sprayer.h"
#include "AC_Sprayer_config.h"

#if HAL_SPRAYER_ENABLED

#include "AC_Sprayer.h"
#include <AP_AHRS/AP_AHRS.h>
#include <AP_HAL/AP_HAL.h>
#include <AP_Math/AP_Math.h>
Expand Down
10 changes: 4 additions & 6 deletions libraries/AC_Sprayer/AC_Sprayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
**/
#pragma once

#include "AC_Sprayer_config.h"

#if HAL_SPRAYER_ENABLED

#include <inttypes.h>
#include <AP_Common/AP_Common.h>
#include <AP_Param/AP_Param.h>
Expand All @@ -25,12 +29,6 @@
#define AC_SPRAYER_DEFAULT_TURN_ON_DELAY 100 ///< delay between when we reach the minimum speed and we begin spraying. This reduces the likelihood of constantly turning on/off the pump
#define AC_SPRAYER_DEFAULT_SHUT_OFF_DELAY 1000 ///< shut-off delay in milli seconds. This reduces the likelihood of constantly turning on/off the pump

#ifndef HAL_SPRAYER_ENABLED
#define HAL_SPRAYER_ENABLED 1
#endif

#if HAL_SPRAYER_ENABLED

/// @class AC_Sprayer
/// @brief Object managing a crop sprayer comprised of a spinner and a pump both controlled by pwm
class AC_Sprayer {
Expand Down
7 changes: 7 additions & 0 deletions libraries/AC_Sprayer/AC_Sprayer_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include <AP_HAL/AP_HAL_Boards.h>

#ifndef HAL_SPRAYER_ENABLED
#define HAL_SPRAYER_ENABLED 1
#endif
Loading