From cc5f1c61c714b5e3c1da3818b6ef20c6b2cd54b2 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 2 Nov 2012 22:34:43 -0700 Subject: [PATCH] Fix clock edge for TX mode. TX data was completely crapped up due to skew on my Jellybean/Lemondrop board. Hopefully, this also applies to Jawbreaker. I'll recheck once I have hardware in-hand. --- firmware/common/sgpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firmware/common/sgpio.c b/firmware/common/sgpio.c index d53c3f87..a4b74c53 100644 --- a/firmware/common/sgpio.c +++ b/firmware/common/sgpio.c @@ -167,6 +167,7 @@ void sgpio_configure( const bool input_slice = (i == 0) && (transceiver_mode == TRANSCEIVER_MODE_RX); const uint_fast8_t concat_order = (input_slice || single_slice) ? 0 : 3; const uint_fast8_t concat_enable = (input_slice || single_slice) ? 0 : 1; + const uint_fast8_t clk_capture_mode = (transceiver_mode == TRANSCEIVER_MODE_RX) ? 1 : 0; SGPIO_MUX_CFG(slice_index) = SGPIO_MUX_CFG_CONCAT_ORDER(concat_order) @@ -185,7 +186,7 @@ void sgpio_configure( | SGPIO_SLICE_MUX_CFG_DATA_CAPTURE_MODE(0) | SGPIO_SLICE_MUX_CFG_INV_OUT_CLK(0) | SGPIO_SLICE_MUX_CFG_CLKGEN_MODE(1) - | SGPIO_SLICE_MUX_CFG_CLK_CAPTURE_MODE(1) + | SGPIO_SLICE_MUX_CFG_CLK_CAPTURE_MODE(clk_capture_mode) | SGPIO_SLICE_MUX_CFG_MATCH_MODE(0) ;