Global strip offset in fader

This commit is contained in:
Thomas Kolb 2020-02-21 20:15:39 +01:00
parent 905c3fce7b
commit da37f32096
3 changed files with 5 additions and 1 deletions

View file

@ -5,6 +5,8 @@
class Fader class Fader
{ {
public: public:
static const uint8_t STRIP_OFFSET = 3;
struct Color { struct Color {
int16_t r, g, b, w; int16_t r, g, b, w;

View file

@ -41,7 +41,7 @@ void ImageScrollerAnimation::loop(uint64_t frame)
continue; continue;
} }
int32_t s = (nstrip - strip - 1 + 5) % nstrip; int32_t s = nstrip - strip - 1;
m_fader->set_color(s, led, m_image.pixel(im_x, im_y)); m_fader->set_color(s, led, m_image.pixel(im_x, im_y));
} }
} }

View file

@ -111,6 +111,8 @@ void Fader::update(void)
uint32_t Fader::make_module_idx(uint32_t strip, uint32_t module) uint32_t Fader::make_module_idx(uint32_t strip, uint32_t module)
{ {
strip = (strip + STRIP_OFFSET) % m_strips;
bool flip = m_flipStripsMask & (1 << strip); bool flip = m_flipStripsMask & (1 << strip);
if(flip) { if(flip) {
module = m_modulesPerStrip - module - 1; module = m_modulesPerStrip - module - 1;