Skip to content

Commit

Permalink
AC_Sprayer: create and use an AP_Sprayer_config.h
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jul 5, 2024
1 parent 6ce7e17 commit 21eba74
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
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

0 comments on commit 21eba74

Please sign in to comment.