I2C wake part workaround

This commit is contained in:
Ben V. Brown
2022-04-19 17:47:38 +10:00
parent 68a540be17
commit 5853261ddf
3 changed files with 639 additions and 643 deletions

View File

@@ -43,7 +43,7 @@ bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t read_address, uint8_t *p_b
i2cCfg.subAddrSize = 1; // one byte address i2cCfg.subAddrSize = 1; // one byte address
err = I2C_MasterReceiveBlocking(I2C0_ID, &i2cCfg); err = I2C_MasterReceiveBlocking(I2C0_ID, &i2cCfg);
MSG((char *)"I2C Mem_Read %02X - %d - %d\r\n", DevAddress >> 1, err, number_of_byte); // MSG((char *)"I2C Mem_Read %02X - %d - %d\r\n", DevAddress >> 1, err, number_of_byte);
bool res = err == SUCCESS; bool res = err == SUCCESS;
if (!res) { if (!res) {
I2C_Unstick(); I2C_Unstick();
@@ -66,7 +66,7 @@ bool FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress, uint8_t *p_bu
i2cCfg.subAddrSize = 1; // one byte address i2cCfg.subAddrSize = 1; // one byte address
err = I2C_MasterSendBlocking(I2C0_ID, &i2cCfg); err = I2C_MasterSendBlocking(I2C0_ID, &i2cCfg);
MSG((char *)"I2C Mem_Write %02X - %d\r\n", DevAddress >> 1, err); // MSG((char *)"I2C Mem_Write %02X - %d\r\n", DevAddress >> 1, err);
bool res = err == SUCCESS; bool res = err == SUCCESS;
if (!res) { if (!res) {
I2C_Unstick(); I2C_Unstick();
@@ -107,7 +107,6 @@ bool FRToSI2C::writeRegistersBulk(const uint8_t address, const I2C_REG *register
bool FRToSI2C::wakePart(uint16_t DevAddress) { bool FRToSI2C::wakePart(uint16_t DevAddress) {
// wakepart is a special case where only the device address is sent // wakepart is a special case where only the device address is sent
return false; // TODO
if (!lock()) { if (!lock()) {
return false; return false;
@@ -129,6 +128,6 @@ bool FRToSI2C::wakePart(uint16_t DevAddress) {
I2C_Unstick(); I2C_Unstick();
} }
unlock(); unlock();
MSG((char *)"I2C probe done \r\n"); // MSG((char *)"I2C probe done \r\n");
return res; return res;
} }

View File

@@ -896,7 +896,6 @@ void startGUITask(void const *argument) {
for (;;) { for (;;) {
ButtonState buttons = getButtonState(); ButtonState buttons = getButtonState();
MSG((char *)"Buttons %d\r\n", int(buttons));
if (buttons != BUTTON_NONE) { if (buttons != BUTTON_NONE) {
OLED::setDisplayState(OLED::DisplayState::ON); OLED::setDisplayState(OLED::DisplayState::ON);
} }