diff --git a/smx-config/Helpers.cs b/smx-config/Helpers.cs index aab0853..590d52a 100644 --- a/smx-config/Helpers.cs +++ b/smx-config/Helpers.cs @@ -518,7 +518,7 @@ namespace smx_config color = config.stepColor; for( int iPanel = 0; iPanel < 9; ++iPanel ) { - for( int i = 0; i < 16; ++i ) + for( int i = 0; i < 25; ++i ) { // Auto-lights colors in the config packet are scaled so the firmware // doesn't have to do it, but here we're setting the panel color to @@ -531,7 +531,7 @@ namespace smx_config } } - SMX.SMX.SetLights(cmd.Get()); + SMX.SMX.SetLights2(cmd.Get()); } }; diff --git a/smx-config/SMX.cs b/smx-config/SMX.cs index 60ec7be..c2bbecd 100644 --- a/smx-config/SMX.cs +++ b/smx-config/SMX.cs @@ -273,7 +273,7 @@ namespace SMX [DllImport("SMX.dll", CallingConvention = CallingConvention.Cdecl)] private static extern bool SMX_GetTestData(int pad, out SMXSensorTestModeData data); [DllImport("SMX.dll", CallingConvention = CallingConvention.Cdecl)] - private static extern bool SMX_SetLights(byte[] buf); + private static extern bool SMX_SetLights2(byte[] buf, int lightDataSize); [DllImport("SMX.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] private static extern IntPtr SMX_Version(); @@ -441,13 +441,11 @@ namespace SMX SMX_ForceRecalibration(pad); } - public static void SetLights(byte[] buf) + public static void SetLights2(byte[] buf) { if(!DLLAvailable()) return; - if(buf.Length != 9*16*3*2) - throw new Exception("SetLights buffer has an invalid length: " + buf.Length); - SMX_SetLights(buf); + SMX_SetLights2(buf, buf.Length); } // SMXPanelAnimation