Skip to content

Instantly share code, notes, and snippets.

I would request changes before merge. The direction is useful, and the sample/PID cleanup looks mostly aligned, but the current implementation has several correctness and robustness problems in host-controlled parsing, shared state, identity handling, buffer sizing, and test coverage.

This is a static review of the PR diff and discussion; I did not run this on USB hardware.

What looks good

The PR now uses the next Zephyr sample PID, adding usb-mtp as 0x0012 in the USB PID table and setting the sample PID to 0x0012. That resolves the earlier PID collision directionally. ([GitHub][1])

The public API is small and understandable: USBD_MTP_DEFINE_STORAGE(id, mountpoint, read_only) registers filesystem-backed MTP storage via iterable sections, and the sample demonstrates a RAM-backed FATFS storage mounted at /RAM:. ([GitHub][1])

@Finomnis
Finomnis / Test.java
Last active November 10, 2019 16:03
public class Test {
private static class A{
public static void test(){
System.out.println("A:test");
}
void dynamic(){
System.out.println("A:dynamic");
}
@Finomnis
Finomnis / canonballs_100000.txt
Created April 9, 2019 11:13
All canonball numbers from 3- to 100,00-gon pyramids
===== 3-gon =====
10 (3, 4)
120 (8, 15)
1540 (20, 55)
7140 (34, 119)
===== 4-gon =====
4900 (24, 70)
#!/usr/bin/env python3
import math
import time
def isPrime(n):
max_divisor = math.floor(math.sqrt(n))
for d in range(2, max_divisor+1):
if n % d == 0:
return False
@Finomnis
Finomnis / gist:ad0a8480fae4565ffaae
Last active August 29, 2015 14:03
Transform Reduce Initial Idea
This is how our current reduce algorithm works.
A A A A A A A A
split:
A A A A A A A A
accumulate:
A A A A
initial B->+->+->+->+->B