cnlohr / colorchord

Chromatic Sound to Light Conversion System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange behavior of USE_2812_INTERRUPTS

king2 opened this issue · comments

Hi guys, before next Sysadmin's day I'm back with our lightbanner :)

Previous year we had a problem with freezing colorchord after 5-15 minutes of running.
Now I tried to get fresh sources of everything and check if it still has freezing - and yes, I got it freezed after some time of smooth running.

I checked that ledOut array still works and filled with right values (I can see oscilloscope and LEDs on webpage), so problem can be in ws2812_i2s driver.

And.. USE_2812_INTERRUPTS - should it be defined or not?

I see two places in ws2812_i2s.c where it used with #if and two places where it checked with #ifdef.
Hmm.. as my compiler says to me that I should define it to be checked with #if, I defined it with value of 0. But if we will see to sources, we can see that it will be reason of DMA re-initialization each time ws2812_push is called (and interrupt routine fully commented out). Maybe this is a root of my problem?

Thanks!

I believe for colorchord, it should be disabled. It depends on the application which use the I2S engine. For things like MAGFest Swadges, it is a very useful thing to keep.

I'm actually unaware of any issues surrounding that, as we do operate this for several hours at a time without issue. I recommend looking at both options?

I would be interested to hear what your find.

Maybe your compiler can pass #if SOMETHING as false where SOMETHING is not defined.
My compiler requires me or use #ifdef or define SOMETHING as 0 or FALSE.

I have changed all entries to #ifdef and removed define of USE_2812_INTERRUPTS from my config header file, compiled and run it.

CC works now for 6 hours without any issues.
Maybe this is a factor of 'car just after washing goes faster' :) but as I can see, it works more smooth and fast (because it is not reconfigure DMA each time in ws2812_push).

can you diff it and do a pull request so I can see the difference?

What compile exactly are you using?

I'm using Unofficial Espressif SDK 2.2.2 from here: https://programs74.ru/udkew-en.html
Diff is VERY simple, so it is not needed to make pull request:
ws2812_i2s.c contains 2 places with #ifdef USE_2812_INTERRUPTS and 2 places with #if USE_2812_INTERRUPTS.

I just changed it to be all #ifdefs (in two places).

Done in bcc3347