Skip to content

Commit

Permalink
GSM: use define for RESET and power ON pin
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Nov 10, 2023
1 parent d0dce40 commit 6c87ca1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions libraries/GSM/src/GSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ mbed::CellularDevice *mbed::CellularDevice::get_default_instance()
int arduino::GSMClass::begin(const char* pin, const char* apn, const char* username, const char* password, RadioAccessTechnologyType rat, uint32_t band, bool restart) {

if(restart || isCmuxEnable()) {
pinMode(PJ_10, OUTPUT);
digitalWrite(PJ_10, HIGH);
pinMode(MBED_CONF_GEMALTO_CINTERION_RST, OUTPUT);
digitalWrite(MBED_CONF_GEMALTO_CINTERION_RST, HIGH);
delay(800);
digitalWrite(PJ_10, LOW);
pinMode(PJ_7, OUTPUT);
digitalWrite(PJ_7, LOW);
digitalWrite(MBED_CONF_GEMALTO_CINTERION_RST, LOW);
pinMode(MBED_CONF_GEMALTO_CINTERION_ON, OUTPUT);
digitalWrite(MBED_CONF_GEMALTO_CINTERION_ON, LOW);
delay(1);
digitalWrite(PJ_7, HIGH);
digitalWrite(MBED_CONF_GEMALTO_CINTERION_ON, HIGH);
delay(1);
// this timer is to make sure that at boottime and when the CMUX is used,
// ^SYSTART is received in time to avoid stranger behaviour
Expand All @@ -69,7 +69,7 @@ int arduino::GSMClass::begin(const char* pin, const char* apn, const char* usern
printf("Invalid context\n");
return 0;
}
pinMode(PJ_7, INPUT_PULLDOWN);
pinMode(MBED_CONF_GEMALTO_CINTERION_ON, INPUT_PULLDOWN);

static mbed::DigitalOut rts(MBED_CONF_GEMALTO_CINTERION_RTS, 0);

Expand Down
2 changes: 2 additions & 0 deletions libraries/GSM/src/GSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#define MBED_CONF_GEMALTO_CINTERION_RX PI_9
#define MBED_CONF_GEMALTO_CINTERION_RTS PI_10
#define MBED_CONF_GEMALTO_CINTERION_CTS PI_13
#define MBED_CONF_GEMALTO_CINTERION_RST PJ_10
#define MBED_CONF_GEMALTO_CINTERION_ON PJ_7
#define MBED_CONF_APP_SOCK_TYPE 1

#if defined __has_include
Expand Down

0 comments on commit 6c87ca1

Please sign in to comment.