mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/hal/TARGET_STM/TARGET_DISCO_F100RB/analogin_api.c
- Revision:
- 227:7bd0639b8911
- Parent:
- 126:549ba18ddd81
diff -r b062af740e40 -r 7bd0639b8911 targets/hal/TARGET_STM/TARGET_DISCO_F100RB/analogin_api.c --- a/targets/hal/TARGET_STM/TARGET_DISCO_F100RB/analogin_api.c Wed Jun 11 09:45:09 2014 +0100 +++ b/targets/hal/TARGET_STM/TARGET_DISCO_F100RB/analogin_api.c Wed Jun 11 16:00:09 2014 +0100 @@ -25,6 +25,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "mbed_assert.h" #include "analogin_api.h" #include "wait_api.h" @@ -32,7 +33,6 @@ #include "cmsis.h" #include "pinmap.h" -#include "error.h" static const PinMap PinMap_ADC[] = { {PA_0, ADC_1, STM_PIN_DATA(GPIO_Mode_AIN, 0)}, @@ -53,10 +53,7 @@ // Get the peripheral name (ADC_1, ADC_2...) from the pin and assign it to the object obj->adc = (ADCName)pinmap_peripheral(pin, PinMap_ADC); - - if (obj->adc == (ADCName)NC) { - error("ADC pin mapping failed"); - } + MBED_ASSERT(obj->adc != (ADCName)NC); // Configure GPIO pinmap_pinout(pin, PinMap_ADC); @@ -91,7 +88,7 @@ ADC_ResetCalibration(adc); while(ADC_GetResetCalibrationStatus(adc)); ADC_StartCalibration(adc); - while(ADC_GetCalibrationStatus(adc)); + while(ADC_GetCalibrationStatus(adc)); } }