Skip to content

Commit

Permalink
fix higher GPIO numbers for PWM1 (41,45,53)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonarddevries committed Aug 1, 2019
1 parent 0284f11 commit 7d538cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ static char VERSION[] = "XX.YY.ZZ";

// defaults for cmdline options
#define TARGET_FREQ WS2811_TARGET_FREQ
#define GPIO_PIN 45
#define GPIO_PIN 18
#define DMA 10
#define STRIP_TYPE WS2811_STRIP_RGB // WS2812/SK6812RGB integrated chip+leds
//#define STRIP_TYPE WS2811_STRIP_GBR // WS2812/SK6812RGB integrated chip+leds
//#define STRIP_TYPE SK6812_STRIP_RGBW // SK6812RGBW (NOT SK6812RGB)

#define WIDTH 1
#define HEIGHT 1
#define WIDTH 0
#define HEIGHT 0
#define LED_COUNT (WIDTH * HEIGHT)

int width = WIDTH;
Expand Down
4 changes: 2 additions & 2 deletions ws2811.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ static int set_driver_mode(ws2811_t *ws2811, int gpionum)
ws2811->device->driver_mode = PWM;
// Check gpio for PWM1 (2nd channel) is OK if used
gpionum2 = ws2811->channel[1].gpionum;
if (gpionum2 == 0 || gpionum2 == 13 || gpionum2 == 19) {
if (gpionum2 == 0 || gpionum2 == 13 || gpionum2 == 19 || gpionum == 41 || gpionum == 45 || gpionum == 53) {
return 0;
}
}
Expand Down Expand Up @@ -711,7 +711,7 @@ static int check_hwver_and_gpionum(ws2811_t *ws2811)
// Special case: nothing in channel 0, channel 1 only PWM1 allowed
// PWM1 only available on 40 pin GPIO interface
gpionum = ws2811->channel[1].gpionum;
if ((gpionum == 13) || (gpionum == 19))
if (gpionum == 13 || gpionum == 19 || gpionum == 41 || gpionum == 45 || gpionum == 53)
{
ws2811->device->driver_mode = PWM;
return 0;
Expand Down

0 comments on commit 7d538cb

Please sign in to comment.