rikka0w0 / ch55x_usb_compositedevice Goto Github PK
View Code? Open in Web Editor NEWUSB Composite Device Demo (Keyboard, Custom HID and Massive Storage) using CH55x
License: MIT License
USB Composite Device Demo (Keyboard, Custom HID and Massive Storage) using CH55x
License: MIT License
除了键盘,鼠标可以支持吗?
Hiya,
There's a comment in main.c that asks:
* According to SDCC specification, interrupt handlers MUST be placed within the file which contains
* the void main(void) function, otherwise SDCC won't be able to recognize it. It's not a bug but a feature.
* If you know how to fix this, please let me know.
CH55x_USB_CompositeDevice/main.c
Line 27 in 489bcf7
The SDCC specification actually states that interrupt handlers must be defined in main. The implementation of the function can exist elsewhere. See http://fivedots.coe.psu.ac.th/~cj/masd/resources/sdcc-doc/SDCCUdoc-11.html
I've also independently verified this assertion using some custom USB code on the CH554, compiled using SDCC. e.g.
void main()
{
clock_init();
uart1_init(1);
usbd_init();
LED_PORT_DIR |= LED_MSK;
LED_PORT_PU &= ~(LED_MSK);
while (1)
{
LED_PORT |= LED_MSK;
wait_ms(500);
LED_PORT &= ~LED_MSK;
wait_ms(500);
}
}
void usb_int(void) __interrupt(INT_NO_USB);
and in usbd.c:
void usb_int(void) __interrupt(INT_NO_USB) {
....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.