diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-20 14:41:32 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-20 14:41:32 +0000 |
commit | ca038722e88f047a2eb0e35ef0954aebcf932791 (patch) | |
tree | 2f408755b3a07b39e65d2336ef3a023c0a412334 /apps/examples | |
parent | c4080df06cc977a0801794b83a51f6739e347379 (diff) | |
download | nuttx-ca038722e88f047a2eb0e35ef0954aebcf932791.tar.gz nuttx-ca038722e88f047a2eb0e35ef0954aebcf932791.tar.bz2 nuttx-ca038722e88f047a2eb0e35ef0954aebcf932791.zip |
First round of PWM driver debug changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4204 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples')
-rw-r--r-- | apps/examples/pwm/pwm_main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/examples/pwm/pwm_main.c b/apps/examples/pwm/pwm_main.c index 18b93f8d1..cbabb564f 100644 --- a/apps/examples/pwm/pwm_main.c +++ b/apps/examples/pwm/pwm_main.c @@ -265,7 +265,10 @@ int pwm_main(int argc, char *argv[]) /* Configure the characteristics of the pulse train */ info.frequency = g_pwmstate.freq; - info.duty = (info.duty < 16) / 100; + info.duty = ((uint32_t)g_pwmstate.duty << 16) / 100; + + message("pwm_main: starting output with frequency: %d duty: %08x\n", + info.frequency, info.duty); ret = ioctl(fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&info)); if (ret < 0) @@ -289,6 +292,9 @@ int pwm_main(int argc, char *argv[]) /* Then stop the pulse train */ + message("pwm_main: stopping output\n", + info.frequency, info.duty); + ret = ioctl(fd, PWMIOC_STOP, 0); if (ret < 0) { |