BV I2C: warn when reset failed
This commit is contained in:
parent
89e53cb378
commit
7488ebd737
|
@ -459,9 +459,14 @@ static bool busvoodoo_i2c_action(const char* action, uint32_t repetition, bool p
|
|||
static void busvoodoo_i2c_command_reset(void* argument)
|
||||
{
|
||||
(void)argument; // we won't use the argument
|
||||
i2c_master_reset(BUSVOODOO_I2C); // reset the I2C peripheral since it might be stuck
|
||||
i2c_master_setup(BUSVOODOO_I2C, busvoodoo_i2c_speed); // re-setup I2C
|
||||
printf("I2C peripheral reset\n");
|
||||
if (!i2c_master_reset(BUSVOODOO_I2C)) { // reset the I2C peripheral since it might be stuck
|
||||
busvoodoo_text_style(BUSVOODOO_TEXT_STYLE_WARNING);
|
||||
printf("reset failed: check the SDA/SCL lines and retry");
|
||||
busvoodoo_text_style(BUSVOODOO_TEXT_STYLE_RESET);
|
||||
} else {
|
||||
i2c_master_setup(BUSVOODOO_I2C, busvoodoo_i2c_speed); // re-setup I2C
|
||||
printf("I2C peripheral reset\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue