Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This includes a bunch of efforts to fix the issue where the same data being output to the LEDs over and over, instead of keeping a steady image, makes for a flickery mess. 1) Swap timer instances used to TIM1, previously TIM3. This could potentially be higher resolution by feeding it a PLL clock, but it seems to work as-is 2) Tinkering with how ADC is disabled prior to an LED transmission Of note is addition of a nop(), and also very much reducing just how much de-initialization was being done just to stop the ADC DMA. 3) Restructure how and what LED data is processed Previously, we updated the led_data array, which is used in DMA requests to clock the data out to GPIO pins, whenever a new segment of LED data arrived. It's quite possible we were writing to this array while it was also used by DMA at the same time, leading to more instability. It's now reworked to stick incoming data as-is into an array until we do led_send_buffer, at which time the lot of it is processed into led_data, and then clocked out with a DMA request. A flag also ensures we don't start any of this if it was already in progress. There are also some optimizations done to the algorithm that populates led_data, to make it faster. Especially important since we're now doing it all at once at led_send_buffer time.
- Loading branch information