Commit Graph

2639 Commits

Author SHA1 Message Date
Gregory Nutt
ac40630452 wireless/ieee802154: Fix a warning found in build testing. Mouse input: Cosmetic changes while reviewing logic. 2017-11-03 09:21:19 -06:00
Gregory Nutt
f3286d83e7 Costmetic 2017-11-02 19:17:33 -06:00
Gregory Nutt
29309e63aa Eliminate some warnings from building testing. 2017-11-02 17:27:48 -06:00
Gregory Nutt
e52bc92238 drivers/mtd/filemtd.c: Don't use file descriptors... Use the internal file system interfaces so that the loop device can be shared across threads. 2017-11-02 17:07:08 -06:00
Gregory Nutt
f9e7b84727 drivers/loop: Don't use file descriptors... Use the internal file system interfaces so that the loop device can be shared across threads. 2017-11-02 16:31:56 -06:00
Frank Benkert
c6942f6137 drivers/serial/serial.c: Optimize wait time in tcdram() for buffer emptying
According to the specification, the close function must wait until all data
has been written before it closes the file (except O_NONBLOCK is set). The
maximum waiting time for this is not specified.

To be able to edit the file list of the process, the close function has to lock
the file list semaphore. After that the close function of the serial driver is
called.

Waiting for the complete transmission of all data is done in the serial driver.
This causes the semaphore to remain locked until all data has been sent.
However, no other thread of the process can edit the file list for that time
(open, close, dup2, etc.). This is not optimal in a multithreaded environment.
Therefore, we have to keep the waiting time within the driver as short as possible.
2017-11-02 08:53:14 -06:00
Anthony Merlino
14fb37c995 Merged in antmerlino/nuttx/sixlowpan-mac802154 (pull request #526)
ieee802154: Simplifies notify() and rxframe() calls to a single notify() call. dataind's and all other "notifs" are now "primitives" which aligns with standard terminology

* mac802154: Adds missing breaks from case statement

* sixlowpan: Fixes bad logic where ACK is not requested if address is not a broadcast

* ieee802154: Simplification of "notifs" and "datainds" to generic primitives passed via a single notify call to the layer above the MAC

* Directories.mk should reference CONFIG_WIRELESS instead of CONFIG_DRIVERS_WIRELESS

* xbee_netdev: Network must be locked when calling sixlowpan_input

* sixlowpan: Reassembly buffer can't be freed if provided by radio driver

* sixlowpan: Don't free IOB if there is an error processing it as the MAC will try to pass it along to another receiver

* ieee802154: Adds basic logging to ieee802154_primitive.c

* Minor fixes after rebase

* xbee: Adds AT query timeout to retry if XBee doesn't respond to request

* same70-xplained: Adds Xbee support. Makes mikroBus slot Kconfig 'choice'

* mac802154: Removes unused function declaration

* drivers/mrf24j40: Fixes compilation error using . operator rather than -> operator

* mac802154_device: Changes a few mac802154_primtive_free's to ieee802154_primitive_free() and changes notif to primitive in a couple places.

* mac802154: Adds promiscous mode logic to bypass parsing of incoming frames. MAC char device also checks for promiscous mode and passes whole frames including header and FCS to the application if promiscous mode is enabled.

* sixlowpan: Fixes logic to correctly check if packet is large enough to include header.  This would cause packets to be considered too small when they are sufficiently sized.

* sixlowpan: Fixes forwarding logic to use forwarding device rather than received device to look up destination link layer address

* net/ipforward: Fixes typo that caused build error when IP forwarding was enabled with CONFIG_NET_ICMPv6_NEIGHBOR enabled as well.

* configs/same70-xplained: Simple spelling fix

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-01 20:15:21 +00:00
Anthony Merlino
02721f9d95 net/icmpv6: Add some header file necessary for correct build.
drivers/wireless/ieee80211:  Fix typos and spelling errors as needed for Photon build.
2017-11-01 06:58:33 -06:00
Dmitriy Linikov
61372551e9 Merged in hardlulz/modem-3.0-nuttx/fix-stmpe811-gpio (pull request #523)
Fix GPIO operation of STMPE811 driver.

Fixed issues:
1. STMPE811_GPIO_DIR was defined for register name
   and later was redefined to be the pin direction mask
   for `stmpe811_gpioconfig`

   I decided to change register name to be STMPE811_GPIO_DIR_REG,
   and keep pin direction mask STMPE811_GPIO_DIR, so that any
   external code that already use this driver will be unchanged.

2. The STMPE811 register GPIO_DIR uses bit value 1 for output
   and 0 for input, but `stmpe811_gpioconfig` set the opposite.

3. The call to `stmpe811_gpiowrite` from inside of `stmpe811_gpioconfig`
   leaded to deadlock.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-31 16:54:28 +00:00
Gregory Nutt
cfc5f8fbaf drivers/net: Remove the old, unfinished Crystal LAN driver. I don't even have the hardware that it goes with anymore. 2017-10-28 10:27:00 -06:00
Alan Carvalho de Assis
b5f6d6c4f7 drivers/can/mcp2515.c: Fix BRP for SET_BITTIMING ioctl as well 2017-10-27 06:15:54 -06:00
Jussi Kivilinna
0ea4d2a11d sensors/lis2dh: fix use of obsolete dbg macro 2017-10-27 06:13:14 -06:00
Alan Carvalho de Assis
b0ce7753aa drivers/can/mcp2515.c: Fix the MCP2515 Bit Rate Prescale calculation. 2017-10-27 06:11:37 -06:00
Jussi Kivilinna
e557c3e8d5 drivers/sensors/lis2dh: fixes for self-test 2017-10-26 09:25:20 -06:00
Gregory Nutt
70c59a9d91 This commit adds support for semi-standard IPPROTO_ICMP6 sockets. This is a replacement for the non-standard ICMPv6 ping support that violated the portable POSIX OS interface.
Squashed commit of the following:

    net/icmpv6: IPPROT_ICMP6 socket logic now builds without error.
    net/icmpv6:  Add support for read-ahead and poll(). Initial commit is just cloned from ICMP with the appropriate name changes.
    configs/:  All defconfig filess that include CONFIG_NET_ICMPv6_SOCKET=y need to select CONFIG_SYSTEM_PING6=y and deselect CONFIG_DISABLE_POLL.
    Update NSH documention to show that ping6 is now a built in command.
    net/icmpv6:  Add icmpv6_sendto.c and icmpv6_recvfrom.c.  Initial versions are just clones from icmp/ with appropriate name changes.
    net/icmpv6:  Clone some ICMP socket logic as the beginning of support for ICMPv6 socket support.
    Rename CONFIG_NET_ICMPv6_PING to CONFIG_NET_ICMPv6_SOCKET.  Move prototype for icmpv6_ping from include/nuttx/net/icmpv6 to net/icmpv6/icmpv6.h
2017-10-24 11:23:08 -06:00
Gregory Nutt
fc0a5e19d0 drivers/bch: The character driver to block device access now supports an IOCTL to get the geomtry of the underlying block device. 2017-10-20 11:36:44 -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
Alan Carvalho de Assis
0be36a6ac1 drivers/sensors/apds9960.c: Use work_queue to read/process data when receive an IRQ 2017-10-20 08:54:44 -06:00
Jussi Kivilinna
fe9be72bec drivers/sensors/hts221: power-on sensor for loading calibration data 2017-10-20 08:33:44 -06:00
Alan Carvalho de Assis
3268a6ac5f drivers/sensor: Add driver for the APDS-9960 gesture sensor 2017-10-20 06:37:38 -06:00
Gregory Nutt
bc40403516 There was a reference counting problem in the TPC logic of net_clone(). net_clone() which is the common logic underlying dup() and dup2() for sockets. When net_clone() calls net_start_monitor() and net_start_monitor() returns a failure (because the underlying TCP connection) then net_clone() must back out the reference count on the structure. Problem noted by Pascal Speck and this implementation of the solution is based on his suggestion. 2017-10-19 11:09:23 -06:00
Jussi Kivilinna
5ef548677a drivrs/mtd/filemtd.c: add block device MTD interface. Block MTD interface allows using block device directly as MTD instead of having to use file-system in between. NOTE that this provides the opposite capability of FTL which will let you use an MTD interface directly as a block device. 2017-10-19 09:53:41 -06:00
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