Skip to content

Commit 80c2554

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 d739b3f commit 80c2554

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
@@ -109,12 +109,12 @@ void TwoWire::setClock(uint32_t clock)
109109
* the default.
110110
*
111111
* @param timeout a timeout value in microseconds, if zero then timeout checking is disabled
112-
* @param reset_with_timeout if true then TWI interface will be automatically reset on timeout
112+
* @param reset_on_timeout if true then TWI interface will be automatically reset on timeout
113113
* if false then TWI interface will not be reset on timeout
114114
115115
*/
116-
void TwoWire::setWireTimeout(uint32_t timeout, bool reset_with_timeout){
117-
twi_setTimeoutInMicros(timeout, reset_with_timeout);
116+
void TwoWire::setWireTimeout(uint32_t timeout, bool reset_on_timeout){
117+
twi_setTimeoutInMicros(timeout, reset_on_timeout);
118118
}
119119

120120
/***

libraries/Wire/src/Wire.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class TwoWire : public Stream
6363
void begin(int);
6464
void end();
6565
void setClock(uint32_t);
66-
void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false);
66+
void setWireTimeout(uint32_t timeout = 25000, bool reset_on_timeout = false);
6767
bool getWireTimeoutFlag(void);
6868
void clearWireTimeoutFlag(void);
6969
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)