mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Thu Nov 05 09:00:10 2015 +0000
Parent:
16:75201d1ad908
Child:
18:da299f395b9e
Commit message:
Synchronized with git revision c7fe39e4bcf7ba034b03db7a59d164b8b2d706b2

Full URL: https://github.com/mbedmicro/mbed/commit/c7fe39e4bcf7ba034b03db7a59d164b8b2d706b2/

Fix analogin checking the wrong flag for completion

Changed in this revision

targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/analogin_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/analogin_api.c	Thu Nov 05 08:45:09 2015 +0000
+++ b/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/analogin_api.c	Thu Nov 05 09:00:10 2015 +0000
@@ -65,8 +65,10 @@
 {
     NRF_ADC->CONFIG     &= ~ADC_CONFIG_PSEL_Msk;
     NRF_ADC->CONFIG     |= obj->adc_pin << ADC_CONFIG_PSEL_Pos;
+    NRF_ADC->EVENTS_END  = 0;
     NRF_ADC->TASKS_START = 1;
-    while (((NRF_ADC->BUSY & ADC_BUSY_BUSY_Msk) >> ADC_BUSY_BUSY_Pos) == ADC_BUSY_BUSY_Busy) {
+
+    while (!NRF_ADC->EVENTS_END) {
     }
 
     return (uint16_t)NRF_ADC->RESULT; // 10 bit