Private
Public Access
2
0

mraa: Remove global advance_func struct and place it in platform configuration

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2015-09-03 15:28:36 +01:00
parent fc55088c03
commit 07343e2ee7
19 changed files with 277 additions and 179 deletions

View File

@@ -160,16 +160,16 @@ mraa_intel_galileo_rev_d()
b->pwm_max_period = 7968;
b->pwm_min_period = 1;
mraa_adv_func_t* advance_func = (mraa_adv_func_t*) calloc(1, sizeof(mraa_adv_func_t));
if (advance_func == NULL) {
b->adv_func = (mraa_adv_func_t*) calloc(1, sizeof(mraa_adv_func_t));
if (b->adv_func == NULL) {
return NULL;
}
advance_func->gpio_mmap_setup = &mraa_intel_galileo_g1_mmap_setup;
advance_func->spi_lsbmode_replace = &mraa_intel_galileo_g1_spi_lsbmode_replace;
b->adv_func = advance_func;
b->adv_func->gpio_mmap_setup = &mraa_intel_galileo_g1_mmap_setup;
b->adv_func->spi_lsbmode_replace = &mraa_intel_galileo_g1_spi_lsbmode_replace;
b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * MRAA_INTEL_GALILEO_REV_D_PINCOUNT);
if (b->pins == NULL) {
free(b->adv_func);
goto error;
}