Commit Graph

117 Commits

Author SHA1 Message Date
Xiang Xiao
3bc62f1ccc Change space to tab and help to ---help--- in Kconfig files. 2019-10-05 21:39:12 -06:00
Augusto Fraga Giachero
68bbc8438c drivers/timers/pwm.c: Move the pwm/pwm.c driver to timers/pwm.c, The drivers/pwm contained only one .c file (pwm.c), so to avoid the proliferation of sub-directories inside drivers/ is better to move the pwm.c driver to drivers/timers. The pwm.h header was moved to include/nuttx/timers to keep consistency, so all files referencing it need to be updated. 2019-09-02 07:57:10 -06:00
ligd
9fc5db7b39 drivers/timers/rtc: If the RTC time is successfully set, then update the current system time to match. 2019-08-26 10:02:48 -06:00
Gregory Nutt
b49be4bb20 Squashed commit of the following:
arch/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    sched/ audio/ crypto/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    Documentation/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    fs/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    graphics/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    net/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    drivers/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    include/, syscall/, wireless/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    configs/:  Remove all references to CONFIG_DISABLE_POLL.  Standard POSIX poll can no longer be disabled.
2019-05-21 18:57:54 -06:00
Gregory Nutt
abf6965c24 Squashed commit of the following:
libs/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    syscall/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    wireless/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    Documentation/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    include/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    drivers/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    sched/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    configs:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/xtensa:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/z80:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/x86:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/renesas and arch/risc-v:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/or1k:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/misoc:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/mips:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/avr:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/arm:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
2019-04-29 14:52:05 -06:00
Gregory Nutt
842d3dc4e5 Rename sched_alarm_expiration to nxsched_alarm_expiration. That is the appropriate name for an internal sched/ function (still many named incorrectly). 2019-03-20 19:34:23 -06:00
Gregory Nutt
9acb652e29 Rename sched_timer_expiration to nxsched_timer_expiration. That is the appropriate name for an internal sched/ function (still many named incorrectly). 2019-03-20 19:31:43 -06:00
Gregory Nutt
b290160b3b Rename sched_process_timer to nxsched_process_timer. That is the appropriate name for an internal sched/ function (still many named incorrectly). 2019-03-20 19:27:40 -06:00
Gregory Nutt
dc8c814ca3 Squashed commit of the following:
Fixed coding standard error in several files.  Use of while( is incorrect; a space is required between while and (.  Also ran tools/nxstyle and fix thoses complaints as well in most files.

    Changes to comply with coding standard.  Mostly focused on files with missing space after keyword in if(, switch(, and for(.  Offending files also got changes to comply with tools nxstyle.  If there were logs of nxstyle complaints, the file also got a taste of tools/indent.sh.  Still need to fix occurrences of while( with missing space.  There are a lot of them.
2019-02-27 08:41:08 -06:00
Gregory Nutt
5a0f514615 drivers/timers/timer.c: Support the signal notification through SIGEV_THREAD 2019-01-28 06:32:27 -06:00
Xiang Xiao
15db8a21ae drivers/timers/arch_alarm.c and arch_timer.c: Implement up_critmon_gettime and up_critmon_convert and remove the critical section from current_usec to infinite recursion. 2019-01-27 10:15:51 -06:00
Xiang Xiao
1c75aa76f0 drivers/timers/rtc.c: Protect the timer state with a semaphore. 2019-01-27 10:08:18 -06:00
Xiang Xiao
a497aebcfa drivers/timers/rtc.c: Protect the RTC state with a semaphore. 2019-01-27 10:08:07 -06:00
Gregory Nutt
dfee842074 drivers/timers/watchdog.c: Support auto-monitor service 2019-01-27 10:03:16 -06:00
Xiang Xiao
fb63c0a293 sched/signal and related changes to other OS subsystems. 2019-01-27 09:28:59 -06:00
Xiang Xiao
5e8ae23edc drivers/timers/oneshot.c: Support signal notification through SIGEV_THREAD
drivers/timers/rtc.c:  Support signal notification through SIGEV_THREAD
drivers/input/ajoystick.c:  Support signal notification through SIGEV_THREAD
drivers/input/djoystick.c:  Support signal notification through SIGEV_THREAD
drivers/input/button_upper.c:  Support signal notification through SIGEV_THREAD
drivers/sensors/zerocross.c: Support signal notification through SIGEV_THREAD
drivers/wireless/ieee802154:  Support signal notification through SIGEV_THREAD
drivers/lcd/ft80x.c: Support signal notification through SIGEV_THREAD
2019-01-27 08:53:12 -06:00
Gregory Nutt
5299e87b2c Squashed commit of the following:
arch/arm/src/tiva/cc13xx:  Trim code now kind of looks like NuttX code.  But does not yet compile.

    arch/arm/src/tiva/cc13xx:  The first few, feeble steps toward getting the overall trim files compatible with the requirements of the NuttX coding standard.

    arch/arm/src/tiva/cc13xx:  Replace last of TI hardware access macros with NuttX hardware access macros.

    arch/arm/src/tiva/cc13xx: Change TI HWREGB to NuttX getreg8 or putreg8 in trim logic.

    arch/arm/src/tiva/cc13xx: Change TI HWREGBITW to NuttX getreg32/putreg32 sequence in trim logic.

    arch/arm/src/tiva/hardware/cc13x2_cc26x2/cc13x2_cc26x2_ddi0_osc.h:  Completes the DDIO OSC header file.

    cc13x2_cc26x2/cc13x2_cc26x2_ddi0_osc.h:  Updated, but still not finished.

    arch/arm/src/tiva/hardware/cc13x2_cc26x2/cc13x2_cc26x2_ddi0_osc.h:  Add DDI0 OSC header file.  Still a work in progress. Does not yet conform to the NuttX coding standard.

    Change _M and _S to _MASK and _SHIFT.

    Some minor improvements.

    Clean up typos in some comments.

    Run all new files against tools/indent.sh

    arch/arm/src/tiva/cc13xx:  Bring in trim files from SDK.  Convert to C-style comments, lowercase hex contants.  Remove Windows-style line endings.
2019-01-12 08:43:45 -06:00
Abdelatif Guettouche
546b6fcbc8 drivers/timers/mcp794xx.c: Fix MCP794xx driver to wait for OSCRUN and fix tm_year. 2019-01-12 07:50:29 -06:00
Ouss4
d0b4a018bf drivers/timers/mcp794xx.c: Rename the module to mcp794xx. 2019-01-08 13:04:50 -06:00
Ouss4
e998acee67 drivers/timers/mcp7941x.c: Add support for the MCP741x external RTC. 2019-01-06 17:32:02 -06:00
Gregory Nutt
c137c6ef1f Clean up typos in some comments. 2018-12-22 08:12:34 -06:00
Xiang Xiao
f64741faca drivers/timers/arch_rtc.c: up_rtc_set_lowerhalf call clock_synchronize() for external RTC. 2018-11-09 16:34:07 -06:00
Xiang Xiao
2e8ffd8cc6 drivers/timers: Simplify the error handling in arch rtc/alarm/timer wrapper 2018-11-08 12:06:44 -06:00
ligd
414ace8f46 drivers/timers/arch_alarm.c: Fix alarm ISR error when no CONFIG_SCHED_TICKLESS
drivers/timers/arch_alarm.c: Use uint64_t to avoid alarm 32-bit overflow
2018-11-08 11:51:09 -06:00
Juha Niskanen
3d14b63e8f drivers/timers: RTC_PERIODIC is no longer EXPERIMENTAL, remove unimplemented EXPERIMENTAL RTC configuration variables. 2018-09-17 06:27:37 -06:00
Xiang Xiao
6c057e608b Squashed commit of the following:
drivers/timers/arch_timer.c: implement timer arch API on top of timer driver interface

    drivers/timers/arch_alarm.c:  Implement alarm arch API on top of oneshot driver interface

    drivers/timers/arch_rtc.c:  Implement RTC arch API on top of RTC driver interface

    include/nuttx/timers/rtc.h:  Extend struct rtc_time by adding tm_nsec if RTC supporst hiresolution time.
2018-08-27 11:55:30 -06:00
Xiang Xiao
fc194cf2ec drivers/timers: Add a new method to the struct oneshot_operations_s interface to get the current time from a oneshot timer driver (if it is available from the lower half) 2018-08-24 10:21:29 -06:00
Xiang Xiao
a6c68d233d drivers/timers: Add maxtimeout method to the struct timer_ops_s interface 2018-08-24 10:16:17 -06:00
Gregory Nutt
10069067c1 include/nuttx/i2c/i2c_master.h: Rename I2C_M_NORESTART to I2C_M_NOSTART since it may be used in other contexts than a repeated start. Add comments to clarilfy setup for repeated start. 2018-08-03 08:51:55 -06:00
Gregory Nutt
b75103e264 Update some comments. 2018-07-22 05:56:11 -06:00
Gregory Nutt
1567b82429 Make sure that labeling is used consistently in all function headers (part 2). 2018-02-01 12:03:55 -06:00
Gregory Nutt
7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Alexander Oryshchenko
dd4fc9f5c3 arch/arm/src/stm32: Make STM32 usable with an external RTC. drivers/timers/ds3231.c: Correct some debug statments. 2018-01-24 06:55:14 -06:00
Juha Niskanen
9653255cff Merged in juniskane/nuttx_stm32l4/stm32l1_stm32l4_rtc_update_pr (pull request #514)
STM32L1, STM32L4 RTC: add periodic interrupts, update L1 RTC implementation

* STM32L4 RTC: add support experimental CONFIG_RTC_PERIODIC

* STM32 RTC: separate STM32L1 RTC into a separate file

    STM32L1 RTC is very close to F4 or L4 versions, with two alarms
    and periodic wakeup support so backported L4 peripheral to L1.

* RTC: add periodic alarms to upper and lower halves

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-20 17:15:17 +00:00
Juha Niskanen
d101fad026 Merged in juniskane/nuttx_stm32l4/stm32_rtc_small_patches_pr (pull request #511)
Stm32 rtc small patches

* RTC: canceling an alarm marks it as inactive

* STM32L4, STM32F4, STM32F7 RTC: fix reading alarm value that is more than 24h in future

* STM32F0 RTC: fix backup register count in stm32_rtcc.h

    All other STM32: SHIFTR_SUBFS_MASK was correct in STM32F0 only

* STM32L1: use correct EXTI line definitions

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-17 16:45:48 +00:00
Gregory Nutt
4810499d3a Squashed commit of the following:
Replace all calls to sigqueue() in the OS proper with calls to nxsig_queue() to avoid accessing the errno variable.

    sched/signal:  Add nxsig_queue() which is functionally equivalent to sigqueue() except that it does not modify the errno variable.
2017-10-07 10:57:09 -06:00
Gregory Nutt
9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt
42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Boris Astardzhiev
b1eceb838b Extend the RTC framework with an alarm read ioctl (RTC_RD_ALARM). Through it consumer could get configuration settings about previously scheduled hardware alarms (active status, hours, minutes, seconds). 2017-09-03 08:39:02 -06:00
Juha Niskanen
0113b0db95 drivers: handle I2C_TRANSFER return value consistently. Some I2C peripherals transfers return zero on success, others number of completed transfers. Make drivers robust against this. 2017-08-04 07:31:36 -06:00
Juha Niskanen
b9a769d65d drivers: fix some bad NULL checks 2017-05-15 07:20:32 -06:00
Jussi Kivilinna
e3b3e57e56 RTC: add interface for check if RTC time has been set
New interface allows checking if RTC time has been set.  This allows to application to detect if RTC has valid time (after
reset) or should application attempt to get real time by other means (for example, by launching ntpclient or GPS).
2017-04-06 09:53:11 -06:00
Sebastien Lorquet
5363d0619a Fix warnings 2016-11-18 15:26:08 +01:00
Gregory Nutt
47b52a2633 Fix an error in manually bringing in Sebastien's changes; Update some comments. 2016-11-17 16:15:06 -06:00
Gregory Nutt
9acd57c819 Fix up some naming and update some comments. 2016-11-17 15:50:39 -06:00
Gregory Nutt
19c1c9d78b All timer lower half drivers. Port Sebastien's changes to all all other implementations of the timer lower half. Very many just and untested. Expect some problems. 2016-11-17 15:03:31 -06:00
Sebastien Lorquet
197cec58d2 timer driver: Use signal to notify of timer expiration. Add generic argument so that there can be additional usage. 2016-11-17 14:38:21 -06:00
Gregory Nutt
d4a048c0c6 Timer driver: Add hooks to support signal notification of timer expiration. Commented out because invasive interface changes would also be required to complete the implementation. 2016-11-17 12:41:11 -06:00
Gregory Nutt
ecb2d4cbc1 drivers/timer: Remove the TIOC_SETHANDLER IOCTL call. This calls directly from the timer driver into application code. That is non-standard, non-portable, and cannot be supported 2016-11-17 11:52:42 -06:00