Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
multiplemonomials committed Feb 6, 2024
1 parent 3e199dd commit ae36995
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void ONBOARD_SARA4_PPP::onboard_modem_deinit()
void ONBOARD_SARA4_PPP::onboard_modem_power_up()
{
// Make sure the radio is initialized so it can be powered on.
if (!initialized){
if (!initialized) {
onboard_modem_init();
}

Expand All @@ -129,7 +129,7 @@ void ONBOARD_SARA4_PPP::onboard_modem_power_up()
uint8_t retries = 5;
do {
// If it hasn't turned on after multiple tries, exit and return.
if(0 == retries--) {
if (0 == retries--) {
return;
}
// Activate PWR_ON for 150ms-3.2s to switch on. Reference ublox SARA-R4 data sheet.
Expand All @@ -153,7 +153,7 @@ void ONBOARD_SARA4_PPP::onboard_modem_power_down()
}

// Make sure the I/O are properly initialized.
if (!initialized){
if (!initialized) {
onboard_modem_init();
}
// Activate PWR_ON for at least 1.5s to switch off. Reference ublox SARA-R4 data sheet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ void ONBOARD_QUECTEL_EG25::onboard_modem_power_up()
{
// NET_STATUS = input. InterruptIn make LS LED follow.
// LS_LED = output. Follow NET_STATUS.
net_status->rise(callback(this,&ONBOARD_QUECTEL_EG25::link_status));
net_status->fall(callback(this,&ONBOARD_QUECTEL_EG25::link_status));
net_status->rise(callback(this, &ONBOARD_QUECTEL_EG25::link_status));
net_status->fall(callback(this, &ONBOARD_QUECTEL_EG25::link_status));

// Make sure the radio is initialized so it can be powered on.
if (!initialized){
if (!initialized) {
onboard_modem_init();
}

Expand All @@ -152,7 +152,7 @@ void ONBOARD_QUECTEL_EG25::onboard_modem_power_up()
do {
thread_sleep_for(1000);
radio_off = gpio_read(&status);
if(!timeout--){
if (!timeout--) {
press_power_button(550000);
timeout = 10;
}
Expand Down Expand Up @@ -186,7 +186,7 @@ void ONBOARD_QUECTEL_EG25::onboard_modem_power_down()
}

// Make sure the I/O are properly initialized.
if (!initialized){
if (!initialized) {
onboard_modem_init();
}

Expand All @@ -202,12 +202,10 @@ void ONBOARD_QUECTEL_EG25::onboard_modem_power_down()

if (radio_off) {
break;
}
else {
} else {
onboard_modem_reset();
}
}
while (!radio_off);
} while (!radio_off);
}

void ONBOARD_QUECTEL_EG25::onboard_modem_reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class ONBOARD_QUECTEL_EG25 : public QUECTEL_EC2X {

private:
uint8_t initialized;
DigitalOut* ls;
InterruptIn* net_status;
DigitalOut *ls;
InterruptIn *net_status;
void link_status();
void press_power_button(int time_ms);
void onboard_modem_init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ void ONBOARD_TELIT_HE910::power_up()
// Do nothing if it's already powered.
if (gpio_read(&radioOn)) {
return;
}
else {
} else {
// power it up.
release_power_button();
}
Expand All @@ -107,12 +106,11 @@ void ONBOARD_TELIT_HE910::power_down()
// Do nothing if it's already off.
if (!gpio_read(&radioOn)) {
return;
}
else {
} else {
// power down.
press_power_button();
}

// wait a max of 60s for 1.8v to go low.
volatile int v1_8 = 1;
uint8_t timeout = 60;
Expand Down

0 comments on commit ae36995

Please sign in to comment.