mirror of https://github.com/ARMmbed/mbed-os.git
Fix a bug that initialize setting of SPI clock value is not correct.
Modify the value as below. uint16_t mask = 0x000c0; -> uint16_t mask = 0x000c;pull/762/head
parent
dca273e167
commit
a36c4462f2
|
@ -157,7 +157,7 @@ void spi_frequency(spi_t *obj, int hz) {
|
||||||
spi_disable(obj);
|
spi_disable(obj);
|
||||||
const int P1CLK = 66666666; // 66.6666MHz
|
const int P1CLK = 66666666; // 66.6666MHz
|
||||||
uint8_t div, brdv;
|
uint8_t div, brdv;
|
||||||
uint16_t mask = 0x000c0;
|
uint16_t mask = 0x000c;
|
||||||
|
|
||||||
if (hz <= P1CLK/2 && hz >= P1CLK/255) {
|
if (hz <= P1CLK/2 && hz >= P1CLK/255) {
|
||||||
div = (P1CLK / hz / 2) -1;
|
div = (P1CLK / hz / 2) -1;
|
||||||
|
|
Loading…
Reference in New Issue