Changes from Review of last PR adding Tiva PWM driver

This commit is contained in:
Gregory Nutt
2016-08-05 07:17:42 -06:00
parent ce0dfda923
commit f5ae207516
4 changed files with 311 additions and 298 deletions
File diff suppressed because it is too large Load Diff
-2
View File
@@ -47,8 +47,6 @@
****************************************************************************/
FAR struct pwm_lowerhalf_s *tiva_pwm_initialize(int channel);
void tm4c_pwm_register(int channel);
int board_pwm_setup(void);
#endif /* __ARCH_ARM_SRC_TIVA_TIVA_PWM_H */
+1 -1
View File
@@ -701,7 +701,7 @@ static ioe_pinset_t sim_int_update(FAR struct sim_dev_s *priv)
}
else /* if (SIM_LEVEL_SENSITIVE(priv, pin)) */
{
/* Level triggered. Set intstat if imatch in level type. */
/* Level triggered. Set intstat if match in level type. */
if ((pinval && SIM_LEVEL_HIGH(priv, pin)) ||
(!pinval && SIM_LEVEL_LOW(priv, pin)))
+32 -9
View File
@@ -37,13 +37,13 @@
* Included Files
****************************************************************************/
#include <stdio.h>
#include <stdint.h>
#include <nuttx/config.h>
#include <stdio.h>
#include <stdint.h>
#include <debug.h>
#include <nuttx/board.h>
#include <nuttx/i2c/i2c_master.h>
#include <arch/board/board.h>
@@ -54,7 +54,6 @@
#define PWM_PATH_FMT "/dev/pwm%d"
#define PWM_PATH_FMTLEN (10)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -171,7 +170,7 @@ void tm4c_pwm_register(int channel)
dev = tiva_pwm_initialize(channel);
if (dev == NULL)
{
dbg("ERROR: Failed to get PWM%d interface\n", channel);
pwmerr("ERROR: Failed to get PWM%d interface\n", channel);
}
else
{
@@ -179,7 +178,8 @@ void tm4c_pwm_register(int channel)
ret = pwm_register(pwm_path, dev);
if (ret < 0)
{
dbg("ERROR: Failed to register PWM%d driver: %d\n", channel, ret);
pwmerr("ERROR: Failed to register PWM%d driver: %d\n",
channel, ret);
}
}
}
@@ -193,7 +193,6 @@ void tm4c_pwm_register(int channel)
****************************************************************************/
#ifdef HAVE_PWM
static void tm4c_pwm(void)
{
#ifdef CONFIG_TIVA_PWM0_CHAN0
@@ -221,8 +220,7 @@ static void tm4c_pwm(void)
tm4c_pwm_register(7);
#endif
}
#endif
#endif # HAVE_PWM
/****************************************************************************
* Public Functions
@@ -246,9 +244,11 @@ int tm4c_bringup(void)
tm4c_i2ctool();
#ifdef HAVE_PWM
/* Register PWM drivers */
tm4c_pwm();
#endif
#ifdef HAVE_TIMER
/* Initialize the timer driver */
@@ -262,3 +262,26 @@ int tm4c_bringup(void)
return OK;
}
/****************************************************************************
* Name: board_pwm_setup
*
* Description:
* No implementation for now, it's called by PWM tool via boardctl.h.
* See include/nuttx/board.h
*
* Input Parameters:
* None.
*
* Returned Value:
* Zero on Success.
*
****************************************************************************/
#ifdef CONFIG_BOARDCTL_PWMTEST
int board_pwm_setup(void)
{
return OK;
}
#endif