diff --git a/src/main.cpp b/src/main.cpp index e131961..e7ea172 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -114,9 +114,15 @@ int main(int argc, char *argv[]) { while (1) { + memset(hid_buf, 0, sizeof(uint8_t) * Dox.packet_size); + if (Dox.is_connected()) { if (std::chrono::steady_clock::now() > t + std::chrono::milliseconds(30)) { if (Dox.get_animation_mode() == 0x02) { + + // Animation data type + hid_buf[1] = CMD_ANIM_DATA_fft; + if (std::chrono::steady_clock::now() > last_fifo_sync + std::chrono::seconds(10)) { mpd_run_disable_output(conn, 1); mpd_run_enable_output(conn, 1); @@ -136,7 +142,7 @@ int main(int argc, char *argv[]) { h = h>KB_RESOLUTION ? KB_RESOLUTION : h; h = h<0 ? 0 : h; - hid_buf[i] = h; + hid_buf[i + 1] = h; } Dox.write(CMD_ANIM_DATA, hid_buf, Dox.packet_size); }