Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5471

Bare metal, Assembly language • Re: Seeking help with Circle C++ to C conversion

$
0
0
I think familiarizing yourself with the code and writing what you learn sounds like a good idea. It's pretty dense code. I would start in lib/usb/xhcidevice.c and work your way through the headers and functions. Circle's USB is over 17,000 lines of code, not counting interrupt code (~500 lines), input (2600 lines), sound (4600 lines), or pcie (over 600 lines).

I didn't write the code, I only ported it to C, so I am not an expert. The sample/08-usbkeyboard was my main test case because I was most focused on getting the keyboard working.

In terms of approach, in my experience I find reducing the number of files helps with managing complexity. The best way I know of to make something very easy to integrate in other projects is the single header approach, which is why I suggested it.

Admittedly I am not dependent on what you do because I have my own goals and only want to see USB be available stand-alone as a nice side goal. By saying this I mean you can do what you think is best, but I might not be rushing to merge changes or anything because my goals for rpi-system (discussed a bit in this thread, but not entirely revealed) aren't related to getting a standalone USB going.

The first step code-wise would be making usb/ not depend on libcircle (the files in the top-level lib/ directory), which would make it clearer what is needed when porting it to other bare metal systems.

Statistics: Posted by macoy — Fri Dec 22, 2023 12:44 am



Viewing all articles
Browse latest Browse all 5471

Trending Articles