diff --git a/software/src/pusher.cpp b/software/src/pusher.cpp index 74ce296..cd95e69 100644 --- a/software/src/pusher.cpp +++ b/software/src/pusher.cpp @@ -13,7 +13,6 @@ Pusher::Pusher(void) { } void Pusher::setup(void) { - int channel = 13; // LEDC_CHANNEL_3 // beware: some channels interfere with the rmt peripheral used by FastLED ledcSetup(channel, 50, TIMER_WIDTH); for(int pin : SERVO_PINS) { if (xSemaphoreTake(xSemaphore, TIMEOUT) == pdTRUE) { @@ -30,11 +29,7 @@ void Pusher::setup(void) { void Pusher::push(int num) { if (xSemaphoreTake(xSemaphore, TIMEOUT) == pdTRUE) { - int channel = 1; int pin = SERVO_PINS[num]; - if (channel >= LEDC_NUM_CHANNELS) { - return; - } // ledcSetup(channel, 50, TIMER_WIDTH); ledcAttachPin(pin, channel); ledcWrite(channel, MIN_PULSE_WIDTH); diff --git a/software/src/pusher.h b/software/src/pusher.h index 3568b56..d98fb81 100644 --- a/software/src/pusher.h +++ b/software/src/pusher.h @@ -18,6 +18,8 @@ static constexpr uint8_t PROGMEM LEDC_NUM_CHANNELS = 8; // default pulse width static constexpr TickType_t PROGMEM TIMEOUT = portMAX_DELAY; +static constexpr uint8_t PROGMEM channel = 13; // LEDC_CHANNEL_3 // beware: some channels interfere with the rmt peripheral used by FastLED + class Pusher { public: Pusher(void);