diff options
| author | James Young <xxiinophobia@yahoo.com> | 2020-02-29 12:00:00 -0800 |
|---|---|---|
| committer | James Young <xxiinophobia@yahoo.com> | 2020-02-29 11:59:30 -0800 |
| commit | 26eef35f07698d23aafae90e1c230b52e100a334 (patch) | |
| tree | eb8e43fc58ca55788e6e89430af0db55ea79e324 /drivers/arm | |
| parent | 85041ff05bf0e5f4ff4535caf6e638491a5614c8 (diff) | |
| download | qmk_firmware-26eef35f07698d23aafae90e1c230b52e100a334.tar.gz qmk_firmware-26eef35f07698d23aafae90e1c230b52e100a334.zip | |
2020 February 29 Breaking Changes Update (#8064)
Diffstat (limited to 'drivers/arm')
| -rw-r--r-- | drivers/arm/i2c_master.c | 8 | ||||
| -rw-r--r-- | drivers/arm/ws2812_spi.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c index 21aefd497..ede915fa4 100644 --- a/drivers/arm/i2c_master.c +++ b/drivers/arm/i2c_master.c | |||
| @@ -79,14 +79,14 @@ i2c_status_t i2c_start(uint8_t address) { | |||
| 79 | i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) { | 79 | i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) { |
| 80 | i2c_address = address; | 80 | i2c_address = address; |
| 81 | i2cStart(&I2C_DRIVER, &i2cconfig); | 81 | i2cStart(&I2C_DRIVER, &i2cconfig); |
| 82 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); | 82 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, TIME_MS2I(timeout)); |
| 83 | return chibios_to_qmk(&status); | 83 | return chibios_to_qmk(&status); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) { | 86 | i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) { |
| 87 | i2c_address = address; | 87 | i2c_address = address; |
| 88 | i2cStart(&I2C_DRIVER, &i2cconfig); | 88 | i2cStart(&I2C_DRIVER, &i2cconfig); |
| 89 | msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); | 89 | msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, TIME_MS2I(timeout)); |
| 90 | return chibios_to_qmk(&status); | 90 | return chibios_to_qmk(&status); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| @@ -100,14 +100,14 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, | |||
| 100 | } | 100 | } |
| 101 | complete_packet[0] = regaddr; | 101 | complete_packet[0] = regaddr; |
| 102 | 102 | ||
| 103 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); | 103 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, TIME_MS2I(timeout)); |
| 104 | return chibios_to_qmk(&status); | 104 | return chibios_to_qmk(&status); |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { | 107 | i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { |
| 108 | i2c_address = devaddr; | 108 | i2c_address = devaddr; |
| 109 | i2cStart(&I2C_DRIVER, &i2cconfig); | 109 | i2cStart(&I2C_DRIVER, &i2cconfig); |
| 110 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), ®addr, 1, data, length, MS2ST(timeout)); | 110 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), ®addr, 1, data, length, TIME_MS2I(timeout)); |
| 111 | return chibios_to_qmk(&status); | 111 | return chibios_to_qmk(&status); |
| 112 | } | 112 | } |
| 113 | 113 | ||
diff --git a/drivers/arm/ws2812_spi.c b/drivers/arm/ws2812_spi.c index 0e954ec50..36e08e39e 100644 --- a/drivers/arm/ws2812_spi.c +++ b/drivers/arm/ws2812_spi.c | |||
| @@ -60,7 +60,7 @@ void ws2812_init(void) { | |||
| 60 | 60 | ||
| 61 | // TODO: more dynamic baudrate | 61 | // TODO: more dynamic baudrate |
| 62 | static const SPIConfig spicfg = { | 62 | static const SPIConfig spicfg = { |
| 63 | NULL, PAL_PORT(RGB_DI_PIN), PAL_PAD(RGB_DI_PIN), | 63 | 0, NULL, PAL_PORT(RGB_DI_PIN), PAL_PAD(RGB_DI_PIN), |
| 64 | SPI_CR1_BR_1 | SPI_CR1_BR_0 // baudrate : fpclk / 8 => 1tick is 0.32us (2.25 MHz) | 64 | SPI_CR1_BR_1 | SPI_CR1_BR_0 // baudrate : fpclk / 8 => 1tick is 0.32us (2.25 MHz) |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
