Skip to content

Commit 19bd1d2

Browse files
committed
Add an esp32 target to use the DIY ATT target
1 parent 6ca4b77 commit 19bd1d2

3 files changed

Lines changed: 33 additions & 4 deletions

File tree

src/module_aat.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,13 @@ void AatModule::Init()
115115
#endif
116116
_servoPos[IDX_AZIM] = (config.GetAatServoLow(IDX_AZIM) + config.GetAatServoHigh(IDX_AZIM)) / 2;
117117
#if defined(PIN_SERVO_AZIM)
118-
_servo_Azim.attach(PIN_SERVO_AZIM, 500, 2500, _servoPos[IDX_AZIM]);
118+
_servo_Azim.attach(PIN_SERVO_AZIM, 500, 2500);
119+
_servo_Azim.write(_servoPos[IDX_AZIM]);
119120
#endif
120121
_servoPos[IDX_ELEV] = (config.GetAatServoLow(IDX_ELEV) + config.GetAatServoHigh(IDX_ELEV)) / 2;
121122
#if defined(PIN_SERVO_ELEV)
122-
_servo_Elev.attach(PIN_SERVO_ELEV, 500, 2500, _servoPos[IDX_ELEV]);
123+
_servo_Elev.attach(PIN_SERVO_ELEV, 500, 2500);
124+
_servo_Elev.write(_servoPos[IDX_ELEV]);
123125
#endif
124126
#if defined(PIN_OLED_SDA)
125127
displayInit();
@@ -673,4 +675,4 @@ void AatModule::Loop(uint32_t now)
673675

674676
CrsfModuleBase::Loop(now);
675677
}
676-
#endif /* AAT_BACKPACK */
678+
#endif /* AAT_BACKPACK */

src/module_aat.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
#include "devWIFI.h"
88

99
#if defined(PIN_SERVO_AZIM) || defined(PIN_SERVO_ELEV)
10+
#if defined(ESP32)
11+
#include "ESP32Servo.h"
12+
#else
1013
#include <Servo.h>
1114
#endif
15+
#endif
1216

1317
#if defined(PIN_OLED_SDA)
1418
#include <Wire.h>
@@ -124,4 +128,4 @@ class AatModule : public CrsfModuleBase
124128

125129
extern AatModule vrxModule;
126130

127-
#endif /* AAT_BACKPACK */
131+
#endif /* AAT_BACKPACK */

targets/aat.ini

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
# ********************************
22
# AAT VRX backpack -- Automatic antenna tracking
33
# ********************************
4+
[env:AAT_ESP32_Backpack_via_UART]
5+
extends = env_common_esp32
6+
build_flags =
7+
${common_env_data.build_flags}
8+
${env_common_esp32.build_flags}
9+
-D TARGET_VRX_BACKPACK
10+
-D AAT_BACKPACK
11+
-D SSD1306_NO_SPLASH
12+
-D PIN_BUTTON=25
13+
-D PIN_LED=26
14+
-D LED_INVERTED
15+
-D PIN_SERVO_AZIM=27
16+
-D PIN_SERVO_ELEV=14
17+
-D PIN_OLED_SCL=21
18+
-D PIN_OLED_SDA=22
19+
-D DEBUG_LOG
20+
lib_deps =
21+
${env.lib_deps}
22+
adafruit/Adafruit SSD1306 @ 2.5.9
23+
madhephaestus/ESP32Servo
24+
build_src_filter = ${common_env_data.build_src_filter} -<Tx_main.cpp> -<rapidfire.*> -<rx5808.*> -<steadyview.*> -<Timer_main.cpp> -<mfd_crossbow.*>
25+
26+
427

528
[env:AAT_ESP_Backpack_via_UART]
629
extends = env_common_esp12e

0 commit comments

Comments
 (0)