Skip to content

Commit d95479a

Browse files
committed
Fixing history - part 2
1 parent b73ac79 commit d95479a

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

drivers/source/AnalogIn.cpp renamed to drivers/source/DigitalIn.cpp

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,17 @@
1515
* limitations under the License.
1616
*/
1717

18-
#include "drivers/AnalogIn.h"
18+
#include "drivers/DigitalIn.h"
1919

20-
#if DEVICE_ANALOGIN
20+
#include "platform/mbed_critical.h"
2121

2222
namespace mbed {
2323

24-
SingletonPtr<PlatformMutex> AnalogIn::_mutex;
25-
26-
AnalogIn::AnalogIn(PinName pin)
27-
{
28-
lock();
29-
analogin_init(&_adc, pin);
30-
unlock();
31-
}
32-
33-
float AnalogIn::read()
24+
void DigitalIn::mode(PinMode pull)
3425
{
35-
lock();
36-
float ret = analogin_read(&_adc);
37-
unlock();
38-
return ret;
39-
}
40-
41-
unsigned short AnalogIn::read_u16()
42-
{
43-
lock();
44-
unsigned short ret = analogin_read_u16(&_adc);
45-
unlock();
46-
return ret;
26+
core_util_critical_section_enter();
27+
gpio_mode(&gpio, pull);
28+
core_util_critical_section_exit();
4729
}
4830

4931
} // namespace mbed
50-
51-
#endif

0 commit comments

Comments
 (0)