|
1 | 1 | // I2C Driver for Arduino
|
2 | 2 | #if defined(ARDUINO) && !AUDIO_DRIVER_FORCE_IDF
|
3 | 3 |
|
4 |
| -#include "Platforms/API_I2C.h" |
5 |
| - |
6 | 4 | #include <Wire.h>
|
7 | 5 | #include <assert.h>
|
8 | 6 | #include <stdio.h>
|
9 | 7 |
|
| 8 | +#include "Platforms/API_I2C.h" |
10 | 9 |
|
11 | 10 | error_t i2c_bus_create(struct I2CConfig *config) {
|
12 |
| - assert(config!=nullptr); |
| 11 | + assert(config != nullptr); |
13 | 12 | I2CConfig &pins = *config;
|
14 |
| - TwoWire *p_wire = (TwoWire*) pins.p_wire; |
| 13 | + TwoWire *p_wire = (TwoWire *)pins.p_wire; |
15 | 14 | assert(p_wire != nullptr);
|
16 | 15 |
|
17 | 16 | // if no pins are defined, just call begin
|
@@ -51,10 +50,8 @@ void i2c_bus_delete(i2c_bus_handle_t bus) {
|
51 | 50 | // this method is used !
|
52 | 51 | error_t i2c_bus_write_bytes(i2c_bus_handle_t bus, int addr, uint8_t *reg,
|
53 | 52 | int reglen, uint8_t *data, int datalen) {
|
54 |
| - AD_LOGD( |
55 |
| - "i2c_bus_write_bytes: addr=0x%X reglen=%d datalen=%d - reg=0x%0X " |
56 |
| - "value=0x%0X", |
57 |
| - addr, reglen, datalen, reg[0], data[0]); |
| 53 | + AD_LOGD("i2c_bus_write_bytes: addr=0x%X reglen=%d datalen=%d - reg=0x%0X ", |
| 54 | + addr, reglen, datalen, reg[0]); |
58 | 55 | TwoWire *p_wire = (TwoWire *)bus;
|
59 | 56 | assert(p_wire != nullptr);
|
60 | 57 | int result = RESULT_OK;
|
|
0 commit comments