Skip to content

Commit 09c4703

Browse files
committed
fix esp32 build with examples
1 parent 4d39711 commit 09c4703

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

examples/DualRole/HID/hid_mouse_tremor_filter/hid_mouse_tremor_filter.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ butterworth_coeffs_t butterworth_lowpass(float cutoff_frequency, float sampling_
168168
butterworth_coeffs_t coe;
169169

170170
float omega = 2.0 * PI * cutoff_frequency / sampling_frequency;
171-
float c = cos(omega);
172171
float s = sin(omega);
173172
float t = tan(omega / 2.0);
174173
float alpha = s / (2.0 * t);

examples/DualRole/MassStorage/msc_data_logger/msc_data_logger.ino

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,20 @@ void data_log(void) {
9393
}
9494

9595
#ifdef USE_FREERTOS
96+
97+
#ifdef ARDUINO_ARCH_ESP32
98+
#define USBH_STACK_SZ 2048
99+
#else
100+
#define USBH_STACK_SZ 200
101+
#endif
102+
96103
void usbhost_rtos_task(void *param) {
97104
(void) param;
98105
while (1) {
99106
USBHost.task();
100107
}
101108
}
102109

103-
void create_usbhost_rtos_task(void) {
104-
const uint32_t usbh_stack_size = 400;
105-
xTaskCreate(usbhost_rtos_task, "usbh", usbh_stack_size, NULL, TASK_PRIO_HIGH, NULL);
106-
}
107110
#endif
108111

109112
void setup() {
@@ -118,7 +121,8 @@ void setup() {
118121
#endif
119122

120123
#ifdef USE_FREERTOS
121-
create_usbhost_rtos_task();
124+
// Create a task to run USBHost.task() in background
125+
xTaskCreate(usbhost_rtos_task, "usbh", USBH_STACK_SZ, NULL, 3, NULL);
122126
#endif
123127

124128
// while ( !Serial ) delay(10); // wait for native usb

0 commit comments

Comments
 (0)