This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 34d3b06955b drivers/timers/capture: fix typo in capture.h
34d3b06955b is described below

commit 34d3b06955b2deb16cac386b03a59b2b05b5f1b3
Author: Côme VINCENT <[email protected]>
AuthorDate: Tue Jan 20 09:33:21 2026 +0100

    drivers/timers/capture: fix typo in capture.h
    
    This commit fixes a typo in the capture.h header file. This is a
    breaking change, but the fix is trivial (replace macro with new one).
    
    Signed-off-by: Côme VINCENT <[email protected]>
---
 Documentation/components/drivers/character/timers/capture.rst | 10 +++++-----
 drivers/timers/capture.c                                      |  4 ++--
 include/nuttx/timers/capture.h                                |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Documentation/components/drivers/character/timers/capture.rst 
b/Documentation/components/drivers/character/timers/capture.rst
index 046f1b04911..026174e83a1 100644
--- a/Documentation/components/drivers/character/timers/capture.rst
+++ b/Documentation/components/drivers/character/timers/capture.rst
@@ -24,7 +24,7 @@ Supported ``ioctl`` Commands
 
    **Argument:** ``int8_t *`` (pointer to duty cycle percentage).
 
-.. c:macro:: CAPIOC_FREQUENCE
+.. c:macro:: CAPIOC_FREQUENCY
 
    Get the pulse frequency from the capture unit.
 
@@ -153,7 +153,7 @@ frequency:
           return 1;
         }
 
-      if (ioctl(fd, CAPIOC_FREQUENCE, (unsigned long)&frequency) < 0)
+      if (ioctl(fd, CAPIOC_FREQUENCY, (unsigned long)&frequency) < 0)
         {
           perror("Failed to get frequency");
           close(fd);
@@ -229,7 +229,7 @@ Here is an example using signal notifications for 
event-driven capture
       sleep(2);
 
       /* Get frequency and duty cycle */
-      ioctl(fd, CAPIOC_FREQUENCE, (unsigned long)&frequency);
+      ioctl(fd, CAPIOC_FREQUENCY, (unsigned long)&frequency);
       ioctl(fd, CAPIOC_DUTYCYCLE, (unsigned long)&duty);
 
       printf("Captured %d edges\n", edge_count);
@@ -276,7 +276,7 @@ The fake capture driver can be used for testing without 
hardware
       sleep(1);
 
       /* Read values (should be 10Hz, 50% duty) */
-      ioctl(fd, CAPIOC_FREQUENCE, (unsigned long)&frequency);
+      ioctl(fd, CAPIOC_FREQUENCY, (unsigned long)&frequency);
       ioctl(fd, CAPIOC_DUTYCYCLE, (unsigned long)&duty);
 
       printf("Fake Capture - Frequency: %u Hz, Duty: %u%%\n",
@@ -294,7 +294,7 @@ Notes
 
 * The actual set of supported ``ioctl`` commands may vary depending on
   the hardware and driver implementation.
-* The ``CAPIOC_FREQUENCE`` macro name is preserved for compatibility,
+* The ``CAPIOC_FREQUENCY`` macro name is preserved for compatibility,
   even though "frequency" is the correct English spelling.
 * Always check return values from ``ioctl()`` calls for error handling.
 * **Important:** In debug builds of NuttX, calling an unsupported
diff --git a/drivers/timers/capture.c b/drivers/timers/capture.c
index e9746a9a437..5e2f40888fd 100644
--- a/drivers/timers/capture.c
+++ b/drivers/timers/capture.c
@@ -364,11 +364,11 @@ static int cap_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
         }
         break;
 
-      /* CAPIOC_FREQUENCE - Get the pulse frequency from the capture.
+      /* CAPIOC_FREQUENCY - Get the pulse frequency from the capture.
        * Argument: int32_t pointer to the location to return the frequency.
        */
 
-      case CAPIOC_FREQUENCE:
+      case CAPIOC_FREQUENCY:
         {
           FAR uint32_t *ptr = (FAR uint32_t *)((uintptr_t)arg);
           DEBUGASSERT(ptr);
diff --git a/include/nuttx/timers/capture.h b/include/nuttx/timers/capture.h
index 1e658d75ba4..8ddc05dfe22 100644
--- a/include/nuttx/timers/capture.h
+++ b/include/nuttx/timers/capture.h
@@ -48,14 +48,14 @@
 
 #define CAPIOC_DUTYCYCLE _CAPIOC(1)
 
-/* Command:     CAPIOC_FREQUENCE
+/* Command:     CAPIOC_FREQUENCY
  * Description: Get the pulse frequency from the capture.
  * Arguments:   int32_t pointer to the location to return the frequency.
  * Return:      Zero (OK) on success.  Minus one will be returned on failure
  *              with the errno value set appropriately.
  */
 
-#define CAPIOC_FREQUENCE _CAPIOC(2)
+#define CAPIOC_FREQUENCY _CAPIOC(2)
 
 /* Command:     CAPIOC_EDGES
  * Description: Get the pwm edges from the capture.

Reply via email to