From 2938bbd11fb1879f198f2bf9e1b6458e047050f3 Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 14 Nov 2016 01:01:53 +0100 Subject: [PATCH] This function appears to be borked on New 3DS --- source/i2c.c | 25 ------------------------- source/i2c.h | 1 - source/utils.c | 1 - 3 files changed, 27 deletions(-) diff --git a/source/i2c.c b/source/i2c.c index 8b7c250..3367034 100644 --- a/source/i2c.c +++ b/source/i2c.c @@ -115,31 +115,6 @@ static bool i2cSelectRegister(u8 bus_id, u8 reg) //----------------------------------------------------------------------------- -u8 i2cReadRegister(u8 dev_id, u8 reg) -{ - u8 bus_id = i2cGetDeviceBusId(dev_id), - dev_addr = i2cGetDeviceRegAddr(dev_id); - - for(u32 i = 0; i < 8; i++) - { - if(i2cSelectDevice(bus_id, dev_addr) && i2cSelectRegister(bus_id, reg)) - { - if(i2cSelectDevice(bus_id, dev_addr | 1)) - { - i2cWaitBusy(bus_id); - i2cStop(bus_id, 1); - i2cWaitBusy(bus_id); - - return *i2cGetDataReg(bus_id); - } - } - *i2cGetCntReg(bus_id) = 0xC5; - i2cWaitBusy(bus_id); - } - - return 0xFF; -} - bool i2cWriteRegister(u8 dev_id, u8 reg, u8 data) { u8 bus_id = i2cGetDeviceBusId(dev_id), diff --git a/source/i2c.h b/source/i2c.h index f00a301..0099d61 100644 --- a/source/i2c.h +++ b/source/i2c.h @@ -41,5 +41,4 @@ #define I2C_DEV_GYRO 10 #define I2C_DEV_IR 13 -u8 i2cReadRegister(u8 dev_id, u8 reg); bool i2cWriteRegister(u8 dev_id, u8 reg, u8 data); \ No newline at end of file diff --git a/source/utils.c b/source/utils.c index 60af492..30fd1c4 100644 --- a/source/utils.c +++ b/source/utils.c @@ -50,7 +50,6 @@ u32 waitInput(bool isMenu) if(!key) { - if(i2cReadRegister(I2C_DEV_MCU, 0x10) == 1) mcuPowerOff(); oldKey = key; dPadDelay = 0; }