File tree Expand file tree Collapse file tree 11 files changed +60
-44
lines changed
msc_external_flash_sdcard Expand file tree Collapse file tree 11 files changed +60
-44
lines changed Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
59
59
//while ( !Serial ) delay(10); // wait for native usb
60
60
Serial .println ("Core1 setup to run TinyUSB host with pio-usb" );
61
61
62
- // Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
62
+ // Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
63
63
uint32_t cpu_hz = clock_get_hz (clk_sys );
64
- if (cpu_hz != 120000000UL && cpu_hz != 240000000UL ) {
64
+ if (cpu_hz % 12000000UL ) {
65
65
while (!Serial ) {
66
66
delay (10 ); // wait for native usb
67
67
}
68
- Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n" , cpu_hz );
69
- Serial .printf ("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n" );
68
+ Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n" , cpu_hz );
69
+ Serial .printf ("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n" );
70
70
while (1 ) {
71
71
delay (1 );
72
72
}
Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
59
59
//while ( !Serial ) delay(10); // wait for native usb
60
60
Serial .println ("Core1 setup to run TinyUSB host with pio-usb" );
61
61
62
- // Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
62
+ // Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
63
63
uint32_t cpu_hz = clock_get_hz (clk_sys );
64
- if (cpu_hz != 120000000UL && cpu_hz != 240000000UL ) {
64
+ if (cpu_hz % 12000000UL ) {
65
65
while (!Serial ) {
66
66
delay (10 ); // wait for native usb
67
67
}
68
- Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n" , cpu_hz );
69
- Serial .printf ("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n" );
68
+ Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n" , cpu_hz );
69
+ Serial .printf ("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n" );
70
70
while (1 ) {
71
71
delay (1 );
72
72
}
Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
59
59
//while ( !Serial ) delay(10); // wait for native usb
60
60
Serial .println ("Core1 setup to run TinyUSB host with pio-usb" );
61
61
62
- // Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
62
+ // Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
63
63
uint32_t cpu_hz = clock_get_hz (clk_sys );
64
- if (cpu_hz != 120000000UL && cpu_hz != 240000000UL ) {
64
+ if (cpu_hz % 12000000UL ) {
65
65
while (!Serial ) {
66
66
delay (10 ); // wait for native usb
67
67
}
68
- Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n" , cpu_hz );
69
- Serial .printf ("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n" );
68
+ Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n" , cpu_hz );
69
+ Serial .printf ("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n" );
70
70
while (1 ) {
71
71
delay (1 );
72
72
}
Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
59
59
//while ( !Serial ) delay(10); // wait for native usb
60
60
Serial .println ("Core1 setup to run TinyUSB host with pio-usb" );
61
61
62
- // Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
62
+ // Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
63
63
uint32_t cpu_hz = clock_get_hz (clk_sys );
64
- if (cpu_hz != 120000000UL && cpu_hz != 240000000UL ) {
64
+ if (cpu_hz % 12000000UL ) {
65
65
while (!Serial ) {
66
66
delay (10 ); // wait for native usb
67
67
}
68
- Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n" , cpu_hz );
69
- Serial .printf ("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n" );
68
+ Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n" , cpu_hz );
69
+ Serial .printf ("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n" );
70
70
while (1 ) {
71
71
delay (1 );
72
72
}
Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
59
59
//while ( !Serial ) delay(10); // wait for native usb
60
60
Serial .println ("Core1 setup to run TinyUSB host with pio-usb" );
61
61
62
- // Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
62
+ // Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
63
63
uint32_t cpu_hz = clock_get_hz (clk_sys );
64
- if (cpu_hz != 120000000UL && cpu_hz != 240000000UL ) {
64
+ if (cpu_hz % 12000000UL ) {
65
65
while (!Serial ) {
66
66
delay (10 ); // wait for native usb
67
67
}
68
- Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n" , cpu_hz );
69
- Serial .printf ("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n" );
68
+ Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n" , cpu_hz );
69
+ Serial .printf ("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n" );
70
70
while (1 ) {
71
71
delay (1 );
72
72
}
Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
59
59
//while ( !Serial ) delay(10); // wait for native usb
60
60
Serial .println ("Core1 setup to run TinyUSB host with pio-usb" );
61
61
62
- // Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
62
+ // Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
63
63
uint32_t cpu_hz = clock_get_hz (clk_sys );
64
- if (cpu_hz != 120000000UL && cpu_hz != 240000000UL ) {
64
+ if (cpu_hz % 12000000UL ) {
65
65
while (!Serial ) {
66
66
delay (10 ); // wait for native usb
67
67
}
68
- Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n" , cpu_hz );
69
- Serial .printf ("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n" );
68
+ Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n" , cpu_hz );
69
+ Serial .printf ("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n" );
70
70
while (1 ) {
71
71
delay (1 );
72
72
}
Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
59
59
//while ( !Serial ) delay(10); // wait for native usb
60
60
Serial .println ("Core1 setup to run TinyUSB host with pio-usb" );
61
61
62
- // Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
62
+ // Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
63
63
uint32_t cpu_hz = clock_get_hz (clk_sys );
64
- if (cpu_hz != 120000000UL && cpu_hz != 240000000UL ) {
64
+ if (cpu_hz % 12000000UL ) {
65
65
while (!Serial ) {
66
66
delay (10 ); // wait for native usb
67
67
}
68
- Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n" , cpu_hz );
69
- Serial .printf ("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n" );
68
+ Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n" , cpu_hz );
69
+ Serial .printf ("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n" );
70
70
while (1 ) {
71
71
delay (1 );
72
72
}
Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
59
59
//while ( !Serial ) delay(10); // wait for native usb
60
60
Serial .println ("Core1 setup to run TinyUSB host with pio-usb" );
61
61
62
- // Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
62
+ // Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
63
63
uint32_t cpu_hz = clock_get_hz (clk_sys );
64
- if (cpu_hz != 120000000UL && cpu_hz != 240000000UL ) {
64
+ if (cpu_hz % 12000000UL ) {
65
65
while (!Serial ) {
66
66
delay (10 ); // wait for native usb
67
67
}
68
- Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n" , cpu_hz );
69
- Serial .printf ("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n" );
68
+ Serial .printf ("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n" , cpu_hz );
69
+ Serial .printf ("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n" );
70
70
while (1 ) {
71
71
delay (1 );
72
72
}
Original file line number Diff line number Diff line change @@ -61,6 +61,14 @@ Adafruit_SPIFlash flash(&flashTransport);
61
61
#define SDCARD_DETECT 40
62
62
#define SDCARD_DETECT_ACTIVE LOW
63
63
64
+ #elif defined(ARDUINO_ADAFRUIT_FRUITJAM_RP2350)
65
+ #define SDIO_CLK_PIN 34
66
+ #define SDIO_CMD_PIN 35 // MOSI
67
+ #define SDIO_DAT0_PIN 36 // DAT1: 37, DAT2: 38, DAT3: 39
68
+
69
+ #define SDCARD_DETECT 33
70
+ #define SDCARD_DETECT_ACTIVE LOW
71
+
64
72
#else
65
73
// Use SPI, no detect
66
74
#define SDCARD_CS 10
Original file line number Diff line number Diff line change 35
35
#define SDCARD_DETECT_ACTIVE LOW
36
36
37
37
#elif defined(ARDUINO_ADAFRUIT_METRO_RP2350)
38
- // Note: not working yet (need troubleshoot later)
39
38
#define SDIO_CLK_PIN 34
40
39
#define SDIO_CMD_PIN 35 // MOSI
41
40
#define SDIO_DAT0_PIN 36 // DAT1: 37, DAT2: 38, DAT3: 39
42
41
43
42
#define SDCARD_DETECT 40
44
43
#define SDCARD_DETECT_ACTIVE LOW
45
44
45
+ #elif defined(ARDUINO_ADAFRUIT_FRUITJAM_RP2350)
46
+ #define SDIO_CLK_PIN 34
47
+ #define SDIO_CMD_PIN 35 // MOSI
48
+ #define SDIO_DAT0_PIN 36 // DAT1: 37, DAT2: 38, DAT3: 39
49
+
50
+ #define SDCARD_DETECT 33
51
+ #define SDCARD_DETECT_ACTIVE LOW
52
+
46
53
#else
47
54
// Use SPI, no detect
48
55
#define SDCARD_CS 10
Original file line number Diff line number Diff line change 1
1
from pathlib import Path
2
- import click
2
+ import argparse
3
3
import sys
4
4
import shutil
5
5
6
- @click .command ()
7
- @click .argument ('dir' , type = click .Path (), required = True )
8
- def main (dir ):
6
+ def main ():
9
7
"""
10
8
This script takes a mandatory 'dir' argument, which is a path to pivot example to update for all DualRole's examples
11
9
"""
12
- sample_dir = Path (dir )
10
+ parser = argparse .ArgumentParser ()
11
+ parser .add_argument ('dpath' , help = 'path to folder containing usbh_helper.h to copy from' )
12
+ args = parser .parse_args ()
13
+
14
+ dpath = args .dpath
15
+
16
+ sample_dir = Path (dpath )
13
17
if not sample_dir .is_dir ():
14
- # add examples/DualRoles to the path
15
- sample_dir = Path ('examples/DualRole' ) / sample_dir
16
- if not sample_dir .is_dir ():
17
- click .echo (f"The specified dir '{ dir } ' does not exist or is not a valid dir." )
18
- sys .exit (1 )
18
+ print (f"The specified dir '{ dir } ' does not exist or is not a valid dir." )
19
+ sys .exit (1 )
19
20
20
21
sample_file = sample_dir / 'usbh_helper.h'
21
22
f_list = sorted (Path ('examples/DualRole' ).glob ('**/usbh_helper.h' ))
22
23
for f in f_list :
23
24
if f != sample_file :
24
- click . echo (f"Updating { f } " )
25
+ print (f"Updating { f } " )
25
26
shutil .copy (sample_file , f )
26
27
27
28
You can’t perform that action at this time.
0 commit comments