pebble-dev / RebbleOS

open source operating system for low-power smartwatches
Other
365 stars 38 forks source link

ADC mutex #66

Open ginge opened 6 years ago

ginge commented 6 years ago

In snowy, the ADC is used for multiple things, including ambient light and battery level.

There is no mutex protecting this resource. In fact, there is no common agreed way to talk to ADC

Additionally:

AnotherOctopus commented 6 years ago

So how I interpreted implementing this is bulbing out _adc_init and _read_adc into a new file called snowy_adc.c/h in the snowy directory, and then implementing a new file called adc.c in rcore, which handles the calls to the hardware and handles the mutex. Then an ambient.c and an implemented battery.c make calls to the adc.c for hardware access.