Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
Fix to cellular power on: not having a PWR_ON pin not an error. (#1192)
Browse files Browse the repository at this point in the history
The static function modulePwrOnPinControl() in u_cell_pwr.c was constructed such that it would return an error if nothing is connected to a cellular module's PWR_ON pin: not having a connection to PWR_ON is perfectly valid (this is the case when a module is driven from a Windows machine that has no concept of GPIOs), hence the function is updated to return success (and do nothing) if there is no PWR_ON pin.
  • Loading branch information
RobMeades authored Jul 5, 2024
1 parent 66b6b71 commit dcd6db3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cell/src/u_cell_pwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,12 +1331,13 @@ static uCellModuleType_t identifyCellModuleType(uDeviceHandle_t cellHandle)
static int32_t modulePwrOnPinControl(uCellPrivateInstance_t *pInstance,
bool (*pKeepGoingCallback) (uDeviceHandle_t))
{
int32_t errorCode = (int32_t) U_ERROR_COMMON_PLATFORM;
int32_t errorCode = (int32_t) U_ERROR_COMMON_SUCCESS;
int32_t platformError = 0;
uDeviceHandle_t cellHandle = pInstance->cellHandle;

// Check if the PWR_ON pin is available.
if (pInstance->pinPwrOn >= 0) {
errorCode = (int32_t) U_ERROR_COMMON_PLATFORM;
// if the powerOnPullMs is non-negative, it means
// that we are not going to have retries in the power-
// cycle of the module.
Expand Down

0 comments on commit dcd6db3

Please sign in to comment.