добавлены дефайны для теста разводки оптики

запущено все на s3
скорректированны пины и шим на s3
This commit is contained in:
2026-08-11 21:43:43 +03:00
parent 9d474eb62b
commit f56595f767
6 changed files with 109 additions and 13 deletions

View File

@@ -3,9 +3,22 @@
#include <Arduino.h>
// ------------------------- Hardware configuration -------------------------
// Uncomment for the hand-wired prototype. The production PCB assignments
// below follow the physical header positions shown in the schematic.
// #define MAKETKA
// Enabled for the hand-wired prototype. Comment out for the production PCB.
// Both profiles map S3 signals by physical header position with 5V/GND aligned.
#define MAKETKA
// Additionally log raw GPIO_RX level changes while no test is running.
//#define RX_PIN_CHANGE_TEST
// Standalone PWM output check. While enabled, the normal application is not
// started: GPIO_PWM continuously outputs the frequency and duty below.
// Comment this define out after the hardware check.
//#define PWM_OUTPUT_TEST
constexpr uint32_t PWM_OUTPUT_TEST_FREQUENCY_HZ = 1000;
constexpr uint32_t PWM_OUTPUT_TEST_SWEEP_PERIOD_MS = 2000;
constexpr uint32_t PWM_OUTPUT_TEST_UPDATE_MS = 10;
constexpr uint8_t PWM_OUTPUT_TEST_MIN_DUTY_PCT = 5;
constexpr uint8_t PWM_OUTPUT_TEST_MAX_DUTY_PCT = 95;
#if CONFIG_IDF_TARGET_ESP32C3
constexpr bool TARGET_IS_C3 = true;
@@ -25,12 +38,13 @@ constexpr uint8_t GPIO_SCL = 7;
#elif CONFIG_IDF_TARGET_ESP32S3
constexpr bool TARGET_IS_C3 = false;
#ifdef MAKETKA
constexpr uint8_t GPIO_PWM = 4;
constexpr uint8_t GPIO_RX = 5;
constexpr uint8_t GPIO_BUTTON_MODE = 0;
constexpr uint8_t GPIO_BUTTON_START = 1;
constexpr uint8_t GPIO_SDA = 8;
constexpr uint8_t GPIO_SCL = 9;
// Same physical header contacts as the C3 MAKETKA profile when 5V/GND align.
constexpr uint8_t GPIO_PWM = 12;
constexpr uint8_t GPIO_RX = 13;
constexpr uint8_t GPIO_BUTTON_MODE = 9;
constexpr uint8_t GPIO_BUTTON_START = 10;
constexpr uint8_t GPIO_SDA = 44;
constexpr uint8_t GPIO_SCL = 1;
#else
// The S3 SuperMini is fitted so its 5V and GND pins occupy the same PCB
// contacts as on the C3 SuperMini. Signals therefore follow header position.
@@ -58,7 +72,7 @@ constexpr bool SERIAL_MINIMAL_LOG = true;
#define BUTTON_ACTIVE_LEVEL LOW
#define RX_SIGNAL_INVERTED false
#define PWM_SAFE_LEVEL LOW
#define PWM_SAFE_LEVEL HIGH
#define PWM_SETTLE_CYCLES 5U
constexpr uint32_t BUTTON_DEBOUNCE_MS = 30;