yangsong8-a1 opened a new pull request, #18250:
URL: https://github.com/apache/nuttx/pull/18250
## Summary
This PR adds a timer driver that is implemented using NuttX watchdog
functionality.
The driver provides a generic timer interface abstraction layer on top of
software
watchdog timers, enabling configurations where dedicated timer hardware is
not available
or to provide additional timer instances through watchdog mechanisms.
## Impact
- **Stability**: No impact on existing code. This is a new driver that is
only loaded when explicitly configured.
- **Compatibility**: Fully compatible with existing timer driver
infrastructure. Uses standard timer lower-half interface.
- **Code Quality**: Follows NuttX coding standards and driver architecture
patterns.
- **Breaking Changes**: None.
## Testing
### Test Environment
- Platform: sim:nsh
- Configuration: Timer WDOG driver enabled in menuconfig
- Build: Standard NuttX build system
### Test Steps
1. Configure NuttX with timer WDOG support enabled:
```bash
CONFIG_TIMER=y
CONFIG_TIMER_WDOG=y
CONFIG_EXAMPLES_TIMER=y
```
2. Build the system:
3. Run the test example
### Test Results
```
nsh> timer
Open /dev/timer0
flags: 00000000 timeout: 0 timeleft: 0 nsignals: 0
Set timer interval to 1000000
flags: 00000000 timeout: 1000000 timeleft: 0 nsignals: 0
Attach timer handler
flags: 00000002 timeout: 1000000 timeleft: 0 nsignals: 0
Start the timer
flags: 00000003 timeout: 1000000 timeleft: 900000 nsignals: 0
flags: 00000003 timeout: 1000000 timeleft: 790000 nsignals: 0
flags: 00000003 timeout: 1000000 timeleft: 680000 nsignals: 0
flags: 00000003 timeout: 1000000 timeleft: 570000 nsignals: 0
flags: 00000003 timeout: 1000000 timeleft: 460000 nsignals: 0
flags: 00000003 timeout: 1000000 timeleft: 350000 nsignals: 0
flags: 00000003 timeout: 1000000 timeleft: 240000 nsignals: 0
flags: 00000003 timeout: 1000000 timeleft: 130000 nsignals: 0
flags: 00000003 timeout: 1000000 timeleft: 20000 nsignals: 0
flags: 00000003 timeout: 1000000 timeleft: 1000000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 890000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 780000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 670000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 560000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 450000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 340000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 230000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 120000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 10000 nsignals: 1
flags: 00000003 timeout: 1000000 timeleft: 1000000 nsignals: 2
Stop the timer
flags: 00000000 timeout: 1000000 timeleft: 0 nsignals: 2
Finished
nsh>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]