Private
Public Access
2
0

maa: change the linking of maa and make gpio functions match maa_ spec

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-04-27 23:11:31 +01:00
parent a28d538321
commit ed0a1f6085
14 changed files with 79 additions and 57 deletions

View File

@@ -91,10 +91,13 @@ maa_pwm_get_duty(pwm_t* dev)
fseek(dev->duty_fp, SEEK_SET, 0);
return atoi(output);
}
int
maa_result_t
maa_pwm_init(pwm_t* dev, int chipin, int pin)
{
dev = malloc(sizeof *dev);
if (!dev)
return MAA_ERROR_NO_RESOURCES;
dev->chipid = chipin;
dev->pin = pin;
@@ -104,13 +107,14 @@ maa_pwm_init(pwm_t* dev, int chipin, int pin)
if ((export_f = fopen(buffer, "w")) == NULL) {
fprintf(stderr, "Failed to open export for writing!\n");
return MAA_ERROR_INVALID_HANDLE;
} else {
fprintf(export_f, "%d", dev->pin);
fclose(export_f);
maa_pwm_setup_duty_fp(dev);
}
return 0;
return MAA_SUCCESS;
}
void