Commit 977dd936 authored by Markéta Jedličková's avatar Markéta Jedličková
Browse files

UcgLib update

parent 22ddf4a7
......@@ -1199,11 +1199,9 @@ static int16_t ucg_com_arduino_4wire_HW_SPI(ucg_t *ucg, int16_t msg, uint16_t ar
/* setup Arduino SPI */
#if ARDUINO >= 10600
SPI.usingInterrupt(ucg->pin_list[UCG_PIN_CS]);
SPI.begin();
SPI.beginTransaction(SPISettings(1000000000UL/((ucg_com_info_t *)data)->serial_clk_speed, MSBFIRST, SPI_MODE0));
#else
SPI.begin();
if ( ((ucg_com_info_t *)data)->serial_clk_speed/2 < 70 )
SPI.setClockDivider( SPI_CLOCK_DIV2 );
......@@ -1213,17 +1211,12 @@ static int16_t ucg_com_arduino_4wire_HW_SPI(ucg_t *ucg, int16_t msg, uint16_t ar
SPI.setClockDivider( SPI_CLOCK_DIV8 );
SPI.setDataMode(SPI_MODE0);
SPI.setBitOrder(MSBFIRST);
#endif
break;
case UCG_COM_MSG_POWER_DOWN:
#if ARDUINO >= 10600
SPI.endTransaction();
SPI.end();
#else
SPI.end();
#endif
break;
case UCG_COM_MSG_DELAY:
delayMicroseconds(arg);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment