Skip to content

Commit 0c7dfbf

Browse files
authored
Merge pull request #223 from juanjole/master
New 'end' function in 'softSerial' to ensure low power consumption.
2 parents 81caedf + 7377f88 commit 0c7dfbf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

libraries/Basics/src/softSerial.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ void softSerial::begin(uint16_t Baudrate)
9595
digitalWrite(TX_GPIO,HIGH);
9696
}
9797

98+
void softSerial::end()
99+
{
100+
digitalWrite(TX_GPIO, LOW);
101+
detachInterrupt(RX_GPIO);
102+
}
103+
98104
int softSerial::available(void)
99105
{
100106
if(IRREC_RX_CNT){

libraries/Basics/src/softSerial.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ uint8_t pbuffer;
1414
~softSerial() {}
1515

1616
void begin(uint16_t Baudrate);
17+
void end();
1718

1819
void sendByte(uint8_t value);
1920
void sendStr(uint8_t *st, uint16_t len);

0 commit comments

Comments
 (0)