From 5e7af0cc485557864373c2396b57431250d7b1b0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 30 Sep 2021 21:34:50 +0200 Subject: arduino-nano spi: add missing counter variable initializr --- src/arch/arduino-nano/driver/spi.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/arch/arduino-nano/driver') diff --git a/src/arch/arduino-nano/driver/spi.cc b/src/arch/arduino-nano/driver/spi.cc index 2ba93cb..bef218c 100644 --- a/src/arch/arduino-nano/driver/spi.cc +++ b/src/arch/arduino-nano/driver/spi.cc @@ -12,6 +12,7 @@ signed char SPI::setup() { // configure SS as output to avoid unintened switches to slave mode gpio.output(GPIO::pb2, 0); + // TODO configure MOSI and SCK as output // up to 1 MHz SPI clock #if F_CPU == 16000000UL SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR0); @@ -26,7 +27,7 @@ signed char SPI::xmit( unsigned char tx_len, unsigned char *tx_buf, unsigned char rx_len, unsigned char *rx_buf) { - unsigned char i; + unsigned char i = 0; while ((i < tx_len) || (i < rx_len)) { if (i < tx_len) { -- cgit v1.2.3