Skip to content

Commit e9583d6

Browse files
Wire: Rename reset_with_timeout parameter to reset_on_timeout
This parameter was recently added, but the name was not ideal. Renaming it would make it more clear, and also more consistent with the variable it eventually sets and the comments.
1 parent 4f53e51 commit e9583d6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

libraries/Wire/src/Wire.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ void TwoWire::setClock(uint32_t clock)
111111
* the default.
112112
*
113113
* @param timeout a timeout value in microseconds, if zero then timeout checking is disabled
114-
* @param reset_with_timeout if true then TWI interface will be automatically reset on timeout
114+
* @param reset_on_timeout if true then TWI interface will be automatically reset on timeout
115115
* if false then TWI interface will not be reset on timeout
116116
117117
*/
118-
void TwoWire::setWireTimeout(uint32_t timeout, bool reset_with_timeout){
119-
twi_setTimeoutInMicros(timeout, reset_with_timeout);
118+
void TwoWire::setWireTimeout(uint32_t timeout, bool reset_on_timeout){
119+
twi_setTimeoutInMicros(timeout, reset_on_timeout);
120120
}
121121

122122
/***

libraries/Wire/src/Wire.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class TwoWire : public Stream
6262
void begin(int);
6363
void end();
6464
void setClock(uint32_t);
65-
void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false);
65+
void setWireTimeout(uint32_t timeout = 25000, bool reset_on_timeout = false);
6666
bool getWireTimeoutFlag(void);
6767
void clearWireTimeoutFlag(void);
6868
void beginTransmission(uint8_t);

libraries/Wire/src/utility/twi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,13 @@ void twi_releaseBus(void)
451451
* Function twi_setTimeoutInMicros
452452
* Desc set a timeout for while loops that twi might get stuck in
453453
* Input timeout value in microseconds (0 means never time out)
454-
* Input reset_with_timeout: true causes timeout events to reset twi
454+
* Input reset_on_timeout: true causes timeout events to reset twi
455455
* Output none
456456
*/
457-
void twi_setTimeoutInMicros(uint32_t timeout, bool reset_with_timeout){
457+
void twi_setTimeoutInMicros(uint32_t timeout, bool reset_on_timeout){
458458
twi_timed_out_flag = false;
459459
twi_timeout_us = timeout;
460-
twi_do_reset_on_timeout = reset_with_timeout;
460+
twi_do_reset_on_timeout = reset_on_timeout;
461461
}
462462

463463
/*

0 commit comments

Comments
 (0)