Comments (1)
@DiE-MaRMeLaDe due to differences in 32bit SAMD21 in M0 and 8bit 32U4 using int
, you may be able to cast (uint8_t) in line 150 and 151 of WebUSB.cpp
D_ENDPOINT((uint8_t)USB_ENDPOINT_OUT(pluggedEndpoint),USB_ENDPOINT_TYPE_BULK,0x40,0),
D_ENDPOINT((uint8_t)USB_ENDPOINT_IN (pluggedEndpoint+1),USB_ENDPOINT_TYPE_BULK,0x40,0)
This will remove the -Wnarrowing error. However there should more error that was missed
C:\Users\JP\Documents\Arduino\libraries\WebUSB\WebUSB.cpp:164:42: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (USB_SendControl(0, &landingPage, 1) < 0)
It will be really hard to get rid of this without major reworking on the M0 USBCore.cpp
uint32_t USBDeviceClass::sendControl(const void* _data, uint32_t len)
{
const uint8_t *data = reinterpret_cast<const uint8_t *>(_data);
uint32_t length = len;
uint32_t sent = 0;
uint32_t pos = 0;
if (_dry_run == true)
return length;
if (_pack_message == true) {
memcpy(&_pack_buffer[_pack_size], data, len);
_pack_size += len;
return length;
}
while (len > 0)
{
sent = armSend(EP0, data + pos, len);
pos += sent;
len -= sent;
}
return length;
}
Above, you can see that in SAMD21's USBCore.cpp
the command sendControl
only returns unsigned
number but in Leonardo sendControl
has negative 1 number return that mean something
int USB_SendControl(u8 flags, const void* d, int len)
{
int sent = len;
const u8* data = (const u8*)d;
bool pgm = flags & TRANSFER_PGM;
while (len--)
{
u8 c = pgm ? pgm_read_byte(data++) : *data++;
if (!SendControl(c))
return -1;
}
return sent;
}
So, either you report a bug at Arduino M0's github or it will be easier and less stress to use another board that is listed here, since M0 is a retired product.
Hope this helps. If you think this answer your questions, please close this issue.
from arduino.
Related Issues (20)
- atmega32u4 only connects to Windows not Mac HOT 2
- No devices detected with Seeeduino Xiao
- how set baudrate? what default speed? HOT 3
- ESP32-S2 support HOT 2
- License HOT 1
- MRKZero support? HOT 2
- Is webUSB supported for Arduino Uno R3 HOT 2
- WebUSB requires a board that supports USB client device mode HOT 2
- Arduino UNO support
- CUSTOM PID/VID HOT 1
- Question about usage of controlTransferOut() at connect() and disconnect() in serial.js HOT 3
- Getting Started mentions hardware/arduino/avr/cores/arduino/USBCore.h when there is no such file on Github HOT 2
- Not working with Seeeduino XIAO HOT 15
- WebUSB not working anymore with SAMD Board Version > 1.8.10 HOT 1
- No Connecting Device. HOT 3
- Can not download https://github.com/kimio-kosaka/webUSB-arduino/archive/v1.0.0.tar.gz HOT 1
- SAM Support?
- Feature Request: Arduino PortentaH7 HOT 9
- GitPod Integration HOT 1
- how can i insert a value in the console without use the keyboard? i mean, a button that I press and isert a value, what is the function to insert? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino.