Skip to content

Commit fd7b35f

Browse files
committed
Move the rotation input to target.cpp
1 parent b26f53a commit fd7b35f

3 files changed

Lines changed: 5 additions & 17 deletions

File tree

variants/heltec_rc32/HeltecRC32Board.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
#include "HeltecRC32Board.h"
2-
#if defined(UI_HAS_ROTARY_INPUT)
3-
#include "HeltecRC32RotaryInput.h"
4-
#endif
5-
6-
#if defined(UI_HAS_ROTARY_INPUT)
7-
RotaryInput& HeltecRC32Board::rotaryInput() {
8-
static HeltecRC32RotaryInput input(&periph_power);
9-
return input;
10-
}
11-
#endif
122

133
void HeltecRC32Board::begin() {
144
ESP32Board::begin();

variants/heltec_rc32/HeltecRC32Board.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#include <driver/rtc_io.h>
55
#include <helpers/ESP32Board.h>
66
#include <helpers/RefCountedDigitalPin.h>
7-
#if defined(UI_HAS_ROTARY_INPUT)
8-
#include <helpers/ui/RotaryInput.h>
9-
#endif
107

118
#ifndef ADC_MULTIPLIER
129
#define ADC_MULTIPLIER 4.9f
@@ -22,9 +19,6 @@ class HeltecRC32Board : public ESP32Board {
2219
HeltecRC32Board() : periph_power(SENSOR_POWER_CTRL_PIN, SENSOR_POWER_ON){}
2320

2421
void begin();
25-
#if defined(UI_HAS_ROTARY_INPUT)
26-
RotaryInput& rotaryInput();
27-
#endif
2822
void onBeforeTransmit() override;
2923
void onAfterTransmit() override;
3024
void powerOff() override;

variants/heltec_rc32/target.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include <Arduino.h>
22
#include "target.h"
3+
#if defined(UI_HAS_ROTARY_INPUT)
4+
#include "HeltecRC32RotaryInput.h"
5+
#endif
36

47
HeltecRC32Board board;
58

@@ -27,7 +30,8 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock);
2730
DISPLAY_CLASS display;
2831
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
2932
#if defined(UI_HAS_ROTARY_INPUT)
30-
RotaryInput& rotary_input = board.rotaryInput();
33+
static HeltecRC32RotaryInput rotaryInputImpl(&board.periph_power);
34+
RotaryInput& rotary_input = rotaryInputImpl;
3135
#endif
3236
#endif
3337

0 commit comments

Comments
 (0)