diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-09-30 21:34:50 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-09-30 21:34:50 +0200 |
commit | 5e7af0cc485557864373c2396b57431250d7b1b0 (patch) | |
tree | db1a06697f2b7008dc5b16da5b620a97b527de49 /src/arch | |
parent | 1249920a6c7094f923e77f7d2131978e19604396 (diff) |
arduino-nano spi: add missing counter variable initializr
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arduino-nano/driver/spi.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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) { |