Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Commit

Permalink
set default clock and BitOrder, as same as Arduino Uno
Browse files Browse the repository at this point in the history
  • Loading branch information
baorepo committed May 14, 2019
1 parent 90aba57 commit 9e909f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions libraries/SPI/SPIClass.h
Expand Up @@ -33,17 +33,17 @@
class SPISettings {
public:
SPISettings(uint32_t clock, BitOrder bitOrder, uint8_t dataMode) { init_AlwaysInline(clock, bitOrder, dataMode); }
SPISettings() { init_AlwaysInline(1000000, LSBFIRST, 0); }
SPISettings() { init_AlwaysInline(4000000, MSBFIRST, 0); }

private:
void init_AlwaysInline(uint32_t clock, BitOrder bitOrder, uint8_t dataMode) __attribute__((__always_inline__)) {
_order = bitOrder;
_mode = dataMode;
_clock = clock;
}
BitOrder _order = LSBFIRST;
BitOrder _order = MSBFIRST;
uint8_t _mode = 0;
uint32_t _clock = 1000000;
uint32_t _clock = 4000000;
friend class SPIClass;
};

Expand Down
2 changes: 1 addition & 1 deletion variants/seeed_k210_pi/pins_arduino.h
Expand Up @@ -610,7 +610,7 @@ PinDescription
FUNC_DEBUG0, // PIO_GPIO
FUNC_GPIOHS31, // PIO_GPIOHS
FUNC_DEBUG0, // PIO_I2C
FUNC_DEBUG0, // PIO_SPI
FUNC_SPI0_SS0, // PIO_SPI
FUNC_DEBUG0, // PIO_UART
FUNC_DEBUG0, // PIO_TIMER
FUNC_I2S0_SCLK, // PIO_I2S
Expand Down

0 comments on commit 9e909f5

Please sign in to comment.