mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 07:13:34 +08:00
First round of PWM driver debug changes
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4204 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user