File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,13 @@ void TwoWire::begin(void) {
5151 // Main Mode
5252 master = true ;
5353
54- *pincfg_reg (_uc_pinSCL) = ((uint32_t )GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos)
54+ *pincfg_reg (_uc_pinSCL) = ((uint32_t )GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos)
5555 | ((uint32_t )GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos)
5656 | ((uint32_t )GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos)
5757 | ((uint32_t )GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos)
5858 | ((uint32_t )GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos);
5959
60- *pincfg_reg (_uc_pinSDA) = ((uint32_t )GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos)
60+ *pincfg_reg (_uc_pinSDA) = ((uint32_t )GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos)
6161 | ((uint32_t )GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos)
6262 | ((uint32_t )GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos)
6363 | ((uint32_t )GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos)
@@ -218,6 +218,8 @@ uint8_t TwoWire::endTransmission(bool stopBit)
218218 // Start I2C transmission
219219 _p_twim->ADDRESS = txAddress;
220220
221+ // just in case twi is stopped by bus error such as secondary device reset/stalled without replying ACK/NACK
222+ _p_twim->EVENTS_STOPPED = 0x0UL ;
221223 _p_twim->TASKS_RESUME = 0x1UL ;
222224
223225 _p_twim->TXD .PTR = (uint32_t )txBuffer._aucBuffer ;
You can’t perform that action at this time.
0 commit comments