Skip to content

Commit 45af3d6

Browse files
committed
Update examples
1 parent 9560d08 commit 45af3d6

File tree

20 files changed

+34
-20
lines changed

20 files changed

+34
-20
lines changed

examples/device/audio_4_channel_mic/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
129129
// Invoked when usb bus is resumed
130130
void tud_resume_cb(void)
131131
{
132-
blink_interval_ms = BLINK_MOUNTED;
132+
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
133133
}
134134

135135
//--------------------------------------------------------------------+

examples/device/audio_test/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
130130
// Invoked when usb bus is resumed
131131
void tud_resume_cb(void)
132132
{
133-
blink_interval_ms = BLINK_MOUNTED;
133+
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
134134
}
135135

136136
//--------------------------------------------------------------------+

examples/device/audio_test_multi_rate/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
142142
// Invoked when usb bus is resumed
143143
void tud_resume_cb(void)
144144
{
145-
blink_interval_ms = BLINK_MOUNTED;
145+
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
146146
}
147147

148148
//--------------------------------------------------------------------+

examples/device/cdc_msc/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
9595
// Invoked when usb bus is resumed
9696
void tud_resume_cb(void)
9797
{
98-
blink_interval_ms = BLINK_MOUNTED;
98+
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
9999
}
100100

101101

examples/device/cdc_msc_freertos/src/main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,14 @@ void tud_suspend_cb(bool remote_wakeup_en)
175175
// Invoked when usb bus is resumed
176176
void tud_resume_cb(void)
177177
{
178-
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
178+
if (tud_mounted())
179+
{
180+
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
181+
}
182+
else
183+
{
184+
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), 0);
185+
}
179186
}
180187

181188
//--------------------------------------------------------------------+

examples/device/dfu/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
112112
// Invoked when usb bus is resumed
113113
void tud_resume_cb(void)
114114
{
115-
blink_interval_ms = BLINK_MOUNTED;
115+
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
116116
}
117117

118118
//--------------------------------------------------------------------+

examples/device/dfu_runtime/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
107107
// Invoked when usb bus is resumed
108108
void tud_resume_cb(void)
109109
{
110-
blink_interval_ms = BLINK_MOUNTED;
110+
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
111111
}
112112

113113
// Invoked on DFU_DETACH request to reboot to the bootloader

examples/device/dynamic_configuration/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
9696
// Invoked when usb bus is resumed
9797
void tud_resume_cb(void)
9898
{
99-
blink_interval_ms = BLINK_MOUNTED;
99+
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
100100
}
101101

102102

examples/device/hid_boot_interface/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
9898
// Invoked when usb bus is resumed
9999
void tud_resume_cb(void)
100100
{
101-
blink_interval_ms = BLINK_MOUNTED;
101+
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
102102
}
103103

104104
//--------------------------------------------------------------------+

examples/device/hid_composite/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
9797
// Invoked when usb bus is resumed
9898
void tud_resume_cb(void)
9999
{
100-
blink_interval_ms = BLINK_MOUNTED;
100+
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
101101
}
102102

103103
//--------------------------------------------------------------------+

0 commit comments

Comments
 (0)