Skip to content

Commit

Permalink
Tilt adjustments (#584)
Browse files Browse the repository at this point in the history
* Mark Tilt addon as unavailable if pins are not defined when enabled.

* Fix indent on tilt.
  • Loading branch information
mikepparks authored Oct 18, 2023
1 parent 891f3ad commit 2515bf4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/addons/tilt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
#include "config.pb.h"

bool TiltInput::available() {
return Storage::getInstance().getAddonOptions().tiltOptions.enabled;
const TiltOptions& options = Storage::getInstance().getAddonOptions().tiltOptions;
return options.enabled && ((options.tilt1Pin != -1) || (options.tilt2Pin != -1));
}

void TiltInput::setup() {
const TiltOptions& options = Storage::getInstance().getAddonOptions().tiltOptions;
const TiltOptions& options = Storage::getInstance().getAddonOptions().tiltOptions;
tiltSOCDMode = options.tiltSOCDMode;

pinTilt1 = options.tilt1Pin;
Expand Down

0 comments on commit 2515bf4

Please sign in to comment.