From 6f12a41cc6fc61d62bfd862f454e63b0652823fc Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 12 Jun 2017 13:03:18 +0200 Subject: Add resistor calculation script --- fw/main.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'fw') diff --git a/fw/main.c b/fw/main.c index 6113a10..2e7b56e 100644 --- a/fw/main.c +++ b/fw/main.c @@ -74,32 +74,32 @@ int main(void) { SPI1->CR2 &= ~SPI_CR2_DS_Msk; SPI1->CR2 |= LL_SPI_DATAWIDTH_16BIT; /* FIXME maybe try w/o BIDI */ - SPI1->CR1 = SPI_CR1_BIDIMODE | SPI_CR1_BIDIOE | SPI_CR1_SSM | SPI_CR1_SSI | SPI_CR1_SPE | (1<CR1 = SPI_CR1_BIDIMODE | SPI_CR1_BIDIOE | SPI_CR1_SSM | SPI_CR1_SSI | SPI_CR1_SPE | (0<BSRR = GPIO_BSRR_BR_6; + int j = 0; + int bval = 0x4000; while (42) { - if (i == 8) { - i = 0; - val = ~val; + for (int i=0; i<8; i++) { + spi_send(val); + spi_send(val); + strobe_leds(); + spi_send(0x0200 | bval | (0xff^(1<