commit
5ab76b7931
11 changed files with 60 additions and 44 deletions
|
|
@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
|
|||
//while ( !Serial ) delay(10); // wait for native usb
|
||||
Serial.println("Core1 setup to run TinyUSB host with pio-usb");
|
||||
|
||||
// Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
|
||||
// Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
|
||||
uint32_t cpu_hz = clock_get_hz(clk_sys);
|
||||
if (cpu_hz != 120000000UL && cpu_hz != 240000000UL) {
|
||||
if (cpu_hz % 12000000UL) {
|
||||
while (!Serial) {
|
||||
delay(10); // wait for native usb
|
||||
}
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n");
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n");
|
||||
while (1) {
|
||||
delay(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
|
|||
//while ( !Serial ) delay(10); // wait for native usb
|
||||
Serial.println("Core1 setup to run TinyUSB host with pio-usb");
|
||||
|
||||
// Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
|
||||
// Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
|
||||
uint32_t cpu_hz = clock_get_hz(clk_sys);
|
||||
if (cpu_hz != 120000000UL && cpu_hz != 240000000UL) {
|
||||
if (cpu_hz % 12000000UL) {
|
||||
while (!Serial) {
|
||||
delay(10); // wait for native usb
|
||||
}
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n");
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n");
|
||||
while (1) {
|
||||
delay(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
|
|||
//while ( !Serial ) delay(10); // wait for native usb
|
||||
Serial.println("Core1 setup to run TinyUSB host with pio-usb");
|
||||
|
||||
// Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
|
||||
// Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
|
||||
uint32_t cpu_hz = clock_get_hz(clk_sys);
|
||||
if (cpu_hz != 120000000UL && cpu_hz != 240000000UL) {
|
||||
if (cpu_hz % 12000000UL) {
|
||||
while (!Serial) {
|
||||
delay(10); // wait for native usb
|
||||
}
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n");
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n");
|
||||
while (1) {
|
||||
delay(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
|
|||
//while ( !Serial ) delay(10); // wait for native usb
|
||||
Serial.println("Core1 setup to run TinyUSB host with pio-usb");
|
||||
|
||||
// Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
|
||||
// Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
|
||||
uint32_t cpu_hz = clock_get_hz(clk_sys);
|
||||
if (cpu_hz != 120000000UL && cpu_hz != 240000000UL) {
|
||||
if (cpu_hz % 12000000UL) {
|
||||
while (!Serial) {
|
||||
delay(10); // wait for native usb
|
||||
}
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n");
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n");
|
||||
while (1) {
|
||||
delay(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
|
|||
//while ( !Serial ) delay(10); // wait for native usb
|
||||
Serial.println("Core1 setup to run TinyUSB host with pio-usb");
|
||||
|
||||
// Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
|
||||
// Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
|
||||
uint32_t cpu_hz = clock_get_hz(clk_sys);
|
||||
if (cpu_hz != 120000000UL && cpu_hz != 240000000UL) {
|
||||
if (cpu_hz % 12000000UL) {
|
||||
while (!Serial) {
|
||||
delay(10); // wait for native usb
|
||||
}
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n");
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n");
|
||||
while (1) {
|
||||
delay(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
|
|||
//while ( !Serial ) delay(10); // wait for native usb
|
||||
Serial.println("Core1 setup to run TinyUSB host with pio-usb");
|
||||
|
||||
// Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
|
||||
// Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
|
||||
uint32_t cpu_hz = clock_get_hz(clk_sys);
|
||||
if (cpu_hz != 120000000UL && cpu_hz != 240000000UL) {
|
||||
if (cpu_hz % 12000000UL) {
|
||||
while (!Serial) {
|
||||
delay(10); // wait for native usb
|
||||
}
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n");
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n");
|
||||
while (1) {
|
||||
delay(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
|
|||
//while ( !Serial ) delay(10); // wait for native usb
|
||||
Serial.println("Core1 setup to run TinyUSB host with pio-usb");
|
||||
|
||||
// Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
|
||||
// Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
|
||||
uint32_t cpu_hz = clock_get_hz(clk_sys);
|
||||
if (cpu_hz != 120000000UL && cpu_hz != 240000000UL) {
|
||||
if (cpu_hz % 12000000UL) {
|
||||
while (!Serial) {
|
||||
delay(10); // wait for native usb
|
||||
}
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n");
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n");
|
||||
while (1) {
|
||||
delay(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,14 +59,14 @@ static void rp2040_configure_pio_usb(void) {
|
|||
//while ( !Serial ) delay(10); // wait for native usb
|
||||
Serial.println("Core1 setup to run TinyUSB host with pio-usb");
|
||||
|
||||
// Check for CPU frequency, must be multiple of 120Mhz for bit-banging USB
|
||||
// Check for CPU frequency, must be multiple of 12 Mhz for bit-banging USB
|
||||
uint32_t cpu_hz = clock_get_hz(clk_sys);
|
||||
if (cpu_hz != 120000000UL && cpu_hz != 240000000UL) {
|
||||
if (cpu_hz % 12000000UL) {
|
||||
while (!Serial) {
|
||||
delay(10); // wait for native usb
|
||||
}
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 120 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to either 120 or 240 Mhz in Menu->CPU Speed \r\n");
|
||||
Serial.printf("Error: CPU Clock = %lu, PIO USB require CPU clock must be multiple of 12 Mhz\r\n", cpu_hz);
|
||||
Serial.printf("Change your CPU Clock to 12*n Mhz in Menu->CPU Speed \r\n");
|
||||
while (1) {
|
||||
delay(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,14 @@ Adafruit_SPIFlash flash(&flashTransport);
|
|||
#define SDCARD_DETECT 40
|
||||
#define SDCARD_DETECT_ACTIVE LOW
|
||||
|
||||
#elif defined(ARDUINO_ADAFRUIT_FRUITJAM_RP2350)
|
||||
#define SDIO_CLK_PIN 34
|
||||
#define SDIO_CMD_PIN 35 // MOSI
|
||||
#define SDIO_DAT0_PIN 36 // DAT1: 37, DAT2: 38, DAT3: 39
|
||||
|
||||
#define SDCARD_DETECT 33
|
||||
#define SDCARD_DETECT_ACTIVE LOW
|
||||
|
||||
#else
|
||||
// Use SPI, no detect
|
||||
#define SDCARD_CS 10
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#define SDCARD_DETECT_ACTIVE LOW
|
||||
|
||||
#elif defined(ARDUINO_ADAFRUIT_METRO_RP2350)
|
||||
// Note: not working yet (need troubleshoot later)
|
||||
#define SDIO_CLK_PIN 34
|
||||
#define SDIO_CMD_PIN 35 // MOSI
|
||||
#define SDIO_DAT0_PIN 36 // DAT1: 37, DAT2: 38, DAT3: 39
|
||||
|
|
@ -43,6 +42,14 @@
|
|||
#define SDCARD_DETECT 40
|
||||
#define SDCARD_DETECT_ACTIVE LOW
|
||||
|
||||
#elif defined(ARDUINO_ADAFRUIT_FRUITJAM_RP2350)
|
||||
#define SDIO_CLK_PIN 34
|
||||
#define SDIO_CMD_PIN 35 // MOSI
|
||||
#define SDIO_DAT0_PIN 36 // DAT1: 37, DAT2: 38, DAT3: 39
|
||||
|
||||
#define SDCARD_DETECT 33
|
||||
#define SDCARD_DETECT_ACTIVE LOW
|
||||
|
||||
#else
|
||||
// Use SPI, no detect
|
||||
#define SDCARD_CS 10
|
||||
|
|
|
|||
|
|
@ -1,27 +1,28 @@
|
|||
from pathlib import Path
|
||||
import click
|
||||
import argparse
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
@click.command()
|
||||
@click.argument('dir', type=click.Path(), required=True)
|
||||
def main(dir):
|
||||
def main():
|
||||
"""
|
||||
This script takes a mandatory 'dir' argument, which is a path to pivot example to update for all DualRole's examples
|
||||
"""
|
||||
sample_dir = Path(dir)
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('dpath', help='path to folder containing usbh_helper.h to copy from')
|
||||
args = parser.parse_args()
|
||||
|
||||
dpath = args.dpath
|
||||
|
||||
sample_dir = Path(dpath)
|
||||
if not sample_dir.is_dir():
|
||||
# add examples/DualRoles to the path
|
||||
sample_dir = Path('examples/DualRole') / sample_dir
|
||||
if not sample_dir.is_dir():
|
||||
click.echo(f"The specified dir '{dir}' does not exist or is not a valid dir.")
|
||||
sys.exit(1)
|
||||
print(f"The specified dir '{dir}' does not exist or is not a valid dir.")
|
||||
sys.exit(1)
|
||||
|
||||
sample_file = sample_dir / 'usbh_helper.h'
|
||||
f_list = sorted(Path('examples/DualRole').glob('**/usbh_helper.h'))
|
||||
for f in f_list:
|
||||
if f != sample_file:
|
||||
click.echo(f"Updating {f}")
|
||||
print(f"Updating {f}")
|
||||
shutil.copy(sample_file, f)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue