Skip to content

Commit 25101d1

Browse files
committed
Enable input buffers on begin in case they were turned off during end for sequans controller
1 parent f8dcd55 commit 25101d1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/sequans_controller.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ ISR(USART1_DRE_vect) {
472472
void SequansControllerClass::begin(void) {
473473

474474
// PIN SETUP
475-
pinConfigure(TX_PIN, PIN_DIR_OUTPUT);
476-
pinConfigure(RX_PIN, PIN_DIR_INPUT);
475+
pinConfigure(TX_PIN, PIN_DIR_OUTPUT | PIN_INPUT_ENABLE);
476+
pinConfigure(RX_PIN, PIN_DIR_INPUT | PIN_INPUT_ENABLE);
477477

478478
// Request to send (RTS) and clear to send (CTS) are the control lines
479479
// on the UART line. From the configuration the MCU and the LTE modem is
@@ -484,20 +484,22 @@ void SequansControllerClass::begin(void) {
484484
//
485485
// Both pins are active low.
486486

487-
pinConfigure(RTS_PIN, PIN_DIR_OUTPUT);
487+
pinConfigure(RTS_PIN, PIN_DIR_OUTPUT | PIN_INPUT_ENABLE);
488488
digitalWrite(RTS_PIN, HIGH);
489489

490490
// Clear to send is input and we want interrupts on both edges to know
491491
// when the LTE modem has changed the state of the line.
492-
pinConfigure(CTS_PIN, PIN_DIR_INPUT | PIN_PULLUP_ON | PIN_INT_CHANGE);
492+
pinConfigure(CTS_PIN,
493+
PIN_DIR_INPUT | PIN_PULLUP_ON | PIN_INT_CHANGE |
494+
PIN_INPUT_ENABLE);
493495

494496
// We use attach interrupt here instead of the ISR directly as other
495497
// libraries might use the same ISR and we don't want to override it to
496498
// create a linker issue
497499
attachInterrupt(CTS_PIN, CTSInterrupt, CHANGE);
498500

499501
// Set reset low to reset the LTE modem
500-
pinConfigure(RESET_PIN, PIN_DIR_OUTPUT);
502+
pinConfigure(RESET_PIN, PIN_DIR_OUTPUT | PIN_INPUT_ENABLE);
501503
digitalWrite(RESET_PIN, HIGH);
502504
delay(10);
503505
digitalWrite(RESET_PIN, LOW);

0 commit comments

Comments
 (0)