diff options
author | QMK Bot <hello@qmk.fm> | 2021-11-17 12:28:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 07:28:38 +1100 |
commit | 2c5d66987da4c7d5857cab8b09c4f852b4d8e4d9 (patch) | |
tree | 3ddc4f2cc572c632a0027d31d6e3e86af03591bc /drivers/sensors/adns5050.c | |
parent | b06740c933c63a8f82e0a7112f9eeab9bd93687a (diff) |
Format code according to conventions (#15193)
Diffstat (limited to 'drivers/sensors/adns5050.c')
-rw-r--r-- | drivers/sensors/adns5050.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/sensors/adns5050.c b/drivers/sensors/adns5050.c index e7273977d5..254ef2ee87 100644 --- a/drivers/sensors/adns5050.c +++ b/drivers/sensors/adns5050.c @@ -17,7 +17,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - #include "adns5050.h" #include "wait.h" #include "debug.h" @@ -61,13 +60,9 @@ void adns_sync(void) { writePinHigh(ADNS_CS_PIN); } -void adns_cs_select(void) { - writePinLow(ADNS_CS_PIN); -} +void adns_cs_select(void) { writePinLow(ADNS_CS_PIN); } -void adns_cs_deselect(void) { - writePinHigh(ADNS_CS_PIN); -} +void adns_cs_deselect(void) { writePinHigh(ADNS_CS_PIN); } uint8_t adns_serial_read(void) { setPinInput(ADNS_SDIO_PIN); @@ -121,7 +116,7 @@ uint8_t adns_read_reg(uint8_t reg_addr) { // We don't need a minimum tSRAD here. That's because a 4ms wait time is // already included in adns_serial_write(), so we're good. // See page 10 and 15 of the ADNS spec sheet. - //wait_us(4); + // wait_us(4); uint8_t byte = adns_serial_read(); @@ -138,7 +133,7 @@ uint8_t adns_read_reg(uint8_t reg_addr) { void adns_write_reg(uint8_t reg_addr, uint8_t data) { adns_cs_select(); - adns_serial_write( 0b10000000 | reg_addr ); + adns_serial_write(0b10000000 | reg_addr); adns_serial_write(data); adns_cs_deselect(); } @@ -155,7 +150,7 @@ report_adns_t adns_read_burst(void) { // We don't need a minimum tSRAD here. That's because a 4ms wait time is // already included in adns_serial_write(), so we're good. // See page 10 and 15 of the ADNS spec sheet. - //wait_us(4); + // wait_us(4); uint8_t x = adns_serial_read(); uint8_t y = adns_serial_read(); @@ -180,13 +175,11 @@ int8_t convert_twoscomp(uint8_t data) { } // Don't forget to use the definitions for CPI in the header file. -void adns_set_cpi(uint8_t cpi) { - adns_write_reg(REG_MOUSE_CONTROL2, cpi); -} +void adns_set_cpi(uint8_t cpi) { adns_write_reg(REG_MOUSE_CONTROL2, cpi); } bool adns_check_signature(void) { - uint8_t pid = adns_read_reg(REG_PRODUCT_ID); - uint8_t rid = adns_read_reg(REG_REVISION_ID); + uint8_t pid = adns_read_reg(REG_PRODUCT_ID); + uint8_t rid = adns_read_reg(REG_REVISION_ID); uint8_t pid2 = adns_read_reg(REG_PRODUCT_ID2); return (pid == 0x12 && rid == 0x01 && pid2 == 0x26); |