Commit Graph

2717 Commits

Author SHA1 Message Date
Sebastien Lorquet
1182702b80 drivers/ioexpander: The IRQ subsystem now supports passing a void * parameter to IRQ handlers. Use that method to support multiple pc9555 devices, by passing a pointer to the device to the board defined irq handler. Now the CONFIG_ for multiple PCA devices just allocates device structures dynamically instead of statically when not enabled.
The same interrupt handler is entered with the device structure parameter in all situations,
multiple or single PCA. One should still be careful if multiple PCA devices share the same IRQ.
2017-10-19 08:10:40 -06:00
Gregory Nutt
d29cb09da3 drivers/usbdev: Move test for NULL pointer before the pointer is deferences. Noted by Juha Niskanen. 2017-10-18 11:06:14 -06:00
Gregory Nutt
8dd1bb03b2 drivers/usbdev: Add a debug assertion to CDC/ACM driver. 2017-10-18 07:10:34 -06:00
Gregory Nutt
85a1a3cc98 drivers/usbdev: Correct input flow control logic when watermarks are not enabled. Problem not by and change based on suggestion by Juha Niskanen. 2017-10-18 06:49:11 -06: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
5b385f4d4d kthread_create(): Rename kernel_thread() to kthread_create() for better naming consistency with task_create() and kthread_delete(). 2017-10-16 11:38:00 -06:00
Gregory Nutt
181875f3ba fs/vfs: Add new internal OS interface nx_read(). nx_read() is functionally equivalent to read() except that it does not modify the errno variable and it is not a cancellation point. Changed all references to read() in the OS to nx_read(). 2017-10-11 12:13:41 -06:00
Gregory Nutt
a00d8e16a1 Adds OS internal function nx_write() which is functionally equivalent to write() except that it does not set the errno variable and do not cause cancellation points. 2017-10-11 10:18:30 -06:00
Gregory Nutt
af072d52bc Adds OS internal functions nx_send(), ns_recv(), and nx_recvfrom() which are functionally equivalent to send(), recv(), and recvfrom() except that they do not set the errno variable and do not cause cancellation points. 2017-10-11 09:25:43 -06:00
Sebastien Lorquet
d16d4d5568 The INA219 is a combined voltage and current sensor that can measure up to 26 volts and a current that depends on an external shunt resistor. Connection happens via i2c/smbus and the chip features a power supply rail that is independent from the measured voltage, so it can measure low voltages.
This commit adds a driver for this chip.  Right now it measures bus voltage and current, and does not use the internal calibrated current reading, nor the available power measurement.
2017-10-10 17:03:56 -06:00
Gregory Nutt
eb79a575f6 Fix a few places where there was a semicolon following the 'if' condition, makeing the following logic unconditional. 2017-10-10 14:24:13 -06:00
Gregory Nutt
e11e3b2607 Squashed commit of the following:
Change all calls to mq_receive() and mq_timedreceive() in the OS to calls to nxmq_receive() and nxmq_timedreceive(), making appropriate changes for differences in return values.

    sched/mqueue:  Add nxmq_receive() and mxmq_timedreceive() which are functionally equivalent to the standard mq_receive and mq_timedreceive() except that (1) they do not create cancellation points, and (2) the do not modify the application's errno variable.
2017-10-10 09:57:40 -06:00
Gregory Nutt
fca07be1df Squashed commit of the following:
Change all calls to mq_send() and mq_timedsend() in the OS to calls to nxmq_send() and nxmq_timedsend(), making appropriate changes for differences in return values.

    sched/mqueue:  Add internal function nxmq_send() and nxmq_timedsend() that are equivalent to mq_send() and mq_timedsend() except that they do not create cancellation points and do to not modify the errno variable.
