Commit Graph

75 Commits

Author SHA1 Message Date
Gregory Nutt
936df1bcb5 Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These differ from the standard sleep() and usleep() in that (1) they don't cause cancellation points, and (2) don't set the errno variable (if applicable). All calls to sleep() and usleep() changed to calls to nxsig_sleep() and nxsig_usleep().
Squashed commit of the following:

    Change all calls to usleep() in the OS proper to calls to nxsig_usleep()

    sched/signal:  Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.

    sched/signal:  Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
2017-10-06 10:15:01 -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
Juha Niskanen
fa5a2035ff drivers: analog: adc: add poll support 2017-08-28 07:05:33 -06:00
Mateusz Szafoni
ea35f31f73 Merged in raiden00/nuttx (pull request #469)
Master

* stm32f0/Kconfig: remove references to HRTIM

* STM32F33: missing SYSCFG CFGR3 definitions

* stm32_hrtim.h: remove redundant definitions

* stm32_hrtim.c: fix DAC triggers configuration

* stm32_hritm.c: warning message when default value selected

* stm32_hrtim.c: missing master timer logic

* stm32_hrtim.c: add more assertions

* stm32_dac.c: fix conditional

* stm32_dac.c: conditional logic for timer triggering

* stm32_dac.c: fix TSEL configuration when HRTIM

* stm32_dac.c: unnecessary condition

* stm32_dac.c: DMA request remapping

* stm32_dac.c: fix commpilation errors

* stm32_dac.c: add DMA buffers initialization logic

* stm32_hrtim.c: enable DAC triggering

* analog/comp.c: fix compilation errors when poll disabled

* stm32_hrtim.c: remove doubled assertions

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-08-27 12:49:53 +00:00
Pekka Ervasti
cc0fea60ad drivers: analog: comp: add poll support 2017-08-22 06:26:57 -06:00
Gregory Nutt
e75e3eb807 drivers/analog: Fix some data alignment issues in the ADC driver. 2017-07-27 08:09:21 -06:00
Gregory Nutt
49d78f7b55 ADC: Some trivial coding standard changes. 2017-07-22 16:59:46 -06:00
raiden00pl
0b6190c1c4 drivers/analog: Add basic OPAMP driver 2017-04-30 11:11:17 +02:00
Gregory Nutt
e9a5477506 Add an instance argument to the SPIDEV definitions. 2017-04-29 12:26:52 -06:00
Gregory Nutt
04ebdbb336 Move: CONFIG_ADC_NO_START_CONV from drivers/adc/Kconfig to arch/arm/src/stm32[f7]/Kconfig as STM32[F7]_ADC_NO_START_CONV. Refresh all configurations with any reference to CONFIG_ADC_NO_START_CONV. 2017-04-18 07:16:35 -06:00
Jussi Kivilinna
dffb8a67e3 Add entropy pool and strong random number generator
Entropy pool gathers environmental noise from device drivers, user-space, etc., and returns good random numbers, suitable for cryptographic use. Based on entropy pool design from *BSDs and uses BLAKE2Xs algorithm for CSPRNG output.

Patch also adds /dev/urandom support for using entropy pool RNG and new 'getrandom' system call for getting randomness without file-descriptor usage (thus avoiding file-descriptor exhaustion attacks). The 'getrandom' interface is similar as 'getentropy' and 'getrandom' available on OpenBSD and Linux respectively.
2017-03-30 07:38:37 -06:00
Martin Lederhilger
91f96b6ecb drivers/analog: Add driver for the LTC1767L ADC. 2017-03-28 06:34:37 -06:00
Gregory Nutt
7d57a2b2bd Trivial changes from review of last PR. 2017-03-25 10:38:41 -06:00
raiden00pl
be8207d493 drivers/analog: Add basic COMP driver 2017-03-25 16:50:11 +01:00
Mark Schulte
b3222bbc8a irq_dispatch: Add argument pointer to irq_dispatch
Provide a user defined callback context for irq's, such that when
registering a callback users can provide a pointer that will get
passed back when the isr is called.
2017-02-27 06:27:56 -06:00
Gregory Nutt
08c001196b drivers/: Remove all explicit use of 'hidden' macro _info. Code must never use this directly. Code must always use a debug macro such as info which is basic on _info but can be appropriately filtered. 2017-01-15 13:00:50 -06:00
Gregory Nutt
4fcbe8e410 drivers: Disable priority inheritance on all semaphores used for signaling 2016-11-03 11:00:47 -06:00
Piotr Mienkowski
053aea552f Add support for SAMV7 DACC module 2016-08-15 08:00:36 -06:00
Gregory Nutt
9965cbe428 drivers/: Review and correct some stylistic inconsistencies 2016-08-07 09:43:48 -06:00
Gregory Nutt
0c8c7fecf0 Add _ to the beginning of all debug macros to avoid name collisions 2016-06-16 12:33:32 -06:00
Gregory Nutt
ba03134bed Centralize definitions associated with CONFIG_DEBUG_SPI 2016-06-15 10:41:13 -06:00
Gregory Nutt
0665c7e06c drivers/: Change some nerr() ERRORS to ninfo() and nwarn() WARNINGS. 2016-06-12 09:26:12 -06:00
Gregory Nutt
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt
86b79b33cf Reserver the name 'err' for other purposes 2016-06-11 14:40:07 -06:00
Gregory Nutt
1cdc746726 Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES 2016-06-11 14:14:08 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Gregory Nutt
3a74a438d9 Rename CONFIG_DEBUG_VERBOSE to CONFIG_DEBUG_INFO 2016-06-11 11:50:18 -06:00
Manuel Stühn
5c6c7bd60d Fix recently introduced problem with build of ADC driver with analog debug enabled. 2016-05-29 13:45:40 -06:00
Gregory Nutt
7d538d19bf Costmetic changes to comments and style 2016-05-27 10:53:27 -06:00
Gregory Nutt
3e7b2d617a All drivers that use SPI must call SPI_LOCK and SPI_UNLOCK. This is not optional. 2016-05-26 14:56:10 -06:00
Gregory Nutt
d5a4f85893 ADS1255 Driver: Must also lock the SPI bus before using it. 2016-05-26 14:00:33 -06:00
Gregory Nutt
d2caa93f1a ADS1255 Driver: Must not do SPI access from interrupt handler. Use the worker thread instead. 2016-05-26 13:44:11 -06:00
Gregory Nutt
9d6845b7ec Add ADC bind method to the EFM32 and LPC17xx ADC drivers 2016-05-26 11:57:18 -06:00
Gregory Nutt
b630d48175 Add bind method to the ADC lower-half interface 2016-05-26 11:32:26 -06:00
Gregory Nutt
2244ed46bc nuttx/drivers: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 07:32:58 -06:00
Gregory Nutt
ca792558bf Update ChangeLog; add ADS1242 driver to build system; fix some typos; eliminate some warning 2016-01-29 07:55:39 -06:00
Entinger Alexander
dc8c14aa53 Driver for the 24-Bit Differential Input ADC ADS1242 that communicates via SPI with a MCU. Reading the ADC conversion result as well as configuring the ADC, setting the input channel, etc. is implemented via ioctl calls. However, it does not yet implement the standard ADC interface. 2016-01-29 07:41:23 -06:00
Gregory Nutt
d87f7e99d2 NOkia LCD needs to initialize SPI before using it 2016-01-23 19:45:30 -06:00
Gregory Nutt
7edf921c5e Remove CONFIG_SPI_OWNBUS: Now it is not just a good idea, it is the law 2016-01-23 18:54:36 -06:00
Gregory Nutt
f6e49caba8 All SPI-based device drivers needs to call SPI_HWFEATURES() with zero in order to co-exist with drivers that use H/W features 2016-01-23 16:18:13 -06:00
Gregory Nutt
cf14f8d1b5 drivers/: Fixes to spacing and alignement 2015-10-10 10:41:00 -06:00
Gregory Nutt
0b12dbf95d Fix some spacing problems 2015-10-04 15:04:00 -06:00
Juha Niskanen
c33d61e00e Add missing configuration option for last set of ADC changed 2015-07-30 07:38:45 -06:00
Gregory Nutt
342f5fe33d Fix references to the no-longer-existent misc/ directory in comments, README files, and documentation 2015-06-28 08:08:57 -06:00
Gregory Nutt
fada63014d Review and bring closer to nuttx coding style 2015-03-02 10:18:25 -06:00
Gregory Nutt
2994448d85 More fixes to problems noted by cppcheck. Some are kind of risky; some are real bugs. 2014-11-25 13:15:09 -06:00
Gregory Nutt
dd8bb71cbc Remove empty ADC write method. From Kosma Moczek 2014-06-30 07:55:28 -06:00
Gregory Nutt
3a1324741a More trailing whilespace removal 2014-04-13 14:32:20 -06:00