Skip to content

Commit 9f96a9b

Browse files
committed
Formatting
1 parent 683740e commit 9f96a9b

3 files changed

Lines changed: 73 additions & 56 deletions

File tree

platformio.ini

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ build_unflags = -Os -std=gnu++11 -std=gnu++17
6262

6363
; Settings for different boards
6464

65-
;[env:esp12e]
66-
;platform = espressif8266 @ 4.2.1
67-
;board = esp12e
65+
[env:esp12e]
66+
platform = espressif8266 @ 4.2.1
67+
board = esp12e
6868
; Comment out this line below if you have any trouble uploading the firmware
6969
; and if it has a CP2102 on it (a square chip next to the usb port): change to 3000000 (3 million) for even faster upload speed
70-
;upload_speed = 921600
70+
upload_speed = 921600
7171

7272
; Uncomment below if you want to build for ESP-01
7373
;[env:esp01_1m]
@@ -102,18 +102,16 @@ build_unflags = -Os -std=gnu++11 -std=gnu++17
102102
; -DARDUINO_USB_MODE=1
103103
; -DARDUINO_USB_CDC_ON_BOOT=1
104104

105-
[env:esp32c3]
106-
platform = espressif32 @ 6.7.0
107-
platform_packages =
108-
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
109-
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
110-
build_flags =
111-
${env.build_flags}
112-
-DESP32C3
113-
-DARDUINO_USB_MODE=1
114-
-DARDUINO_USB_CDC_ON_BOOT=1
115-
board = lolin_c3_mini
116-
monitor_filters = colorize, esp32_exception_decoder
105+
;[env:esp32c3]
106+
;platform = espressif32 @ 6.7.0
107+
;platform_packages =
108+
; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
109+
; framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
110+
;build_flags =
111+
; ${env.build_flags}
112+
; -DESP32C3
113+
;board = lolin_c3_mini
114+
;monitor_filters = colorize, esp32_exception_decoder
117115

118116
; If you want to use a ESP32C6, you can use this (experimental)
119117
;[env:esp32c6]
@@ -124,3 +122,18 @@ monitor_filters = colorize, esp32_exception_decoder
124122
; -DESP32C6
125123
; -DARDUINO_USB_MODE=1
126124
; -DARDUINO_USB_CDC_ON_BOOT=1
125+
126+
;[env:BOARD_ESP32S3_SUPERMINI]
127+
;platform = espressif32 @ 6.7.0
128+
;platform_packages =
129+
; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
130+
; framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip
131+
;build_flags =
132+
; ${env.build_flags}
133+
; -DARDUINO_USB_MODE=1
134+
; -DESP32S3
135+
;board = esp32s3_supermini
136+
;board_upload.use_1200bps_touch = 1
137+
;board_upload.wait_for_upload_port = 1
138+
;board_upload.require_upload_port = 1
139+
;upload_speed = 921600

src/defines.h

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,50 +26,53 @@
2626
// ================================================
2727

2828
// Set parameters of IMU and board used
29-
#define IMU IMU_ICM45686
30-
#define SECOND_IMU IMU
31-
#define BOARD BOARD_CUSTOM
29+
#ifndef IMU
30+
#define IMU IMU_AUTO
31+
#endif
32+
#ifndef SECOND_IMU
33+
#define SECOND_IMU IMU_AUTO
34+
#endif
35+
#ifndef BOARD
36+
#define BOARD BOARD_SLIMEVR_V1_2
37+
#endif
38+
#ifndef IMU_ROTATION
3239
#define IMU_ROTATION DEG_270
40+
#endif
41+
#ifndef SECOND_IMU_ROTATION
3342
#define SECOND_IMU_ROTATION DEG_270
43+
#endif
3444

45+
#ifndef PRIMARY_IMU_OPTIONAL
3546
#define PRIMARY_IMU_OPTIONAL false
47+
#endif
48+
#ifndef SECONDARY_IMU_OPTIONAL
3649
#define SECONDARY_IMU_OPTIONAL true
50+
#endif
3751

38-
#define MAX_SENSORS_COUNT 2
39-
#define TRACKER_TYPE TrackerType::TRACKER_TYPE_SVR_ROTATION
52+
// Set I2C address here or directly in IMU_DESC_ENTRY for each IMU used
53+
// If not set, default address is used based on the IMU and Sensor ID
54+
// #define PRIMARY_IMU_ADDRESS_ONE 0x4a
55+
// #define SECONDARY_IMU_ADDRESS_TWO 0x4b
4056

