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) {
51
51
// Main Mode
52
52
master = true ;
53
53
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)
55
55
| ((uint32_t )GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos)
56
56
| ((uint32_t )GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos)
57
57
| ((uint32_t )GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos)
58
58
| ((uint32_t )GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos);
59
59
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)
61
61
| ((uint32_t )GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos)
62
62
| ((uint32_t )GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos)
63
63
| ((uint32_t )GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos)
@@ -218,6 +218,8 @@ uint8_t TwoWire::endTransmission(bool stopBit)
218
218
// Start I2C transmission
219
219
_p_twim->ADDRESS = txAddress;
220
220
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 ;
221
223
_p_twim->TASKS_RESUME = 0x1UL ;
222
224
223
225
_p_twim->TXD .PTR = (uint32_t )txBuffer._aucBuffer ;
You can’t perform that action at this time.
0 commit comments