Private
Public Access
2
0

maa: change struct names to be more unique and fix allocs

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-04-28 11:31:53 +01:00
parent 00fd42b186
commit f280b3c0f6
9 changed files with 125 additions and 128 deletions

View File

@@ -29,21 +29,24 @@
int
main ()
{
pwm_t pwm;
maa_pwm_init(&pwm, 0, 3);
maa_pwm_period_us(&pwm, 200);
maa_pwm_enable(&pwm, 1);
maa_pwm_context* pwm;
pwm = maa_pwm_init(0, 3);
if (pwm == NULL) {
return 1;
}
maa_pwm_period_us(pwm, 200);
maa_pwm_enable(pwm, 1);
float value = 0.0f;
while(1) {
while (1) {
value = value + 0.01f;
maa_pwm_write(&pwm, value);
maa_pwm_write(pwm, value);
usleep(50000);
if (value >= 1.0f) {
value = 0.0f;
}
float output = maa_pwm_read(&pwm);
float output = maa_pwm_read(pwm);
}
return 0;
}