PR fixes for oneshoot and freerun
This commit is contained in:
parent
a48fb1e41c
commit
749b54fbda
@ -57,7 +57,7 @@
|
|||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static struct stm32l4_freerun_s *g_freerun;
|
FAR static struct stm32l4_freerun_s *g_freerun;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
@ -81,9 +81,9 @@ static struct stm32l4_freerun_s *g_freerun;
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int stm32l4_freerun_handler(int irq, void *context)
|
static int stm32l4_freerun_handler(int irq, FAR void *context)
|
||||||
{
|
{
|
||||||
struct stm32l4_freerun_s *freerun = g_freerun;
|
FAR struct stm32l4_freerun_s *freerun = g_freerun;
|
||||||
|
|
||||||
DEBUGASSERT(freerun != NULL && freerun->overflow < UINT32_MAX);
|
DEBUGASSERT(freerun != NULL && freerun->overflow < UINT32_MAX);
|
||||||
freerun->overflow++;
|
freerun->overflow++;
|
||||||
@ -115,8 +115,8 @@ static int stm32l4_freerun_handler(int irq, void *context)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int stm32l4_freerun_initialize(struct stm32l4_freerun_s *freerun, int chan,
|
int stm32l4_freerun_initialize(FAR struct stm32l4_freerun_s *freerun, int chan,
|
||||||
uint16_t resolution)
|
uint16_t resolution)
|
||||||
{
|
{
|
||||||
uint32_t frequency;
|
uint32_t frequency;
|
||||||
|
|
||||||
@ -183,8 +183,8 @@ int stm32l4_freerun_initialize(struct stm32l4_freerun_s *freerun, int chan,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int stm32l4_freerun_counter(struct stm32l4_freerun_s *freerun,
|
int stm32l4_freerun_counter(FAR struct stm32l4_freerun_s *freerun,
|
||||||
struct timespec *ts)
|
FAR struct timespec *ts)
|
||||||
{
|
{
|
||||||
uint64_t usec;
|
uint64_t usec;
|
||||||
uint32_t counter;
|
uint32_t counter;
|
||||||
@ -275,7 +275,7 @@ int stm32l4_freerun_counter(struct stm32l4_freerun_s *freerun,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int stm32l4_freerun_uninitialize(struct stm32l4_freerun_s *freerun)
|
int stm32l4_freerun_uninitialize(FAR struct stm32l4_freerun_s *freerun)
|
||||||
{
|
{
|
||||||
DEBUGASSERT(freerun && freerun->tch);
|
DEBUGASSERT(freerun && freerun->tch);
|
||||||
|
|
||||||
|
@ -83,11 +83,11 @@ static struct stm32l4_oneshot_s *g_oneshot;
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int stm32l4_oneshot_handler(int irq, void *context)
|
static int stm32l4_oneshot_handler(int irq, FAR void *context)
|
||||||
{
|
{
|
||||||
struct stm32l4_oneshot_s *oneshot = g_oneshot;
|
FAR struct stm32l4_oneshot_s *oneshot = g_oneshot;
|
||||||
oneshot_handler_t oneshot_handler;
|
oneshot_handler_t oneshot_handler;
|
||||||
void *oneshot_arg;
|
FAR void *oneshot_arg;
|
||||||
|
|
||||||
tmrinfo("Expired...\n");
|
tmrinfo("Expired...\n");
|
||||||
DEBUGASSERT(oneshot != NULL && oneshot->handler);
|
DEBUGASSERT(oneshot != NULL && oneshot->handler);
|
||||||
@ -138,8 +138,8 @@ static int stm32l4_oneshot_handler(int irq, void *context)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int stm32l4_oneshot_initialize(struct stm32l4_oneshot_s *oneshot, int chan,
|
int stm32l4_oneshot_initialize(FAR struct stm32l4_oneshot_s *oneshot, int chan,
|
||||||
uint16_t resolution)
|
uint16_t resolution)
|
||||||
{
|
{
|
||||||
uint32_t frequency;
|
uint32_t frequency;
|
||||||
|
|
||||||
@ -181,7 +181,8 @@ int stm32l4_oneshot_initialize(struct stm32l4_oneshot_s *oneshot, int chan,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int stm32l4_oneshot_max_delay(struct stm32l4_oneshot_s *oneshot, uint64_t *usec)
|
int stm32l4_oneshot_max_delay(FAR struct stm32l4_oneshot_s *oneshot,
|
||||||
|
FAR uint64_t *usec)
|
||||||
{
|
{
|
||||||
DEBUGASSERT(oneshot != NULL && usec != NULL);
|
DEBUGASSERT(oneshot != NULL && usec != NULL);
|
||||||
|
|
||||||
@ -210,9 +211,9 @@ int stm32l4_oneshot_max_delay(struct stm32l4_oneshot_s *oneshot, uint64_t *usec)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int stm32l4_oneshot_start(struct stm32l4_oneshot_s *oneshot,
|
int stm32l4_oneshot_start(FAR struct stm32l4_oneshot_s *oneshot,
|
||||||
oneshot_handler_t handler, void *arg,
|
oneshot_handler_t handler, FAR void *arg,
|
||||||
const struct timespec *ts)
|
FAR const struct timespec *ts)
|
||||||
{
|
{
|
||||||
uint64_t usec;
|
uint64_t usec;
|
||||||
uint64_t period;
|
uint64_t period;
|
||||||
@ -307,8 +308,8 @@ int stm32l4_oneshot_start(struct stm32l4_oneshot_s *oneshot,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int stm32l4_oneshot_cancel(struct stm32l4_oneshot_s *oneshot,
|
int stm32l4_oneshot_cancel(FAR struct stm32l4_oneshot_s *oneshot,
|
||||||
struct timespec *ts)
|
FAR struct timespec *ts)
|
||||||
{
|
{
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
uint64_t usec;
|
uint64_t usec;
|
||||||
|
Loading…
Reference in New Issue
Block a user