diff options
| author | Drashna Jaelre <drashna@live.com> | 2019-12-22 05:50:08 -0800 |
|---|---|---|
| committer | Joel Challis <git@zvecr.com> | 2019-12-22 13:50:08 +0000 |
| commit | 70661645917cc9a8e492abb82828c55cf137b834 (patch) | |
| tree | 1d24f6801e4335e927fdb364f41f3eb7770504a1 /drivers/haptic | |
| parent | 0e2ff9b384fa2ec10d2555ef2e87915f453cecab (diff) | |
| download | qmk_firmware-70661645917cc9a8e492abb82828c55cf137b834.tar.gz qmk_firmware-70661645917cc9a8e492abb82828c55cf137b834.zip | |
Completely remove i2c_transmit_receive function (#7686)
* Add i2c_transmit_receive function
This function is listed in the ARM header file, but doesn't actually exist.
* Remove i2c_transmit_receive function
* Update DRV2605L read function to use i2c_readReg on both arm and avr
Diffstat (limited to 'drivers/haptic')
| -rw-r--r-- | drivers/haptic/DRV2605L.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c index c40731913..830d629da 100644 --- a/drivers/haptic/DRV2605L.c +++ b/drivers/haptic/DRV2605L.c | |||
| @@ -32,16 +32,9 @@ void DRV_write(uint8_t drv_register, uint8_t settings) { | |||
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | uint8_t DRV_read(uint8_t regaddress) { | 34 | uint8_t DRV_read(uint8_t regaddress) { |
| 35 | #ifdef __AVR__ | ||
| 36 | i2c_readReg(DRV2605L_BASE_ADDRESS << 1, regaddress, DRV2605L_read_buffer, 1, 100); | 35 | i2c_readReg(DRV2605L_BASE_ADDRESS << 1, regaddress, DRV2605L_read_buffer, 1, 100); |
| 37 | DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0]; | 36 | DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0]; |
| 38 | #else | 37 | |
| 39 | DRV2605L_tx_register[0] = regaddress; | ||
| 40 | if (MSG_OK != i2c_transmit_receive(DRV2605L_BASE_ADDRESS << 1, DRV2605L_tx_register, 1, DRV2605L_read_buffer, 1)) { | ||
| 41 | printf("err reading reg \n"); | ||
| 42 | } | ||
| 43 | DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0]; | ||
| 44 | #endif | ||
| 45 | return DRV2605L_read_register; | 38 | return DRV2605L_read_register; |
| 46 | } | 39 | } |
| 47 | 40 | ||
| @@ -127,4 +120,4 @@ void DRV_pulse(uint8_t sequence) { | |||
| 127 | DRV_write(DRV_GO, 0x00); | 120 | DRV_write(DRV_GO, 0x00); |
| 128 | DRV_write(DRV_WAVEFORM_SEQ_1, sequence); | 121 | DRV_write(DRV_WAVEFORM_SEQ_1, sequence); |
| 129 | DRV_write(DRV_GO, 0x01); | 122 | DRV_write(DRV_GO, 0x01); |
| 130 | } \ No newline at end of file | 123 | } |
