From d86dc2590ee13adbc8f726de344dea05b49cdd3e Mon Sep 17 00:00:00 2001 From: radex Date: Sat, 8 Jun 2024 10:18:27 +0200 Subject: [PATCH] wip integration hell --- firmware/src/config.h | 6 +++--- firmware/src/leds.cpp | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/firmware/src/config.h b/firmware/src/config.h index 4398868..ce06884 100644 --- a/firmware/src/config.h +++ b/firmware/src/config.h @@ -43,12 +43,12 @@ // #define COL_SRCLR 25 // #define ROW_SER 14 -#define ROW_OE 13 +#define ROW_OE 19 #define ROW_RCLK 20 #define ROW_SRCLK 18 // #define ROW_SRCLR 15 -#define COL_SER_INVERTED false // double inverted +#define COL_SER_INVERTED false #define COL_OE_INVERTED true #define COL_RCLK_INVERTED true #define COL_SRCLK_INVERTED true @@ -75,7 +75,7 @@ // --- other settings --- #define CPU_CLOCK_HZ 125000000.0f -#define SD_CARD_BAUD_RATE 10 * 1000 * 1000 +#define SD_CARD_BAUD_RATE 12 * 1000 * 1000 #define REFERENCE_VOLTAGE 3.3f // for ADC #define CAN_BITRATE 500000 diff --git a/firmware/src/leds.cpp b/firmware/src/leds.cpp index 6bb5a29..dd38638 100644 --- a/firmware/src/leds.cpp +++ b/firmware/src/leds.cpp @@ -148,12 +148,6 @@ void leds_init() { #if COL_OE_INVERTED gpio_set_outover(COL_OE, GPIO_OVERRIDE_INVERT); #endif - #if COL_RCLK_INVERTED - gpio_set_outover(COL_RCLK, GPIO_OVERRIDE_INVERT); - #endif - #if COL_SRCLK_INVERTED - gpio_set_outover(COL_SRCLK, GPIO_OVERRIDE_INVERT); - #endif #if COL_SRCLR_INVERTED gpio_set_outover(COL_SRCLR, GPIO_OVERRIDE_INVERT); #endif @@ -183,6 +177,7 @@ void main2() { void leds_initPIO(); void leds_initRenderer() { + leds_initPIO(); multicore_reset_core1(); multicore_launch_core1(main2); } @@ -259,11 +254,17 @@ void leds_initPusher() { sm_config_set_sideset_pins(&config, COL_SRCLK); pio_gpio_init(pio, COL_SRCLK); pio_sm_set_consecutive_pindirs(pio, sm, COL_SRCLK, 1, true); + #if COL_SRCLK_INVERTED + gpio_set_outover(COL_SRCLK, GPIO_OVERRIDE_INVERT); + #endif // Set SET (RCLK) pin, connect to pad, set as output sm_config_set_set_pins(&config, COL_RCLK, 1); pio_gpio_init(pio, COL_RCLK); pio_sm_set_consecutive_pindirs(pio, sm, COL_RCLK, 1, true); + #if COL_RCLK_INVERTED + gpio_set_outover(COL_RCLK, GPIO_OVERRIDE_INVERT); + #endif // Load our configuration, and jump to the start of the program pio_sm_init(pio, sm, offset, &config);