From 8a03ddc73361751016070003ba019e40736454f4 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Wed, 16 Jun 2021 08:55:05 +0100 Subject: [PATCH] DEFAULT_DVI_SERIAL_CONFIG -> DVI_DEFAULT_SERIAL_CONFIG --- software/CMakeLists.txt | 6 +++--- software/Readme.md | 2 +- software/apps/bad_apple/main.c | 2 +- software/apps/colour_terminal/main.c | 2 +- software/apps/dht_logging/main.c | 2 +- software/apps/hello_dvi/main.c | 2 +- software/apps/mandel-full/main.c | 2 +- software/apps/mandelbrot/main.c | 2 +- software/apps/moon/main.c | 2 +- software/apps/sprite_bounce/main.c | 2 +- software/apps/terminal/main.c | 2 +- software/apps/vista-palette/main.c | 2 +- software/apps/vista/main.c | 2 +- software/include/common_dvi_pin_configs.h | 4 ++-- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/software/CMakeLists.txt b/software/CMakeLists.txt index 364de0c..4379d73 100644 --- a/software/CMakeLists.txt +++ b/software/CMakeLists.txt @@ -9,11 +9,11 @@ pico_sdk_init() add_compile_options(-Wall) # To change the default serial config for all apps, pass e.g. -# cmake -DDEFAULT_DVI_SERIAL_CONFIG=pimoroni_demo_hdmi_cfg .. +# cmake -DDVI_DEFAULT_SERIAL_CONFIG=pimoroni_demo_hdmi_cfg .. # then rebuild. -set(DEFAULT_DVI_SERIAL_CONFIG "pico_sock_cfg" CACHE STRING +set(DVI_DEFAULT_SERIAL_CONFIG "pico_sock_cfg" CACHE STRING "Select a default pin configuration from common_dvi_pin_configs.h") -add_definitions(-DDEFAULT_DVI_SERIAL_CONFIG=${DEFAULT_DVI_SERIAL_CONFIG}) +add_definitions(-DDVI_DEFAULT_SERIAL_CONFIG=${DVI_DEFAULT_SERIAL_CONFIG}) include_directories( assets diff --git a/software/Readme.md b/software/Readme.md index bde16a6..e229f23 100644 --- a/software/Readme.md +++ b/software/Readme.md @@ -34,7 +34,7 @@ static const struct dvi_serialiser_cfg picodvi_dvi_cfg = { }; ``` -Serial configurations for a handful of boards are listed in [common_dvi_pin_configs.h](include/common_dvi_pin_configs.h). Feel free to raise a PR to add your board to this file. All of the example apps use the `DEFAULT_DVI_SERIAL_CONFIG` from this header to select their pin configuration, which has a default value of `pico_sock_cfg`. You can pass `-DDEFAULT_DVI_SERIAL_CONFIG=some_other_board` to `cmake` to override this default, so that the example apps will be built with a different serial configuration. +Serial configurations for a handful of boards are listed in [common_dvi_pin_configs.h](include/common_dvi_pin_configs.h). Feel free to raise a PR to add your board to this file. All of the example apps use the `DVI_DEFAULT_SERIAL_CONFIG` from this header to select their pin configuration, which has a default value of `pico_sock_cfg`. You can pass `-DDVI_DEFAULT_SERIAL_CONFIG=some_other_board` to `cmake` to override this default, so that the example apps will be built with a different serial configuration. As well as the DVI serial configuration, you may also want to set the `PICO_BOARD` flag for your target board to pick up things like UART and LED pin settings. diff --git a/software/apps/bad_apple/main.c b/software/apps/bad_apple/main.c index 3959f61..73c49d2 100644 --- a/software/apps/bad_apple/main.c +++ b/software/apps/bad_apple/main.c @@ -34,7 +34,7 @@ int main() { setup_default_uart(); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); dvi_register_irqs_this_core(&dvi0, DMA_IRQ_0); diff --git a/software/apps/colour_terminal/main.c b/software/apps/colour_terminal/main.c index 24f41cf..f3871d8 100644 --- a/software/apps/colour_terminal/main.c +++ b/software/apps/colour_terminal/main.c @@ -124,7 +124,7 @@ int __not_in_flash("main") main() { set_sys_clock_khz(DVI_TIMING.bit_clk_khz, true); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); for (uint y = 0; y < CHAR_ROWS; ++y) { diff --git a/software/apps/dht_logging/main.c b/software/apps/dht_logging/main.c index 3af78a4..af36001 100644 --- a/software/apps/dht_logging/main.c +++ b/software/apps/dht_logging/main.c @@ -125,7 +125,7 @@ int main() { setup_default_uart(); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); const int BORDER = 10; diff --git a/software/apps/hello_dvi/main.c b/software/apps/hello_dvi/main.c index 0a1cd32..2136c8b 100644 --- a/software/apps/hello_dvi/main.c +++ b/software/apps/hello_dvi/main.c @@ -38,7 +38,7 @@ int main() { setup_default_uart(); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); // Core 1 will wait until it sees the first colour buffer, then start up the diff --git a/software/apps/mandel-full/main.c b/software/apps/mandel-full/main.c index 83d137d..5b492b5 100644 --- a/software/apps/mandel-full/main.c +++ b/software/apps/mandel-full/main.c @@ -143,7 +143,7 @@ int __not_in_flash("main") main() { printf("Configuring DVI\n"); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); printf("Core 1 start\n"); diff --git a/software/apps/mandelbrot/main.c b/software/apps/mandelbrot/main.c index eb77ef5..2507566 100644 --- a/software/apps/mandelbrot/main.c +++ b/software/apps/mandelbrot/main.c @@ -63,7 +63,7 @@ int main() { printf("Configuring DVI\n"); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi0.scanline_callback = core1_scanline_callback; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); diff --git a/software/apps/moon/main.c b/software/apps/moon/main.c index 8f63b29..857c42e 100644 --- a/software/apps/moon/main.c +++ b/software/apps/moon/main.c @@ -48,7 +48,7 @@ int main() { setup_default_uart(); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); dvi_register_irqs_this_core(&dvi0, DMA_IRQ_0); diff --git a/software/apps/sprite_bounce/main.c b/software/apps/sprite_bounce/main.c index 0c15f72..52fa370 100644 --- a/software/apps/sprite_bounce/main.c +++ b/software/apps/sprite_bounce/main.c @@ -162,7 +162,7 @@ int main() { printf("Configuring DVI\n"); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); printf("Core 1 start\n"); diff --git a/software/apps/terminal/main.c b/software/apps/terminal/main.c index 860c37b..9a5aeed 100644 --- a/software/apps/terminal/main.c +++ b/software/apps/terminal/main.c @@ -122,7 +122,7 @@ int __not_in_flash("main") main() { printf("Configuring DVI\n"); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi0.scanline_callback = core1_scanline_callback; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); diff --git a/software/apps/vista-palette/main.c b/software/apps/vista-palette/main.c index 7d51685..de99d34 100644 --- a/software/apps/vista-palette/main.c +++ b/software/apps/vista-palette/main.c @@ -113,7 +113,7 @@ int __not_in_flash("main") main() { printf("Configuring DVI\n"); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); printf("DMA palette and setup\n"); diff --git a/software/apps/vista/main.c b/software/apps/vista/main.c index 8b7c954..d8cff3a 100644 --- a/software/apps/vista/main.c +++ b/software/apps/vista/main.c @@ -100,7 +100,7 @@ int __not_in_flash("main") main() { printf("Configuring DVI\n"); dvi0.timing = &DVI_TIMING; - dvi0.ser_cfg = DEFAULT_DVI_SERIAL_CONFIG; + dvi0.ser_cfg = DVI_DEFAULT_SERIAL_CONFIG; dvi_init(&dvi0, next_striped_spin_lock_num(), next_striped_spin_lock_num()); printf("DMA first image line\n"); diff --git a/software/include/common_dvi_pin_configs.h b/software/include/common_dvi_pin_configs.h index 1ed27e6..564d499 100644 --- a/software/include/common_dvi_pin_configs.h +++ b/software/include/common_dvi_pin_configs.h @@ -7,8 +7,8 @@ #include "dvi_serialiser.h" -#ifndef DEFAULT_DVI_SERIAL_CONFIG -#define DEFAULT_DVI_SERIAL_CONFIG pico_sock_cfg +#ifndef DVI_DEFAULT_SERIAL_CONFIG +#define DVI_DEFAULT_SERIAL_CONFIG pico_sock_cfg #endif // ----------------------------------------------------------------------------