2017-10-10 08:44:12 -06:00
Gregory Nutt
d0eb182c00 Minor changes from review of last PR 2017-10-09 12:15:05 -06:00
Mateusz Szafoni
6c25f3d142 Merged in raiden00/nuttx (pull request #505)
Master

* power: Add powerled to Kconfig

* stm32_powerled.c: cosmetics

* stm32_hrtim.c: cosmetics

* stm32/Kconfig: add HRTIM configuration and add DAC external trigger configuration

* stm32f334-disco: Add powerled example configuration

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-09 18:07:09 +00:00
Gregory Nutt
ecf6dda2c5 Correct recurring typo: semaphore not semapore 2017-10-09 09:57:56 -06:00
Sakari Kapanen
01a4060a1b RNDIS: Use CONFIG_USBDEV_MAXPOWER instead of hardcoded value
RNDIS: Use LPWORK for network operations by default
2017-10-09 09:00:48 -06:00
Gregory Nutt
700f1a8e8c Eliminate some warnings found in build testing. 2017-10-08 16:27:17 -06: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
2318f895df Fix some compile problems found during build testing. 2017-10-07 09:40:02 -06:00
Gregory Nutt
9e25d89223 Squashed commit of the following:
Replace all usage kill() in the OS proper with nxsig_kill().

    sched/signal:  Add nxsig_kill() which is functionally equivalent to kill() except that it does not modify the errno variable.
2017-10-07 08:22:18 -06:00
Gregory Nutt
3b67c06711 net/Kconfig: Remove to improper use of comma in syntax 2017-10-06 15:14:09 -06:00
Gregory Nutt
5b04c25dcd drivers/serial/tcdrain: tcdrain() was recently added to the NuttX C library. But there is a problem. The specification of tcdrain() requires that it be a cancellation point. In order to do this, tcdrain was moved from the C library into the OS and the addition cancellation point hooks were added. In non-FLAT builds, access via system calls is also now supported. 2017-10-06 10:55:36 -06:00
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
Jussi Kivilinna
7fc7cc9f8f drivers/input/cypress_mbr3108: Add missing variable for nxsem_wait return value 2017-10-06 07:30:04 -06:00
Gregory Nutt
7cc63f90d9 sched/semaphore: sem_trywait() modifies the errno value and, hence, should not be used within the OS. Use nxsem_trywait() instead. 2017-10-05 07:59:06 -06:00
Gregory Nutt
29b5b3667f sched/semaphore: sem_timedwait() is a cancellation point and, hence, cannot be called from within the OS. Created nxsem_timedwait() that is equivalent but does not modify the errno and does not cause cancellation. All calls to sem_timedwait() change to calls to nxsem_timedwait() in the OS. 2017-10-05 07:24:54 -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
Sebastien Lorquet
9ea215f2e4 Merged in slorquet/nuttx/mt25q (pull request #501)
Add support for Micron MT25Q series MT25Q128

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-02 18:33:54 +00:00
Gregory Nutt
8394f9b60f Squashed commit of the following:
configs/z80sim and xtrs:  Serial driver lower halfs ioctl methods should return a negated errno value, not set the errno variable.

    drivers/wireless:  CC1101 driver not permitted to set errno.

    drivers/sensors:  LIS331DL driver not permitted to set errno.

    drivers/lcd: ILI9341 initialize method not permitted to set errno,

    drivers/serial: 16550 UART driver IOCTL method must not set errno; it must return a negated errno value.
2017-09-30 12:59:33 -06:00
Mateusz Szafoni
ad369a0bad Merged in raiden00/nuttx (pull request #499)
syslog_console.c: fix typo

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-30 12:24:37 +00:00
raiden00pl
525a180ab5 syslog_console.c: fix typo 2017-09-30 13:34:15 +02:00
Gregory Nutt
44736b721c net/sockets: psock_send() is an internal OS interface an should not set the errno variable. 2017-09-29 17:48:15 -06:00
Gregory Nutt
8a75add6a0 drivers/syslog: syslog internal functions should not set the errno variable: ramlog_putc(), syslog_dev_putc(), syslog_dev_write(), syslog_force(). 2017-09-29 15:24:40 -06:00
Gregory Nutt
f58a68b5c8 drivers/usbdev/cdcacm.c: Change ordering of some operations to avoid races; Add missing uppder watermark logic that is normally in serial_io.c but must be duplicated in cdcacm.c; update comments 2017-09-27 08:46:49 -06:00
Gregory Nutt
8ad1e72536 drivers/usbdev/cdcacm.c: Fix confusion between flow control being enabled and being active. Different things 2017-09-27 06:41:32 -06:00
Gregory Nutt
7ceedd2b52 drivers/usbdev/cdcacm.c: Add some missing logic when flow control is disabled. Also make sure that the flowcontrol and rxint can handle being re-entered when cdcacm_release_rxpending() is called. 2017-09-27 06:09:13 -06:00
Gregory Nutt
4e3c159145 drivers/usbdev/cdcacm.c: Add a failsafe time to assure that the RX pending queue cannot stall indefinitely. I can imagine a corner case where the serial driver's RX buffer is full and it stops accepting data and where all of the read requests are queued and there is not event to restart RX processing. I am not sure that that scenario can really happen, but the failsafe timer gives me peace of mind. 2017-09-26 09:30:54 -06:00
Gregory Nutt
3fd0f67b62 Squashed commit of the following:
drivers/usbdev/cdcacm.c:  Change design for queuing RX packets that cannot be processed.  Previous design had a logic problem that could cause data loss.

    drivers/usbdev/cdcacm:  Fixes one of two know design issues.

    drivers/usbdev/cdcacm:  First attempt to plug data leak in input flow control design.  Still missing a few things.
2017-09-26 08:51:02 -06:00
Juha Niskanen
d141242a25 drivers/usbdev/cdcacm.c: Avoid using priv before checking its validity. 2017-09-26 06:31:30 -06:00
Gregory Nutt
35c97fbf27 drivers/usbdev/Kconfig: Add comments in regard to RNDIS selection. 2017-09-25 12:52:04 -06:00
Gregory Nutt
18376a124a drivers/net/rndis.c: Eliminate a warning when assertions disabled. Consequence of replacing assert() with DEBUGASSERT(). 2017-09-24 17:25:16 -06:00
Gregory Nutt
dbf57fb673 drivers/usbdev/rindis.c: Change some naming to conform with coding standard. Use DEBUGASSERT vs. assert so that the assertions can be disabled. 2017-09-24 11:18:01 -06:00
Sakari Kapanen
67e9e1efb6 drivers/usbdev: Add RNDIS-over-USB driver 2017-09-24 07:24:34 -06:00
Gregory Nutt
3bc21a3973 drivers/usbdev: Fix some bad conditional logic. 2017-09-23 12:57:20 -06:00
Gregory Nutt
2e69e22af3 drivers/usbdev: CDC/ACM should reset all 'irregular' notifications to zero after sending the SerialState packet. 2017-09-23 12:37:57 -06:00
Gregory Nutt
5d02baf205 drivers/usbdev: Add support for flow control TERMIOs in CDC/ACM driver 2017-09-23 11:00:26 -06:00
Gregory Nutt
d2799f0b4e Update a README and some comments 2017-09-23 08:49:58 -06:00
Gregory Nutt
eff026aab8 drivers/usbdev: Cosmetic changes to CDC/ACM driver. 2017-09-22 15:19:43 -06:00
Gregory Nutt
5e38ad28f4 drivers/usbdev: Add support for RX flow control to the CDC/ACM driver. 2017-09-22 14:01:00 -06:00
Jussi Kivilinna
1604ae7ca7 drivers/pipes: pipe_common: fix writing large buffers not triggering POLLIN for reader poll 2017-09-22 06:03:08 -06:00
Gregory Nutt
ae2a1d07b3 Networking: drivers/net/loopback.c: Eliminate a warning. net/netdev/netdev_ifconfig.c: Was not returning all of the address info. 2017-09-19 15:00:46 -06:00
Alan Carvalho de Assis
dca62a68a8 Add driver for APA102 LED controller. These LEDs are used on LED Strips and are controlled over SPI. 2017-09-18 16:48:55 -06:00
Gregory Nutt
725aa4add8 Fix some typos in comments; Fix some bad spacing in fb.h 2017-09-18 09:03:26 -06:00
Gregory Nutt
882adb2c82 drivers/video/fb.c: Fix a typo introduced in previous commit. 2017-09-17 14:07:08 -06:00
Gregory Nutt
cfd44639b2 Fix some cosmetic stuff in the framebuffer character driver and in the LCD framebuffer driver front-end. 2017-09-17 13:48:10 -06:00
Gregory Nutt
0b8730fb8b Squashed commit of the following:
configs/stm3210e-eval: Bring in new stm32_appinit.c, add board_initialize(), add support for FB character driver.
    configs/stm3210e-eval: Rename stm32_appinit.c to stm32_bringup.c so that the start up logic is compatible with other, new boards.
2017-09-17 13:17:06 -06:00
Gregory Nutt
a9c054237a drivers/lcd: Add suppose for a generic front-end that will convert any LCD driver into a framebuffer driver. 2017-09-17 10:39:23 -06:00
Gregory Nutt
b90b4d40b6 Fix typos/spelling. SAMV71-XULT: Update README, add support for fb_driver. 2017-09-17 10:38:34 -06:00
Gregory Nutt
b747192f20 Squashed commit of the following:
drivers/video:     fb driver now clears framebuffer initially.  Eliminates (or minimizes) initial garbage on the display.
    configs/open1788:  Initialization now follows the pattern of other boards.  Add initialization of fb driver.
    configs/open1788:  Add a configuration for testing the framebuffer driver.
2017-09-16 12:49:16 -06:00
Anthony Merlino
046a94e363 Merged in merlin17/nuttx (pull request #485)
drivers/xbee: Fixes a few warnings

* drivers/xbee: Fixes a few warnings

* configs/clicker2-stm32: Updates sections about i8sak usage in the README

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-15 19:41:24 +00:00
Anthony Merlino
22754053e8 Merged in merlin17/nuttx/xbee (pull request #484)
drivers/wireless:  Adds XBee S2C (802.15.4 firmware) support. XBee driver emulates mac802154 interface

* drivers/wireless/xbee: Adds xbee_netdev. Very similar to mac802154_netdev

* configs/same70-xplained: Starts adding support for XBee radio

* drivers/wireless/ieee802154/xbee: More structuring of XBee driver

* drivers/wireless/ieee802154/xbee: More Xbee work. Starts adding support on Clicker2

* drivers/wireless/ieee802154/xbee: More XBee MAC code

* configs/clicker2-stm32: More work to add XBee radio support

* drivers/wireless/ieee802154/xbee: Most of driver is now structured. No build errors

* configs/clicker2-stm32: Adjustments to XBee click module support

* drivers/xbee: Changes md_ prefix to xd_ prefix for xbeenet_driver_s fields

* drivers/xbee: XBee network device now passes MAC events via IOCTL

* drivers/xbee: Support querying device for parameters, setting parameters, and structures association/startpan logic

* configs/clicker2-stm32: Fixes Xbee lower half ATTN poll logic

* drivers/xbee: Removes dependce on CONFIG_IEEE802154_NETDEV

* drivers/xbee: Supports MAC RESET.request primitive

* drivers/xbee: Exposes generic AT query to the rest of driver

* drivers/xbee: Sets local values when writing setting change to Xbee device

* drivers/xbee: Finish association logic

* drivers/xbee: Adds xbee_get_mhrlen( ) allocating enough space for API frame header to frame

* drivers/xbee: Finishes transmit/receive logic

* drivers/xbee: Fixes xbee_netdev to match logic in mac802154_netdev.c

* drivers/xbee: Rearranges logic to prevent a loop condition where recursion could potentially occur to the point of deadlocking the system

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-15 14:37:55 +00:00
Anthony Merlino
9af6b7cdae Squashed commit of the following:
Merged in merlin17/nuttx/mac802154-sock (pull request #479)

    wireless/ieee802154: Adds support for receiving MAC events via IOCTL through socket interface. Other small fixes and cleanup

    * ioctl: Cleans up MAC802154IOC values
    * wireless/ieee802154: Cleans up MAC802154IOC_NOTIFY_REGISTER logic in character driver
    * wireless/ieee802154/mac802154_netdev:  Adds support for MAC event notification via IOCTL
    * wireless/ieee802154/mac802154: Changes reset logic. No longer reset extended address.
    * wireless/ieee802154: Cleans up MAC802154IOC logic

        Moves MAC802154IOC from ieee802154_ioctl.h and renames ieee802154_ioctl.h to ieee802154_device.h since it only contains types relevant to the MAC char device now.

    * wireless/ieee802154/mac802154_device: Cleans up IOCTL logic for recent changes.
    * drivers/wireless/ieee802154/mrf24j40: Adds missing break in case statement
    * wireless/ieee802154/mac802154_netdev: Starts adding support for passing MAC events via IOCTL
    * wireless/ieee802154/mac802154: Fixes issue with receiver enable logic
    * wireless/ieee802154/mac802154: Fixes issue where extended address is cleared and not rewritten after radio reset
    * configs/clicker2-stm32/mrf24j40-mac: Enables RAMLOG and wireless driver logging
    * wireless/ieee802154/mac802154: Fixes poll logic meant to automatically choose address mode based on short address range.

    Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-15 08:04:38 -06:00
Gregory Nutt
0f04816b37 Trivial changes from review of last PR. 2017-09-14 14:55:50 -06:00
Florian Olbrich
6f57d1d472 lis3dsh.c edited to obey the nuttx coding standard. 2017-09-14 20:29:41 +00:00
Florian Olbrich
b1e625eacb Added initialization code and Kconfig entries to set up the LIS3DSH accelerometer
driver on STM32F4Discovery rev. C boards and attach the associated interrupt callback.

Added the argument parameter (FAR void *arg) to the interrupt handler provided by the LIS3DSH
driver to fit the definition for ISRs in xcpt_t.

Changed the check for working queue availability in lis3dsh interrupt handler to use work_available()
and not crash in case of an overrun.
2017-09-14 20:03:28 +02:00
Gregory Nutt
278532eb44 drivers/video/fb.c: File offset is in units of bytes, not pixels. 2017-09-14 08:43:41 -06:00
Gregory Nutt
9b2a8e8c0e Rename CONFIG_AUDIO_DEVICES to CONFIG_DRIVERS_AUDIO to conform better to the evolving configuration naming standard. 2017-09-12 14:10:15 -06:00
Gregory Nutt
831ee3bb72 Rename CONFIG_VIDEO_DEVICES to CONFIG_DRIVERS_VIDEO to conform better to the evolving configuration naming standard. 2017-09-12 14:03:51 -06:00
Gregory Nutt
107866c00e sim/configs/fb: Add a configuration for non-graphical testing of the frambuffer character driver using apps/example/fb
drivers/video/fb.c and include/nuttx/video.fb.h:  Some improvements and fixes from early testing sith the sim/fb cnofiguration.
2017-09-12 09:48:47 -06:00
Gregory Nutt
d76a541a57 Trivial, cosmetic 2017-09-11 19:22:49 -06:00
Gregory Nutt
acfa706df3 drivers/video/fb.c: Remove some logic that is not currently used. 2017-09-11 17:55:04 -06:00
Gregory Nutt
f3fc9c0d03 drivers/video/fb.c: Add support for LCD drivers that use a simulated framebuffer and must receive explicit notification when there is an update to a region in the framebuffer. 2017-09-11 16:43:12 -06:00
Gregory Nutt
bf33f1d63e Squashed commit of the following:
drivers/video/fb.c:  Framebuffer driver is code complete but as of yet untested.
    drivers/video/fb.c:  Add framebuffer character device.  This is basically only the framework for the driver; a lot of logic is still missing.
2017-09-11 16:26:18 -06:00
Gregory Nutt
7fbceacb46 Mark an untested driver as EXPERIMENTAL in its Kconfig; Update some comments. 2017-09-11 09:35:39 -06:00
Mateusz Szafoni
2ffc2ab875 Merged in raiden00/nuttx (pull request #480)
Master

* smps.c: fix error messages

* stm32f33xxx_hrtim.h: fix definition

* stm32_hrtim: fix pclk calculation

* stm32_hrtim.c: cosmetics

* smps.h: cosmetics

* add upper-half driver for high power LED driver (powerled)

* stm32f334-disco: beginning of lower half driver for high power LED (powerled)

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-10 17:43:20 +00:00
Gregory Nutt
334d1734dc 6LoWPAN/Radio: Rename radio property sp_pktlen to sp_framelen. Add 6LoWPAN utility to get the max frame length (not yet hooked in) 2017-09-10 10:13:33 -06:00
Gregory Nutt
e7ce9c4a79 sem_open() should return SEM_FAILED on any failures. This is change change in the POSIX specification since the original sem_open() was written so many years ago. 2017-09-08 10:14:51 -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
Mateusz Szafoni
daac3bd7f8 Merged in raiden00/nuttx (pull request #476)
Master

* stm32_dac.c: fix compilation when DMA disabled for channel

* smps.h: update some comments

* smps.c: more sanity checks

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-02 19:52:21 +00:00
Jussi Kivilinna
03a3aca774 drivers/bch: add poll support 2017-09-01 07:54:49 -06:00
Gregory Nutt
8e6c78f425 Fix last commit. It violates the NuttX coding standard because it is not C89 compliant. 2017-08-30 13:44:13 -06:00
Oleg Evseev
18f4dcffa8 Eliminate unused variable warning. 2017-08-30 08:46:48 -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
Gregory Nutt
88a87f8e3f 6LoWPAN: The original, Contiki-based design used only a single buffer for reassemblying larger packets. This could be a problem issue for hub configurations which really need the capability concurrently reassemble multiple incoming streams concurrently. These was also a design issue in that the reassembly buffer could be corrupted by outgoing packets. The design was extended to support multiple reassembly buffers, each associated with the reassembly tag and source address. This assures that there can be be no corruption of the reassembly once it has started. 2017-08-26 10:00:47 -06:00
Juha Niskanen
cc1f7a63fa power: add driver for TI bq2429x battery charger. TODO: Untested. Does not have poll() support. 2017-08-25 07:26:00 -06:00
Gregory Nutt
e341c74f06 drivers/audio: Fix naming of configurations to be compliant for vs1053 audio driver. One file was not saved before last commit. 2017-08-24 11:12:10 -06:00
Gregory Nutt
53ef64aae6 drivers/audio: Fix naming of configurations to be compliant for vs1053 audio driver. 2017-08-24 11:11:06 -06:00
Gregory Nutt
5129aeefd5 drivers/sensors: Fix remaining naming of configurations to be compliant for two more drivers. 2017-08-24 10:48:20 -06:00
Gregory Nutt
dc8f3778a9 drivers/sensors: Fix more naming of configurations to be compliant for two more drivers. Still a few more to go. 2017-08-24 10:26:53 -06:00
Gregory Nutt
1f023fa31a drivers/sensors: Fix more naming of configurations to be compliant for two more drivers. Still a few more to go. 2017-08-24 10:10:00 -06:00
Gregory Nutt
269107afc8 drivers/sensors: Make naming configuration compliant for two more drivers. Still several to go. 2017-08-24 09:54:23 -06:00
Gregory Nutt
7f4af7b690 drivrs/sensors: Make a few other configuration settings consistent with the (undocumented) standard. 2017-08-24 09:45:46 -06:00
Gregory Nutt
5dd25bbfde Missed two naming changes in last commit 2017-08-24 09:32:24 -06:00
Gregory Nutt
9e386e3b31 drivrs/sensors/hts221: Fix inconsistent configuration variable naming; Try to bring closer to an as-of-yet undocumented naming convention. 2017-08-24 09:22:36 -06:00
Anthony Merlino
fbf830aef2 drivers/wireless/spirit: Fixes a pre-processor directive 2017-08-22 21:15:22 -04:00
Jussi Kivilinna
a099506b1b drivers/lcd: ssd1306: separate lcd_dev_s setup to separate object. g_oleddev takes 1 KiB because framebuffer and was allocated to .data section because of lcd_dev_s function pointer setup. Move lcd_dev_s setup out, so that g_oleddev goes to .bss and avoid wasting ROM. 2017-08-22 08:46:00 -06:00
ussi Kivilinna
89cc4741ac drivers/lcd: ssd1306: fix memory corruption caused by ssd1306_getrun(). ssd1306_getrun was writing one extra byte (with value 0) past target buffer when pixlen is multiple of 8. When pixlen was not multiple of 8, last byte of buffer was fully cleared, instead of modifying only the (pixlen % 8) bits of last byte. 2017-08-22 08:42:40 -06:00
Jussi Kivilinna
3dfeb9e59f drivers/lcd: ssd1306: add support for board power control. ThingseeOne has regulator for controlling display power on/off. Patch adds support for board based power control to SSD1306 driver. 2017-08-22 08:40:27 -06:00
Jussi Kivilinna
310a29227a drivers/lcd: add DD-12864WO-4A/SSD1309 support to SSD1306 driver 2017-08-22 08:32:52 -06:00
Pekka Ervasti
cc0fea60ad drivers: analog: comp: add poll support 2017-08-22 06:26:57 -06:00
Gregory Nutt
67befb9642 ENC28J60: Update interface to use newer parameter passing to interrupt handlers 2017-08-21 16:49:43 -06:00
Gregory Nutt
241c1433ef ENCX24J600: Fix some warnings. Update interface to use newer parameter passing to interrupt handlers 2017-08-21 16:23:22 -06:00
Gregory Nutt
969d7c5814 Networking: Remove driver based backlog support. This affects the entire network, but is used by only one driver. The only supported with of supported RX backlog is via common read-ahead buffering. 2017-08-21 06:28:59 -06:00
Gregory Nutt
30c51a49a5 drivers/net/tun.c: Currently cannot support TAP mode unless Ethenet is enabled 2017-08-20 12:01:38 -06:00
Gregory Nutt
1334ab3d2a IP forward: Correct some compile issues due to recent changes. 2017-08-20 11:46:43 -06:00
Gregory Nutt
6919fb85e4 6LoWPAN/PF_IEEE802154: Created radiodev.h and renamed various structures to provide a better separation between 6LoWPAN and PF_IEEE802154. 2017-08-20 07:10:48 -06:00
Gregory Nutt
cff4ac6845 Squashed commit of the following:
commit 2a3ab1652a2c95bcfc8be8380fc7cbdcb6472938
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Aug 19 08:44:31 2017 -0600

    PF_IEEE802154: Finish some missing bind() logic.  Add configs/sim configuration for testing.

commit 59be4b846a6e3bfe82087a888e3fdac9c3c414e5
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 19:30:04 2017 -0600

    PF_IEEE802154:  More renaming to decouple 6LoPAN from radios in general.

commit 69fabb1aea76e54381bdc13de28a3f1441fb42f4
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 19:21:11 2017 -0600

    PF_IEEE802154: Missed a few renamings.

commit ff0af1bb25567720934cc1c2a721ccd92cc35f89
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 17:46:58 2017 -0600

    PF_IEEE802154:  A few bugfixes

commit 01c7c84afd00cf907d280d30cfaf0fb2cf90e02e
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 17:01:31 2017 -0600

    PF_IEEE802154:  A few bugfixes

commit dcef4056d1c1488c93151135f3b7106977faa903
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 16:31:05 2017 -0600

    PF_IEEE802154: Bring in framework for sendto/recvfrom.  Currently just a crude port of functions from net/pkt and do not provide the implemenation needed.

commit 68c5b7b6dd3ab7eb2d0c19890abb38e6561b140e
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 15:18:31 2017 -0600

    Trivial fix to typo in comment

commit fd0af534c089569ccdbd59f13b85453de0a653ad
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 15:07:20 2017 -0600

    PF_IEEE802154: Add device lookup logic; Rename some things that used to be used only by 6LoWPAN but now must be shared with PF_IEEE802154 and need more generic naming.

commit 4fc80a1659f1c699b050775cefc7f6b631b46114
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 13:49:54 2017 -0600

    PF_IEEE802154: Add driver poll logic.

commit d83f71992df8764faa93f9425f1a7602a758f730
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 13:28:59 2017 -0600

    PF_IEEE802154:  Add frame input function.

commit 77561b8c4d5d7be1f8d8eb62cf1a07229afe2048
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 12:46:29 2017 -0600

    PF_IEEE802154: Socket type should be SOCK_DGRAM.  Hook in socket interface.

commit c0f90350282e9905d7f26a1b30f04cc6d6794648
Merge: 8b518abfd0 169c55e546
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 09:36:32 2017 -0600

    Merge remote-tracking branch 'origin/master' into pf_ieee802154

commit 8b518abfd07d492f5148f2c5fdf65604de9822da
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 09:35:39 2017 -0600

    PF_IEEE802154: Add initialization and connection management logic.

commit 98b62620b3cb420041d8ad14204f9410a8aace8c
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 07:52:51 2017 -0600

    PF_IEEE802154: Add basic build support and socket interface framework.
2017-08-19 08:48:52 -06:00
Alan Carvalho de Assis
1048a3b871 drivers/sensors/hc_sr04.c: Replace busy wait with semaphone. Using this solution we don't need 60ms delay. 2017-08-18 09:44:38 -06:00
Alan Carvalho de Assis
50e2e08742 drivers/sensors: Add support to HC-SR04 distance sensor 2017-08-17 18:52:54 -06:00
Gregory Nutt
a703ed76af Clicker2: Configure EDBG SPI CS just to make that it is disabled 2017-08-15 18:21:10 -06:00
Gregory Nutt
8033f8ae5b SAMv71-XULT: Fix MRF24J40 interrupt GPIO number. 2017-08-15 11:43:31 -06:00
Gregory Nutt
28637e644d Eliminate warning of unused global variables in certain configurations. 2017-08-12 16:33:34 -06:00
Gregory Nutt
4fa6106b57 Fix some compile problems found in build testing. 2017-08-12 14:28:27 -06:00
Gregory Nutt
6c4405561a Fix a few compile errors and warnings found in build testing 2017-08-12 10:27:55 -06:00
Gregory Nutt
7bb8943a9c Fix IPv6 loopback driver that depended on the removed g_ipv6_allonesaddr. Noted by Masayuki Ishikawa 2017-08-09 06:59:55 -06:00
Gregory Nutt
aeb59383cf Remove CONFIG_NET_MULTILINK. This increases code size by a little, but greatly reduces the complexity of the network code. 2017-08-08 15:26:09 -06:00
Gregory Nutt
bd7c84b23e Remove CONFIG_NETDEV_MULTINIC. This increases code size by a little, but greatly reduces the complexity of the network code. 2017-08-08 14:24:12 -06:00
Gregory Nutt
f3f522514e libm: Eliminate a warning from lgamma(); Update some comments; Add some logic to handle broadcast better -- Currently conditioned out because it does not work. 2017-08-08 12:08:43 -06:00
Gregory Nutt
09f31d1371 Spirit Radio: Add support for CSMA backoff count reached interrupt. 2017-08-08 10:34:51 -06:00
Gregory Nutt
79400ea960 B-L475-IOT01A: Enable UDP broadcast test in the spirit-starhub configuration. 2017-08-08 08:32:41 -06:00
Gregory Nutt
572cf51fa4 Networking: Rethink IPv6 all-nodes packet routing. 2017-08-08 07:48:07 -06:00
Gregory Nutt
6e3ced4111 Spirit: Make error handling for discarded packets match other RX failure interrupts. 2017-08-07 13:52:42 -06:00
Gregory Nutt
1ac4848686 Spirit bugfixes: Was hanging occasionally because there was not mechanism to restart the poll timer if poll was not performed because Spirit ws busy. Fixed by not checking if Spirit is busy. The TX poll can be performed asynchronouly while spirit is busy; any outgoing data will queued until Spirit is ready. Fixed handling of a timeout condition. Failure to transmition to the TX state would fail (timeout) if in a race condition Spirit already committed to the RX state. The driver needs to recover the state properly and avoid debug assertions in this event. 2017-08-07 09:22:16 -06:00
Gregory Nutt
e57a5755cc TX timeout must also be cancelled on a TX error. TX timeout should check if we are waiting for a TXto complete. TX timeout was too short (short than the maximum number of retries). 2017-08-06 16:56:02 -06:00
Gregory Nutt
bbf1ad4ea6 Spirit network driver: TX timeout was never being cancelled! Also reviewed and cleaned up all error handling logic 2017-08-06 15:40:37 -06:00
Gregory Nutt
48a507c0b7 6LoWPAN: When obtaining the radio MAC address from the IP address, handle the special case of broadcast and multicast address. 2017-08-06 13:50:48 -06:00
Simon Piriou
b1f50490bd MTD: Add driver for Macronix QuadSPI flash memory 2017-08-06 10:51:17 -06:00
Gregory Nutt
84001f79a0 Spirit Network Driver: Add support for watermark interrupts on RX FIFO. Reduce max packet length to avoid an errata. 2017-08-06 10:10:55 -06:00
Gregory Nutt
3b1e2ac4fd Spirit network driver: Restructure threading to reduce locking. Still get a few RX FIFO errors. 2017-08-06 08:26:51 -06:00
Gregory Nutt
2947ca06c9 Avoid some harsh, inappropriate DEBUGASSERT's. 2017-08-05 12:32:31 -06:00
Gregory Nutt
a29a168086 Spirit + 6LoWPAN: In STAR configuration, Spirit must use a configured well known hub address. 6LoWPAN cannot assume that the PAN coordinator is the STAR hub; it must ask the radio to provide it with the address of the star hub 2017-08-05 09:13:29 -06:00
Gregory Nutt
c2fbef2062 b-l475e-iot01a: Add configurations to support a star topology. 2017-08-05 07:53:55 -06:00
Gregory Nutt
5d96385c52 Spirit: Increase number of retries if there is no acknowledgement; Add interrupt handling for the case where the max number of retries expires. Fix some badly implemented queue management code. With these changes the basic UDP and TCP tests work. 2017-08-04 15:20:10 -06:00
Gregory Nutt
8027d1bf18 Spirit: Enable AutoACK, TX retries, and RX timeouts in the network driver. 2017-08-04 13:16:07 -06:00
Gregory Nutt
0d551cd0ac Spirit: Convert network driver to use STack packets vs. Basic packets. We need to use the STack packets in order to provide the source address. 2017-08-04 12:19:59 -06:00
Gregory Nutt
df51b69895 Spirit: Commit some trivial changes in preparation for a more substantial change. 2017-08-04 12:19:59 -06:00
Gregory Nutt
733d96cf81 Spirit: Correct setting of the length width field; Add multicast and broadcast addresses to radio properities. 2017-08-04 12:19:59 -06:00
Gregory Nutt
f6ebcc2220 Spirit network driver: Need to enable sending of TX address. Moved some non-optional settings out of board.h to driver. 2017-08-04 12:19:58 -06:00
Gregory Nutt
e8738e1f55 Minor update to some comments. 2017-08-04 09:00:58 -06:00
Gregory Nutt
bbc06dcd8e RAMTRON: Should be able to select chunked write mode via a configuration option, not by editing the file. 2017-08-04 08:49:07 -06:00
Boris Astardzhiev
79ee0a5209 RAMTRON: Add support for splitting block writes in chunks. Some Re-RAMs like MB85AS4MT has a write buffer size limitation. 2017-08-04 08:12:59 -06:00
Jussi Kivilinna
9fc5f44ef6 syslog: CONFIG_CLOCK_MONOTONIC 2017-08-04 08:02:52 -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
Gregory Nutt
36e7a18181 spirit: Modify reg needs to toggle CS to get the correct status. Remove some delbug left in last commit. make sprit_unlock an inline function. 2017-08-03 15:15:15 -06:00
Gregory Nutt
d2b5078e01 Spirit: Mostly cosmetic fixes to names and comments. Tx timeout should run on the HP work queue. 2017-08-03 11:47:38 -06:00
Gregory Nutt
76c9ef4844 Spirit: Fix a few RX-related issues. 2017-08-03 11:08:33 -06:00