I am having weird errors when trying to compile a sketch with a TinyUSB_Mouse_and_Keyboard.h
It seems like parts of the TinyUSB library are not getting defined and that is causing the issue.
The screenshot is a part of the code from the TinyUSB_Mouse_and_Keyboard.h library with the errors
Compiling .pio\build\esp32-s3-devkitc-1\src\main.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\lib1e2\Adafruit_TinyUSB_Library\arduino\Adafruit_TinyUSB_API.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\lib1e2\Adafruit_TinyUSB_Library\arduino\Adafruit_USBD_CDC.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\lib1e2\Adafruit_TinyUSB_Library\arduino\Adafruit_USBD_Device.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\lib1e2\Adafruit_TinyUSB_Library\arduino\hid\Adafruit_USBD_HID.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\lib1e2\Adafruit_TinyUSB_Library\arduino\midi\Adafruit_USBD_MIDI.cpp.o
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/arduino/Adafruit_TinyUSB_API.cpp:25:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
Compiling .pio\build\esp32-s3-devkitc-1\lib1e2\Adafruit_TinyUSB_Library\arduino\msc\Adafruit_USBD_MSC.cpp.o
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/arduino/Adafruit_USBD_CDC.cpp:25:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/arduino/Adafruit_USBD_Device.cpp:25:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/arduino/hid/Adafruit_USBD_HID.cpp:25:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/arduino/midi/Adafruit_USBD_MIDI.cpp:25:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
Compiling .pio\build\esp32-s3-devkitc-1\lib1e2\Adafruit_TinyUSB_Library\arduino\ports\esp32\Adafruit_TinyUSB_esp32.cpp.o
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/arduino/msc/Adafruit_USBD_MSC.cpp:25:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
Compiling .pio\build\esp32-s3-devkitc-1\lib1e2\Adafruit_TinyUSB_Library\arduino\ports\nrf\Adafruit_TinyUSB_nrf.cpp.o
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/arduino/ports/esp32/Adafruit_TinyUSB_esp32.cpp:25:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
Compiling .pio\build\esp32-s3-devkitc-1\lib1e2\Adafruit_TinyUSB_Library\arduino\webusb\Adafruit_USBD_WebUSB.cpp.o
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/arduino/ports/nrf/Adafruit_TinyUSB_nrf.cpp:25:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/arduino/webusb/Adafruit_USBD_WebUSB.cpp:25:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/Adafruit_TinyUSB.h:34,
from E:/projekty/smart-watch/libs/Adafruit_NeoPixel/Adafruit_NeoPixel.h:48,
from src/includes.h:8,
from src/functions.h:1,
from src/main.cpp:1:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
In file included from src/includes.h:17,
from src/functions.h:1,
from src/main.cpp:1:
E:/projekty/smart-watch/libs/IRremote/src/IRremote.hpp:220:2: warning: #warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line over this warning message in file IRremote.hpp. [-Wcpp]
#warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line over this warning message in file IRremote.hpp.
^~~~~~~
Compiling .pio\build\esp32-s3-devkitc-1\lib7f7\TinyUSB_Mouse_and_Keyboard-master\TinyUSB_Mouse_and_Keyboard.cpp.o
In file included from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/tusb_option.h:179,
from E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/Adafruit_TinyUSB.h:34,
from E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:55:
E:/projekty/smart-watch/libs/Adafruit_TinyUSB_Library/src/common/tusb_mcu.h:275:4: warning: #warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8" [-Wcpp]
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
^~~~~~~
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\USBCDC.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\USBMSC.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\WString.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\base64.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\esp32-hal-cpu.c.o
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\esp32-hal-dac.c.o
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:66:35: error: 'HID_REPORT_ID' was not declared in this scope
TUD_HID_REPORT_DESC_KEYBOARD( HID_REPORT_ID(RID_KEYBOARD) ),
^~~~~~~~~~~~~
Compiling .pio\build\esp32-s3-devkitc-1\FrameworkArduino\esp32-hal-gpio.c.o
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:66:35: note: suggested alternative: 'TUD_RHPORT_MODE'
TUD_HID_REPORT_DESC_KEYBOARD( HID_REPORT_ID(RID_KEYBOARD) ),
^~~~~~~~~~~~~
TUD_RHPORT_MODE
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:66:5: error: 'TUD_HID_REPORT_DESC_KEYBOARD' was not declared in this scope
TUD_HID_REPORT_DESC_KEYBOARD( HID_REPORT_ID(RID_KEYBOARD) ),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:67:32: error: 'HID_REPORT_ID' was not declared in this scope
TUD_HID_REPORT_DESC_MOUSE( HID_REPORT_ID(RID_MOUSE) )
^~~~~~~~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:67:32: note: suggested alternative: 'TUD_RHPORT_MODE'
TUD_HID_REPORT_DESC_MOUSE( HID_REPORT_ID(RID_MOUSE) )
^~~~~~~~~~~~~
TUD_RHPORT_MODE
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:67:5: error: 'TUD_HID_REPORT_DESC_MOUSE' was not declared in this scope
TUD_HID_REPORT_DESC_MOUSE( HID_REPORT_ID(RID_MOUSE) )
^~~~~~~~~~~~~~~~~~~~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:67:5: note: suggested alternative: 'TUH_RHPORT_MODE'
TUD_HID_REPORT_DESC_MOUSE( HID_REPORT_ID(RID_MOUSE) )
^~~~~~~~~~~~~~~~~~~~~~~~~
TUH_RHPORT_MODE
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:70:3: error: 'Adafruit_USBD_HID' does not name a type
Adafruit_USBD_HID usb_hid;
^~~~~~~~~~~~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp: In member function 'void TinyMouse_::begin()':
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:81:5: error: 'usb_hid' was not declared in this scope
usb_hid.setPollInterval(2);
^~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:84:13: error: 'USBDevice' was not declared in this scope
while( !USBDevice.mounted() ) delay(1);
^~~~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:84:13: note: suggested alternative: 'USBSerial'
while( !USBDevice.mounted() ) delay(1);
^~~~~~~~~
USBSerial
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp: In member function 'void TinyMouse_::move(int8_t, int8_t, int8_t)':
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:88:10: error: 'USBDevice' was not declared in this scope
if ( USBDevice.suspended() ) {
^~~~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:88:10: note: suggested alternative: 'USBSerial'
if ( USBDevice.suspended() ) {
^~~~~~~~~
USBSerial
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:91:12: error: 'usb_hid' was not declared in this scope
while(!usb_hid.ready()) delay(1);
^~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:92:5: error: 'usb_hid' was not declared in this scope
usb_hid.mouseReport(RID_MOUSE,_buttons,x,y,wheel,0);
^~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp: In member function 'void TinyKeyboard_::begin()':
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:144:5: error: 'usb_hid' was not declared in this scope
usb_hid.setPollInterval(2);
^~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:147:13: error: 'USBDevice' was not declared in this scope
while( !USBDevice.mounted() ) delay(1);
^~~~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:147:13: note: suggested alternative: 'USBSerial'
while( !USBDevice.mounted() ) delay(1);
^~~~~~~~~
USBSerial
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp: In member function 'void TinyKeyboard_::sendReport(KeyReport*)':
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:156:10: error: 'USBDevice' was not declared in this scope
if ( USBDevice.suspended() ) {
^~~~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:156:10: note: suggested alternative: 'USBSerial'
if ( USBDevice.suspended() ) {
^~~~~~~~~
USBSerial
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:159:12: error: 'usb_hid' was not declared in this scope
while(!usb_hid.ready()) delay(1);
^~~~~~~
E:/projekty/smart-watch/libs/TinyUSB_Mouse_and_Keyboard-master/TinyUSB_Mouse_and_Keyboard.cpp:160:5: error: 'usb_hid' was not declared in this scope
usb_hid.keyboardReport(RID_KEYBOARD,keys->modifiers,keys->keys);
^~~~~~~
*** [.pio\build\esp32-s3-devkitc-1\lib7f7\TinyUSB_Mouse_and_Keyboard-master\TinyUSB_Mouse_and_Keyboard.cpp.o] Error 1
This is my build output.
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
lib_extra_dirs = E:\projekty\smart-watch\libs
monitor_speed = 115200
board_build.f_cpu = 240000000
upload_speed = 921600
build_flags =
-DCORE_DEBUG_LEVEL=5
-DUSE_TINYUSB=true
board_build.mcu = esp32s3
lib_archive = no
This is my platformio.ini file
I have tried altering the platformio.ini file, the “lib_archive = no” didn’t help and without “-DUSE_TINYUSB=true” there were a lot more issues.
Sorry for bad text formatting it’s my first time here