From f5fea7f09b9d22e685a9c522e287f1235b72e82a Mon Sep 17 00:00:00 2001 From: Maarten van der Schrieck Date: Fri, 21 Jun 2024 21:35:51 +0200 Subject: [PATCH] pico_cyw43_driver/cyw43_bus_pio_spi.c: make SPI_PROGRAM_NAME and CLOCK_DIV configurable in makefile (#1499) --- src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.c b/src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.c index 5afe85e62..5e0eaf134 100644 --- a/src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.c +++ b/src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.c @@ -29,13 +29,22 @@ #define CS_PIN 25u #define IRQ_SAMPLE_DELAY_NS 100 -#define SPI_PROGRAM_NAME spi_gap01_sample0 +#ifdef CYW43_SPI_PROGRAM_NAME +#define SPI_PROGRAM_NAME CYW43_SPI_PROGRAM_NAME +#else +//#define SPI_PROGRAM_NAME spi_gap0_sample1 // for lower cpu speed +#define SPI_PROGRAM_NAME spi_gap01_sample0 // for high cpu speed +#endif #define SPI_PROGRAM_FUNC __CONCAT(SPI_PROGRAM_NAME, _program) #define SPI_PROGRAM_GET_DEFAULT_CONFIG_FUNC __CONCAT(SPI_PROGRAM_NAME, _program_get_default_config) #define SPI_OFFSET_END __CONCAT(SPI_PROGRAM_NAME, _offset_end) #define SPI_OFFSET_LP1_END __CONCAT(SPI_PROGRAM_NAME, _offset_lp1_end) +#ifdef CYW43_PIO_CLOCK_DIV +#define CLOCK_DIV CYW43_PIO_CLOCK_DIV +#else #define CLOCK_DIV 2 +#endif #define CLOCK_DIV_MINOR 0 #define PADS_DRIVE_STRENGTH PADS_BANK0_GPIO0_DRIVE_VALUE_12MA