From faf45bb9c40b5e0e1eeea16844b67206bbbb824e Mon Sep 17 00:00:00 2001 From: PS Date: Thu, 6 May 2021 10:47:22 -1000 Subject: [PATCH] added the ability to zero out packets being sent to led destinations --- .../editor/panels/foldhaus_panel_assembly_debug.h | 2 ++ src/app/foldhaus_app.cpp | 12 ++++++++++++ src/app/foldhaus_app.h | 1 + src/app/ss_blumen_lumen/blumen_lumen_settings.h | 5 ++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/app/editor/panels/foldhaus_panel_assembly_debug.h b/src/app/editor/panels/foldhaus_panel_assembly_debug.h index 24922b3..4ef3599 100644 --- a/src/app/editor/panels/foldhaus_panel_assembly_debug.h +++ b/src/app/editor/panels/foldhaus_panel_assembly_debug.h @@ -137,6 +137,8 @@ AssemblyDebug_Render(panel* Panel, rect2 PanelBounds, render_command_buffer* Ren }break; } } + + State->SendEmptyPackets = ui_LabeledToggle(Interface, MakeString("Send Empty Packets"), State->SendEmptyPackets); ui_PopLayout(Interface, MakeString("Assembly Debug Layout")); } diff --git a/src/app/foldhaus_app.cpp b/src/app/foldhaus_app.cpp index 89bf4fe..9b37512 100644 --- a/src/app/foldhaus_app.cpp +++ b/src/app/foldhaus_app.cpp @@ -166,6 +166,18 @@ UPDATE_AND_RENDER(UpdateAndRender) Assert(State->UserSpaceDesc.UserData.Memory != 0); BuildAssemblyData(State, *Context, OutputData); + + // NOTE(PS): We introduced this in order to test some things on the + // blumen lumen circuit boards, to see if they were getting out + // of sync + if (State->SendEmptyPackets) { + for (addressed_data_buffer* At = OutputData->Root; + At != 0; + At = At->Next) + { + ZeroMemoryBlock(At->Memory, At->MemorySize); + } + } } CLEANUP_APPLICATION(CleanupApplication) diff --git a/src/app/foldhaus_app.h b/src/app/foldhaus_app.h index 4241794..5666c95 100644 --- a/src/app/foldhaus_app.h +++ b/src/app/foldhaus_app.h @@ -77,6 +77,7 @@ struct app_state bool ShowingUserSpaceDebug; bool RunEditor; + bool SendEmptyPackets; }; internal void OpenColorPicker(app_state* State, v4* Address); diff --git a/src/app/ss_blumen_lumen/blumen_lumen_settings.h b/src/app/ss_blumen_lumen/blumen_lumen_settings.h index c95029e..85b9dd0 100644 --- a/src/app/ss_blumen_lumen/blumen_lumen_settings.h +++ b/src/app/ss_blumen_lumen/blumen_lumen_settings.h @@ -16,7 +16,7 @@ gs_const_string Flower2AssemblyPath = ConstString("data/ss_blumen_three.fold"); // The path to the phrase map CSV. Can be an absolute path, or relative // to the app_run_tree folder -gs_const_string PhraseMapCSVPath = ConstString("C:/projects/flowers-sound/flower_codes.tsv"); +gs_const_string PhraseMapCSVPath = ConstString("C:/projects/Lumenarium/app_run_tree/data/flower_codes.tsv"); char PhraseMapCSVSeparator = '\t'; // Search Strings for which folders to find ambient animation files and @@ -50,6 +50,9 @@ global r32 MotorResendStatePeriod = 90.0f; // seconds // The times of day when the leds should be on // Search for @TimeFormat to find documentation global time_range LedOnTimes[] = { + { 14, 43, 14, 44 }, + { 14, 45, 14, 46 }, + { 17, 00, 23, 59 }, { 00, 00, 06, 30 }, };