And that was working just fine, I could change Led colors etc.
But then I wanted to make it nice and like in private properties etc. so I moved initString to private in my class,
and changed constructor to:
struct ws2811_t{
uint64_t render_wait_time; //< time in µs before the next render can run
struct ws2811_device *device; //< Private data for driver use
const rpi_hw_t *rpi_hw; //< RPI Hardware Information
uint32_t freq; //< Required output frequency
int dmanum; //< DMA number _not_ already in use
ws2811_channel_t channel[RPI_PWM_CHANNELS];
};
ws2811_channel_t ledstring;
ledstring.gpionum = LED_PIN;
ledstring.invert = LED_INVERT;
ledstring.count = LED_COUNT;
ledstring.brightness = LED_BRIGHTNESS;
ws2811_t initString;
initString.freq = LED_FREQ_HZ;
initString.dmanum = LED_DMA;
initString.channel[LED_CHANNEL] = ledstring;
ws2811_init(&initString )
//Some LEd changing
ws2811_render(&initString )
So init works, I gues success, but render hands and whole thing freezes.
I did some messing around and if I define gamma then I get error in ws2811_render function.
I just can't figure it out, I belive it's some init issue when it's in private property.
When I try to print initString.channel[0].birghtness it does not give me my 255 value but I believe some bit or buffer ?
Hi,
I am basically trying to do, what you did. but on a smaller scale.
So I have class and constructor.
When in my constructor as a test I was doing :
And that was working just fine, I could change Led colors etc.
But then I wanted to make it nice and like in private properties etc. so I moved
initString
to private in my class, and changed constructor to:So
init
works, I guessuccess
, but render hands and whole thing freezes. I did some messing around and if I definegamma
then I get error in ws2811_render function.I just can't figure it out, I belive it's some init issue when it's in private property. When I try to print
initString.channel[0].birghtness
it does not give me my255
value but I believe some bit or buffer ?It's something I do with init,
that works as well something to do with channel assignment :/