From bd7f8f2962e829ba2e1afa0b5df494280ad760f0 Mon Sep 17 00:00:00 2001 From: TuxMonkey <8196772+tuxmonkey@user.noreply.gitee.com> Date: Mon, 20 Jul 2026 14:10:32 +0800 Subject: [PATCH] silentmode(ERROR!) --- User_Code/module/periph/buzzer/buzzer.cpp | 42 +++++++++++++---------- User_Code/module/periph/buzzer/buzzer.h | 2 ++ ozonedeb/windebnewestux.jdebug.user | 6 ++-- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/User_Code/module/periph/buzzer/buzzer.cpp b/User_Code/module/periph/buzzer/buzzer.cpp index 480238a..2afe9ec 100644 --- a/User_Code/module/periph/buzzer/buzzer.cpp +++ b/User_Code/module/periph/buzzer/buzzer.cpp @@ -215,6 +215,11 @@ void buzzer_off(void) */ void buzzer_note(uint16_t note, float volume) { +#ifdef SILENT_MODE + (void)note; + (void)volume; + return; +#endif if (volume > 1.0f) { volume = 1.0f; @@ -243,25 +248,26 @@ void systemstart_song(void) HAL_TIM_PWM_Start(&htim12, TIM_CHANNEL_2); // Super Mario - buzzer_note(659, 0.5); - HAL_Delay(120); // E5 - buzzer_note(659, 0.5); - HAL_Delay(120); // E5 - buzzer_note(659, 0.5); - HAL_Delay(250); // E5 - buzzer_off(); - HAL_Delay(80); - buzzer_note(262, 0.5); - HAL_Delay(120); // C4 - buzzer_note(659, 0.5); - HAL_Delay(250); // E5 - buzzer_note(784, 0.5); - HAL_Delay(400); // G5 - buzzer_off(); - HAL_Delay(150); - buzzer_note(392, 0.5); - HAL_Delay(500); // G4 + // buzzer_note(659, 0.5); + // HAL_Delay(120); // E5 + // buzzer_note(659, 0.5); + // HAL_Delay(120); // E5 + // buzzer_note(659, 0.5); + // HAL_Delay(250); // E5 + // buzzer_off(); + // HAL_Delay(80); + // buzzer_note(262, 0.5); + // HAL_Delay(120); // C4 + // buzzer_note(659, 0.5); + // HAL_Delay(250); // E5 + // buzzer_note(784, 0.5); + // HAL_Delay(400); // G5 + // buzzer_off(); + // HAL_Delay(150); + // buzzer_note(392, 0.5); + // HAL_Delay(500); // G4 + SongLaoda(); buzzer_off(); } diff --git a/User_Code/module/periph/buzzer/buzzer.h b/User_Code/module/periph/buzzer/buzzer.h index 07a110e..0aeea87 100644 --- a/User_Code/module/periph/buzzer/buzzer.h +++ b/User_Code/module/periph/buzzer/buzzer.h @@ -8,6 +8,8 @@ // #include "struct_typedef.h" /*---------------------DEFINES-----------------------*/ // +//#define SILENT_MODE // 取消注释以关闭所有提示音(有bug!!!) + #define PLAYING_STOP 0 #define PLAYING_INIT_MUSIC 1 diff --git a/ozonedeb/windebnewestux.jdebug.user b/ozonedeb/windebnewestux.jdebug.user index 966200e..6899143 100644 --- a/ozonedeb/windebnewestux.jdebug.user +++ b/ozonedeb/windebnewestux.jdebug.user @@ -7,10 +7,10 @@ OpenWindow="Call Stack", DockArea=RIGHT, x=0, y=0, w=681, h=226, TabPos=0, TopOf OpenWindow="Registers 1", DockArea=BOTTOM, x=1, y=0, w=361, h=181, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, FilteredItems=[], RefreshRate=1 OpenWindow="Source Files", DockArea=LEFT, x=0, y=0, w=663, h=189, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Disassembly", DockArea=BOTTOM, x=2, y=0, w=632, h=181, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 -OpenWindow="Break & Tracepoints", DockArea=LEFT, x=0, y=1, w=663, h=180, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VectorCatchIndexMask=254 +OpenWindow="Break & Tracepoints", DockArea=LEFT, x=0, y=1, w=663, h=181, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VectorCatchIndexMask=254 OpenWindow="Memory 1", DockArea=BOTTOM, x=3, y=0, w=462, h=181, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, EditorAddress=0x2000B98C OpenWindow="Global Data", DockArea=RIGHT, x=0, y=2, w=681, h=260, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 -OpenWindow="Watched Data 1", DockArea=LEFT, x=0, y=2, w=663, h=202, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 +OpenWindow="Watched Data 1", DockArea=LEFT, x=0, y=2, w=663, h=201, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Functions", DockArea=LEFT, x=0, y=3, w=663, h=168, TabPos=1, TopOfStack=0, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Call Graph", DockArea=LEFT, x=0, y=3, w=663, h=168, TabPos=2, TopOfStack=1, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0 OpenWindow="Data Sampling", DockArea=BOTTOM, x=0, y=0, w=1102, h=181, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VisibleTab=0, UniformSampleSpacing=0 @@ -20,7 +20,7 @@ OpenWindow="FreeRTOS", DockArea=RIGHT, x=0, y=0, w=681, h=226, TabPos=1, TopOfSt TableHeader="Call Graph", SortCol="Name", SortOrder="ASCENDING", VisibleCols=["Name";"Stack Total";"Stack Local";"Code Total";"Code Local";"Depth";"Called From"], ColWidths=[384;100;100;100;100;100;102] TableHeader="Task List", SortCol="Name", SortOrder="ASCENDING", VisibleCols=["Name";"Run Count";"Priority";"Status";"Timeout";"Stack Info (Free / Size)";"ID";"Mutex Count";"Notified Value";"Notify State"], ColWidths=[110;110;110;110;110;110;110;110;110;110] TableHeader="Functions", SortCol="Name", SortOrder="ASCENDING", VisibleCols=["Name";"Address";"Size";"#Insts";"Source"], ColWidths=[1164;100;100;100;100] -TableHeader="Global Data", SortCol="Name", SortOrder="ASCENDING", VisibleCols=["Name";"Value";"Location";"Size";"Type";"Scope"], ColWidths=[222;130;100;54;95;100] +TableHeader="Global Data", SortCol="Name", SortOrder="ASCENDING", VisibleCols=["Name";"Value";"Location";"Size";"Type";"Scope"], ColWidths=[222;130;100;54;95;427] TableHeader="Vector Catches", SortCol="None", SortOrder="ASCENDING", VisibleCols=["";"Vector Catch";"Description"], ColWidths=[50;300;500] TableHeader="Break & Tracepoints", SortCol="None", SortOrder="ASCENDING", VisibleCols=["";"Type";"Location";"Extras"], ColWidths=[100;100;142;321] TableHeader="Source Files", SortCol="File", SortOrder="ASCENDING", VisibleCols=["File";"Status";"Size";"#Insts";"Path"], ColWidths=[229;100;100;100;917]