mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Various SAM4S related fixes, mostely related to the timer driver driver and the SAM4S timer/counter. All from Bob Doisin
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
#define _SLCDIOCBASE (0x1100) /* Segment LCD ioctl commands */
|
||||
#define _WLIOCBASE (0x1200) /* Wireless modules ioctl commands */
|
||||
#define _CFGDIOCBASE (0x1300) /* Config Data device (app config) ioctl commands */
|
||||
#define _TCIOCBASE (0x1400) /* Timer ioctl commands */
|
||||
|
||||
/* Macros used to manage ioctl commands */
|
||||
|
||||
@@ -93,6 +94,11 @@
|
||||
#define _WDIOCVALID(c) (_IOC_TYPE(c)==_WDIOCBASE)
|
||||
#define _WDIOC(nr) _IOC(_WDIOCBASE,nr)
|
||||
|
||||
/* Timer driver ioctl commands *******************************************/
|
||||
|
||||
#define _TCIOCVALID(c) (_IOC_TYPE(c)==_TCIOCBASE)
|
||||
#define _TCIOC(nr) _IOC(_TCIOCBASE,nr)
|
||||
|
||||
/* NuttX file system ioctl definitions **************************************/
|
||||
|
||||
#define _FIOCVALID(c) (_IOC_TYPE(c)==_FIOCBASE)
|
||||
|
||||
+11
-7
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/timer.h
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -68,8 +68,11 @@
|
||||
* Argument: A 32-bit timeout value in microseconds.
|
||||
* TCIOC_CAPTURE - Do not reset. Instead, called this handler.
|
||||
* Argument: A pointer to struct timer_capture_s.
|
||||
*
|
||||
* WARNING: May change TCIOC_SETTIMEOUT to pass pointer to 64bit nanoseconds
|
||||
* or timespec structure.
|
||||
*/
|
||||
#warning "may change TCIOC_SETTIMEOUT to pass pointer to 64bit nanoseconds or timespec structure"
|
||||
|
||||
#define TCIOC_START _TCIOC(0x001)
|
||||
#define TCIOC_STOP _TCIOC(0x002)
|
||||
#define TCIOC_GETSTATUS _TCIOC(0x003)
|
||||
@@ -174,7 +177,8 @@ struct timer_lowerhalf_s
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
@@ -212,8 +216,8 @@ extern "C" {
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN FAR void *timer_register(FAR const char *path,
|
||||
FAR struct timer_lowerhalf_s *lower);
|
||||
FAR void *timer_register(FAR const char *path,
|
||||
FAR struct timer_lowerhalf_s *lower);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: timer_unregister
|
||||
@@ -230,7 +234,7 @@ EXTERN FAR void *timer_register(FAR const char *path,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN void timer_unregister(FAR void *handle);
|
||||
void timer_unregister(FAR void *handle);
|
||||
|
||||
/****************************************************************************
|
||||
* Platform-Independent "Lower-Half" Timer Driver Interfaces
|
||||
@@ -259,7 +263,7 @@ EXTERN void timer_unregister(FAR void *handle);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN int up_timerinitialize(void);
|
||||
int up_timerinitialize(void);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user