41-
#ifndef SENSOR_DESC_LIST
42-
#define SENSOR_DESC_LIST \
43-
SENSOR_DESC_ENTRY( \
44-
IMU, \
45-
PRIMARY_IMU_ADDRESS_ONE, \
46-
IMU_ROTATION, \
47-
DIRECT_WIRE(PIN_IMU_SCL, PIN_IMU_SDA), \
48-
PRIMARY_IMU_OPTIONAL, \
49-
DIRECT_PIN(PIN_IMU_INT), \
50-
0 \
51-
) \
52-
SENSOR_DESC_ENTRY( \
53-
SECOND_IMU, \
54-
SECONDARY_IMU_ADDRESS_TWO, \
55-
SECOND_IMU_ROTATION, \
56-
DIRECT_WIRE(PIN_IMU_SCL, PIN_IMU_SDA), \
57-
SECONDARY_IMU_OPTIONAL, \
58-
DIRECT_PIN(PIN_IMU_INT_2), \
59-
0 \
60-
)
57+
#ifndef BATTERY_MONITOR
58+
// Battery monitoring options (comment to disable):
59+
// BAT_EXTERNAL for ADC pin,
60+
// BAT_INTERNAL for internal - can detect only low battery,
61+
// BAT_MCP3021 for external ADC connected over I2C
62+
#define BATTERY_MONITOR BAT_EXTERNAL
6163
#endif
6264

63-
#define BATTERY_MONITOR BAT_EXTERNAL
65+
// --- OVERRIDES FOR DEFAULT PINS
66+
67+
// #define PIN_IMU_SDA 14
68+
// #define PIN_IMU_SCL 12
69+
// #define PIN_IMU_INT 16
70+
// #define PIN_IMU_INT_2 13
71+
// #define PIN_BATTERY_LEVEL 17
72+
// #define LED_PIN 2
73+
// #define LED_INVERTED true
74+
// #define BATTERY_SHIELD_RESISTANCE 0
75+
// #define BATTERY_SHIELD_R1 10
76+
// #define BATTERY_SHIELD_R2 40.2
6477

65-
#define ON_OFF_BUTTON_PIN 1
66-
#define PIN_IMU_SDA 5
67-
#define PIN_IMU_SCL 6
68-
#define PIN_IMU_INT 255
69-
#define PIN_IMU_INT_2 255
70-
#define PIN_BATTERY_LEVEL 3
71-
#define LED_PIN 0
72-
#define LED_INVERTED true
73-
#define BATTERY_SHIELD_RESISTANCE 0
74-
#define BATTERY_SHIELD_R1 150
75-
#define BATTERY_SHIELD_R2 150
78+
// ------------------------------

src/network/wifihandler.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
*/
23+
#include "network/wifihandler.h"
24+
2325
#include "GlobalVars.h"
2426
#include "globals.h"
25-
#include "network/wifihandler.h"
2627
#if !ESP8266
2728
#include "esp_wifi.h"
2829
#include "esp_wifi_types.h"
@@ -320,15 +321,15 @@ bool WiFiNetwork::tryHardcodedCredentials() {
320321
wifiHandlerLogger.debug("Trying hardcoded credentials with PHY Mode G...");
321322
// Don't need to save hardcoded credentials
322323
WiFi.persistent(false);
323-
auto result = tryConnecting(true, WIFI_CREDS_SSID, WIFI_CREDS_PASSWD);
324+
auto result = tryConnecting(true, WIFI_CREDS_SSID, WIFI_CREDS_PASSWD);
324325
WiFi.persistent(true);
325326
return result;
326327
}
327328

328329
retriedOnG = false;
329330

330331
wifiState = WiFiReconnectionStatus::HardcodeAttempt;
331-
// Don't need to save hardcoded credentials
332+
// Don't need to save hardcoded credentials
332333
WiFi.persistent(false);
333334
auto result = tryConnecting(false, WIFI_CREDS_SSID, WIFI_CREDS_PASSWD);
334335
WiFi.persistent(true);

0 commit comments

Comments
 (0)