From bbe753add0f7bce6dc0647891c299de63cf17a4c Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Sun, 16 Aug 2026 01:26:34 +0300 Subject: [PATCH] Enable motor pins only for classic esp32 by default Also simplify flix2 config code. --- flix/config.h | 18 ++++++++++++------ flix/motors.ino | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/flix/config.h b/flix/config.h index badea19..e3d1429 100644 --- a/flix/config.h +++ b/flix/config.h @@ -12,16 +12,22 @@ void setDefaults() { pwmFrequency = 38000; #endif + #ifdef CONFIG_IDF_TARGET_ESP32 + // classic esp32 configuration + motorPins[0] = 12; + motorPins[1] = 13; + motorPins[2] = 14; + motorPins[3] = 15; + #endif + #ifdef FLIX2 imuModel = 4; // ICM-40609-D imuIntPin = 10; imuCsPin = 14; - - motorPins[MOTOR_REAR_LEFT] = 41; - motorPins[MOTOR_REAR_RIGHT] = 7; - motorPins[MOTOR_FRONT_RIGHT] = 18; - motorPins[MOTOR_FRONT_LEFT] = 38; - voltagePin = 3; + motorPins[0] = 41; + motorPins[1] = 7; + motorPins[2] = 18; + motorPins[3] = 38; #endif } diff --git a/flix/motors.ino b/flix/motors.ino index 6b808b1..959a951 100644 --- a/flix/motors.ino +++ b/flix/motors.ino @@ -7,7 +7,7 @@ float motors[4]; // normalized motor thrusts in range [0..1] -int motorPins[4] = {12, 13, 14, 15}; // default pin numbers +int motorPins[4] = {-1, -1, -1, -1}; // default pin numbers int pwmFrequency = 78000; int pwmResolution = 10; int pwmStop = 0;