Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aio: Fix setting adc bits when initializing #1103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/aio/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include "aio.h"
#include "mraa_internal.h"

#define DEFAULT_BITS 10

static int raw_bits;
static unsigned int shifter_value;
static float max_analog_value;
Expand Down Expand Up @@ -133,7 +131,7 @@ mraa_aio_init(unsigned int aio)
}

raw_bits = mraa_adc_raw_bits();
mraa_aio_set_bit(dev, DEFAULT_BITS);
mraa_aio_set_bit(dev, raw_bits);

if (IS_FUNC_DEFINED(dev, aio_init_pre)) {
mraa_result_t pre_ret = (dev->advance_func->aio_init_pre(aio));
Expand Down