Skip to content

Commit

Permalink
Fix ESP32 S3 CRSF/PPM autodetect (ExpressLRS#2586)
Browse files Browse the repository at this point in the history
* S3 has 4 TX and 4 RX RMT channels. The RX ones start at channel 4.

* Simplification after review
  • Loading branch information
pkendall64 authored Mar 13, 2024
1 parent 7ff2bdb commit a1771e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/lib/Handset/AutoDetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <driver/rmt.h>

constexpr rmt_channel_t PPM_RMT_CHANNEL = RMT_CHANNEL_0;
constexpr auto RMT_TICKS_PER_US = 10;

void AutoDetect::Begin()
Expand Down
1 change: 0 additions & 1 deletion src/lib/Handset/PPMHandset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <driver/rmt.h>

constexpr rmt_channel_t PPM_RMT_CHANNEL = RMT_CHANNEL_0;
constexpr auto RMT_TICKS_PER_US = 10;

void PPMHandset::Begin()
Expand Down
8 changes: 7 additions & 1 deletion src/lib/Handset/PPMHandset.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ class PPMHandset final : public Handset
uint32_t lastPPM = 0;
size_t numChannels = 0;
RingbufHandle_t rb = nullptr;
};
};

#if defined(PLATFORM_ESP32_S3)
constexpr rmt_channel_t PPM_RMT_CHANNEL = RMT_CHANNEL_4;
#else
constexpr rmt_channel_t PPM_RMT_CHANNEL = RMT_CHANNEL_0;
#endif

0 comments on commit a1771e6

Please sign in to comment.