Skip to content

Commit

Permalink
Fix for S3 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
terjeio committed Aug 1, 2024
1 parent a5aef32 commit 316cc4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions main/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2247,8 +2247,8 @@ static void settings_changed (settings_t *settings, settings_changed_flags_t cha
config.pin_bit_mask = 1ULL << signal->pin;
config.mode = GPIO_MODE_INPUT;
#if CONFIG_IDF_TARGET_ESP32S3
config.pull_up_en = pullup ? GPIO_PULLUP_ENABLE : GPIO_PULLUP_DISABLE;
config.pull_down_en = pullup ? GPIO_PULLDOWN_DISABLE : GPIO_PULLDOWN_ENABLE;
config.pull_up_en = signal->mode.pull_mode == PullMode_Up ? GPIO_PULLUP_ENABLE : GPIO_PULLUP_DISABLE;
config.pull_down_en = signal->mode.pull_mode == PullMode_Up ? GPIO_PULLDOWN_DISABLE : GPIO_PULLDOWN_ENABLE;
// Early versions(?) has an internal pullup on 45 - https://github.com/espressif/esp-idf/issues/9731
#else
config.pull_up_en = signal->mode.pull_mode == PullMode_Up && signal->pin < 34 ? GPIO_PULLUP_ENABLE : GPIO_PULLUP_DISABLE;
Expand Down Expand Up @@ -2524,11 +2524,19 @@ void neopixels_write (void)
uint8_t *buf = neopixel.leds;
size_t size = neopixel.num_bytes;

#if CONFIG_IDF_TARGET_ESP32S3
if(buf) do {
rmt_write_sample(neo_config.channel, buf, size > 3 ? 3 : size, true);
buf += size > 3 ? 3 : size;
size -= size > 3 ? 3 : size;
} while(size);
#else
if(buf) do {
rmt_write_sample(neo_config.channel, buf, size > 6 ? 6 : size, true);
buf += size > 6 ? 6 : size;
size -= size > 6 ? 6 : size;
} while(size);
#endif
}

static void neopixel_out_masked (uint16_t device, rgb_color_t color, rgb_color_mask_t mask)
Expand Down Expand Up @@ -2811,7 +2819,7 @@ bool driver_init (void)
#else
hal.info = "ESP32";
#endif
hal.driver_version = "240701";
hal.driver_version = "240719";
hal.driver_url = GRBL_URL "/ESP32";
#ifdef BOARD_NAME
hal.board = BOARD_NAME;
Expand Down
2 changes: 1 addition & 1 deletion main/trinamic_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "driver.h"

#if defined(BOARD_XPRO_V5) || defined(BOARD_BLOX)
#if defined(BOARD_XPRO_V5)

#include <math.h>
#include <string.h>
Expand Down

0 comments on commit 316cc4b

Please sign in to comment.