Vybhav Kadaba
/
EV-PRO-MW1001_Development_updateFW
Bumped Mbed FW version to 01.20.0080
Diff: src/mbed/admw_gpio.cpp
- Revision:
- 23:bb685f35b08b
- Parent:
- 5:0728bde67bdb
- Child:
- 32:52445bef314d
--- a/src/mbed/admw_gpio.cpp Thu Sep 26 05:56:58 2019 +0000 +++ b/src/mbed/admw_gpio.cpp Thu Sep 26 06:15:39 2019 +0000 @@ -104,19 +104,18 @@ ADMW_GPIO_PIN ePinId, bool *pState) { - switch(ePinId) - { - case ADMW_GPIO_PIN_ALERT_ERROR: - *pState = _alertError; - return ADMW_SUCCESS; - case ADMW_GPIO_PIN_DATAREADY: - *pState = _dataready; - return ADMW_SUCCESS; - case ADMW_GPIO_PIN_RESET: - *pState = _reset; - return ADMW_SUCCESS; - default: - return ADMW_INVALID_DEVICE_NUM; + switch(ePinId) { + case ADMW_GPIO_PIN_ALERT_ERROR: + *pState = _alertError; + return ADMW_SUCCESS; + case ADMW_GPIO_PIN_DATAREADY: + *pState = _dataready; + return ADMW_SUCCESS; + case ADMW_GPIO_PIN_RESET: + *pState = _reset; + return ADMW_SUCCESS; + default: + return ADMW_INVALID_DEVICE_NUM; } } @@ -124,13 +123,12 @@ ADMW_GPIO_PIN ePinId, bool state) { - switch(ePinId) - { - case ADMW_GPIO_PIN_RESET: - _reset = state; - break; - default: - return ADMW_INVALID_DEVICE_NUM; + switch(ePinId) { + case ADMW_GPIO_PIN_RESET: + _reset = state; + break; + default: + return ADMW_INVALID_DEVICE_NUM; } return ADMW_SUCCESS; @@ -141,36 +139,34 @@ ADMW_GPIO_CALLBACK callbackFn, void *pArg) { - switch(ePinId) - { - case ADMW_GPIO_PIN_ALERT_ERROR: - _alertErrorIrqCallback = callbackFn; - _alertErrorIrqArg = pArg; - _alertErrorIrq.rise(callback(this, &GpioContext::_alertErrorIrqHandler)); - return ADMW_SUCCESS; - case ADMW_GPIO_PIN_DATAREADY: - _datareadyIrqCallback = callbackFn; - _datareadyIrqArg = pArg; - _datareadyIrq.rise(callback(this, &GpioContext::_datareadyIrqHandler)); - return ADMW_SUCCESS; - default: - return ADMW_INVALID_DEVICE_NUM; + switch(ePinId) { + case ADMW_GPIO_PIN_ALERT_ERROR: + _alertErrorIrqCallback = callbackFn; + _alertErrorIrqArg = pArg; + _alertErrorIrq.rise(callback(this, &GpioContext::_alertErrorIrqHandler)); + return ADMW_SUCCESS; + case ADMW_GPIO_PIN_DATAREADY: + _datareadyIrqCallback = callbackFn; + _datareadyIrqArg = pArg; + _datareadyIrq.rise(callback(this, &GpioContext::_datareadyIrqHandler)); + return ADMW_SUCCESS; + default: + return ADMW_INVALID_DEVICE_NUM; } } ADMW_RESULT GpioContext::disableIrq( ADMW_GPIO_PIN ePinId) { - switch(ePinId) - { - case ADMW_GPIO_PIN_ALERT_ERROR: - _alertErrorIrq.rise(NULL); - return ADMW_SUCCESS; - case ADMW_GPIO_PIN_DATAREADY: - _datareadyIrq.rise(NULL); - return ADMW_SUCCESS; - default: - return ADMW_INVALID_DEVICE_NUM; + switch(ePinId) { + case ADMW_GPIO_PIN_ALERT_ERROR: + _alertErrorIrq.rise(NULL); + return ADMW_SUCCESS; + case ADMW_GPIO_PIN_DATAREADY: + _datareadyIrq.rise(NULL); + return ADMW_SUCCESS; + default: + return ADMW_INVALID_DEVICE_NUM; } } @@ -188,8 +184,7 @@ GpioContext *pCtx = new GpioContext((PinName)pConfig->resetPin, (PinName)pConfig->alertErrorPin, (PinName)pConfig->datareadyPin); - if (!pCtx) - { + if (!pCtx) { ADMW_LOG_ERROR("Failed to allocate memory for GPIO context"); return ADMW_NO_MEM; }