Commit Graph

3788 Commits

Author SHA1 Message Date
Gregory Nutt
49644be9a5 include/nuttx/wireless and wireless/bluetooth: Add support for an IOCTL command to enable Bluetooth security. 2018-04-02 17:34:41 -06:00
Gregory Nutt
9d3a06e55d include/nuttx/wireless: Remove const from some members of IOCTL structures. The const makes it awkward to initialize the structure. 2018-04-02 14:42:01 -06:00
Gregory Nutt
bf23588a41 include/nuttx/wireless: Another correction to a Bluetooth IOCTL command structure. 2018-04-02 14:20:01 -06:00
Gregory Nutt
15c7886fad include/nuttx/wireless: All Bluetooth IOCTL command data must begin with the interface name string. 2018-04-02 13:03:46 -06:00
Gregory Nutt
4ee0917789 wireless/bluetooth: Completes basic Rx/Tx data paths. Still missing: device address discovery and pairing logic. 2018-04-02 06:38:31 -06:00
Gregory Nutt
5dd11f465b net/bluetooth: Add support for connection to any address and any channel. 2018-04-01 17:53:07 -06:00
Gregory Nutt
aae0d92598 wireless/bluetooth and net/bluetooth: Clean up some garbage left in Kconfig file that broke 'make menuconfig'. Clean up some craziness with Bluetooth frame length definitions. 2018-04-01 15:21:58 -06:00
Gregory Nutt
7e05d5e9c7 wireless/bluetooth: Adds most of the logic to get the Tx path working. Still missing the logic to recover the Bluetooth connection structure given the destination address in the socket address. 2018-04-01 14:00:40 -06:00
Gregory Nutt
29a4a80f8c Squashed commit of the following:
wireless/bluetooth:  This completes the basic logic path that gets frames from the Bluetooth stack and into the network layer.
    wireless/bluetooth:  Fleshes out some of the network packet receive logic.
    wireless/bluetooth:  Replace buffer allocated with primitive allocator from ieee 802.15.4.
    wireless/ieee802154:  Fix a few typos.
    wireless/bluetooth:  More renaming in preparation for some real work.
    wireless/bluetooth:  Some trivial renaming; update comments
2018-04-01 12:25:30 -06:00
Gregory Nutt
f7bcad502a Bluetooth: Bring in some definitions from NetBSD. Update some usage and naming to be more consistent. 2018-03-31 16:31:51 -06:00
Gregory Nutt
0c007be4bd This comment adds (1) basic support for AF_BLUETOOTH sockets. The logic compiles but is still incomplete. Support for Bluetooth is general is still dependent on CONFIG_EXPERMIMENTAL because it is not yet ready for used.
Squashed commit of the following:

    wireless/bluetooth:  Some small changes that gets to a clean compile by just eliminating some incorrect implementations (still with a lot of warnings.  The logic is still incomplete but now not so lethal.
    wireless/bluetooth:  Restructuring:  Connection interfaces should internal to wireless/bluetooth.  include/nuttx/wireless/bt_conn.h removed and merged with wireless/bluetooth/bt_conn.h.  Several fix to get closer to bt_netdev.c compiling.  Need to design some not interfaces and use some existing interfaces to send and receiv packets.
    wireless/bluetooth: Some organization with some network device compile errors fixed.  Still not even close to compiling.
    net/bluetooth:  Fix numerous compile issues; Still open design issues with regard to the interface with the Bluetooth stack.
    wireless/bluetooth:  Create bt_netdev.c with a crude copy of mac802154_netdev.c.  Does not not even compile yet.
    include/nuttx/net:  Add bluetooth.h.  Content is not yet correct.
    net/netpackets:  Add bluetooth.h.  Update net/bluetooth to use new socket address definition.
    net/bluetooth:  Some fixes for initial build.
    net/bluetooth:  Add initial support for Bluetooth sockets.  The initial cut is just the a clone of the IEEE 802.15.4 socket support with name changes.
    net/ieee802154:  Fix some typos noted when cloning to create net/bluetooth.
2018-03-31 14:55:03 -06:00
Gregory Nutt
2796b0245c net/ieee802154 and include/net/ieee802154: Fix a few more trivial typos. 2018-03-30 15:20:51 -06:00
Gregory Nutt
d62649757c wireless/bluetooth and include/nutt/net: Add support for Bluetooth IOCTL commands. 2018-03-30 10:50:44 -06:00
Gregory Nutt
380d558795 Adds re-architected Bluetooth UART driver from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
Squashed commit of the following:

    drivers/bluetooth:  Re-architect Bluetooth UART driver to follow upper/lower half model.  Completely untested.
    drivers/bluetooth:  Grr..  Another band-aid commit to stay in sync with master.  Why is this so difficult
    drivers/bluetooth:  Band-aid commit to stay in sync with master.  Lost it somehow.
    drivers/wireless/bluetooth:  A few changes, mostly thought experiments.
    drivers/wireless/bluetooth:  UART-based Bluetooth driver ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package.  This initial commit is the original files in the NuttX build environment with changes to conform with the coding standard.  It should not even build.
2018-03-29 18:36:03 -06:00
Gregory Nutt
aaf5fee1e6 wireless/bluetooth: Add driver object in all driver methods so that the driver has a way of maintaingin context. 2018-03-29 15:12:00 -06:00
Gregory Nutt
accef0ca9e This commit brings in the Bluetooth stack from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
NOTE: This selection is marked EXPERIMENTAL.  It is incomplete and, hence, untested.  It still lacks any low-level Bluetooth drivers and is missing the network interface driver.

Squashed commit of the following:

    wireless/bluetooth:  Fixe last of compile issues.  Now compiles without errors or warnings.
    wireless/blutooth:  Add macros BT_GETUINT16() and BT_PUTUINT16().  Fix more compile errors.  Only one file now generates compile errors.
    wireless/bluetooth:  Add macros BT_LE162HOST() and BT_HOST2LE16().
    wireless/bluetooth:  Add bt_queue.c; begin fixing comple errors.  Many more compile problems yet to resolve.
    Kconfig edited online with Bitbucket
    wireless/bluetooth:  Struggling to remove nano_fifo logic:  Replace buffer management with IOB allocate... this changes some logic and might have some side effects.  Use messages queues instead of nano-fifos to inter-task communications.  nano-fifos still used in 'frag' logic... whatever that is.
    wireless/bluetooth:  Fix numerous typos introduced by an ill conceived search-and-replace.
    wireless/bluetooth:  Add message queue support to manage interthread buffer transfers.
    wireless/bluetooth:  Replace fibers with kernel threads.
    wireless/bluetooth:  Fix a few initial compile errors.  Just the tip of the iceberg.
    wireless/bluetooth:  Complete leveage of the bluetooth stack including public header files.
    wireless/bluetooth:  Complete leverage of all Bluetooth source files.  Still missing header files that defines the driver interface.  Also missing the network driver implementation.
    wireless/bluetooth:  Fix some naming of static global variables.
    wireless/bluetooth:  Adds three more files ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package (plus two original files).
    wireless/bluetooth:  Adds five more files ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
    wireless/bluetooth:  Adds three more files ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
    wireless/bluetooth:  First few files ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
2018-03-29 12:39:22 -06:00
Anthony Merlino
ec4bb7b990 Merged in antmerlino/nuttx/mac802154_ackhandling (pull request #619)
mac802154: Adds ackreq flag to TX descriptor for use by radio driver.

The radio layer is responsible for a full "transaction". Because of
differences in radio capabilites, the radio must be responsible for
the handling of acks and retransmissions. This commit simply passes
the ackreq meta-data flag along to the radio.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-03-28 15:50:11 +00:00
Masayuki Ishikawa
d393f43caa Merged in masayuki2009/nuttx.nuttx/network_test (pull request #617)
Fix some bugs in networking

* netdb: Fix boundary conditions in dns_recv_response()

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* Fix typos in include/nuttx/net/dns.h

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-03-27 01:31:06 +00:00
Juha Niskanen
0f03ffc745 STM32, STM32L4: add one bit read and write to 1-wire interface. This is needed for devices that require single bit timeslot generation and for 1-Wire search algorithm triplets. 2018-03-23 08:07:20 -06:00
Juha Niskanen
4e4229a8ef i2c/i2c_master.h: Change incorrect comment about I2C_TRANSFER return value to indicate that the method returns zero on success rather than the number of bytes transferred. 2018-03-22 06:51:09 -06:00
Gregory Nutt
22484386ee fs/cromfs and tools/gencromfs: Various fixes for traversal relative file paths. Biggest changes is in types used: Cannot use size_t or mode_t in common structures because they have different sizes on the (64-bit) host and the (32-bit) target. Use uint32_t instead of size_t for offsets. Use uint16_t instead of mode_t. 2018-03-20 12:37:01 -06:00
Juha Niskanen
2d4ad03d2c include/nuttx/fs/dirent.h: Fix CROMFS-related compilation error. 2018-03-20 06:38:53 -06:00
Gregory Nutt
278cc6f70a libc/lzf: Fix some typos in code that was in conditional logic that was not building. Change a literal use of 13 to HLOG which used to be 13. 2018-03-19 16:50:45 -06:00
lihaichen
6538e4750f drivers/wireless: Fix some issues in the CC1101 driver; Update the CC1101 chip version number 2018-03-19 09:25:41 -06:00
Gregory Nutt
0478b5bce4 Addes CROMFS prototype. CROMFS is a commpressed, in-memory read-only file system based on LZF.
Squashed commit of the following:

    fs/cromfs:  Now depends on EXPERIMENTAL because it is not yet verified.
    fs/cromfs:  This commit brings the CROMFS file system to code complete.  Still completely untested.  Next steps:  Need a tool to generate CROMFS file system images and a test case under apps/
    fs/cromfs:  Add logic to traverse the in-memory file system nodes.
    fs/cromfs:  Add initial support for an in-memory, compressed, read-only file system.
2018-03-19 07:08:40 -06:00
Gregory Nutt
ed59157a4b libc/lzf: Define structures to represent LZF headers. 2018-03-18 12:31:50 -06:00
Boris Astardzhiev
6cd607c298 libc/lzf: Refactor so that the user is no longer required to generate the LZF header 2018-03-16 09:54:55 -06:00
Gregory Nutt
43ba19025d Update some function headers. 2018-03-15 09:19:26 -06:00
Gregory Nutt
0ab037e6b4 libc/lzf: lzf_compress() now expects the hash table as user allocated input parmeter rather than declaring the huge array on the stack. 2018-03-15 08:51:32 -06:00
Gregory Nutt
9acfbd2163 libc/lzf: Make HLOG configurable
(cherry picked from commit ea77dfafe1afe7d399e47871d2ec81fea99626cc)
2018-03-15 08:32:24 -06:00
Boris Astardzhiev
25eb417c12 libc/lzf: Add Marc Alexander Lehmann's LIBLZF3.6 librrary 2018-03-14 14:48:53 -06:00
Gregory Nutt
06e7533bb0 Update some comments. 2018-03-14 08:17:50 -06:00
Gregory Nutt
149f3bd471 Standardization of some function headers. 2018-03-13 09:56:16 -06:00
Gregory Nutt
b54ffe858a Standardization of some function headers. 2018-03-13 09:52:27 -06:00
Juha Niskanen
c268288c17 drivers/sensors: Add support for Sensirion SHT2x humidity sensor 2018-03-13 08:26:15 -06:00
Gregory Nutt
1a990f99d1 libc/time: Add an implementationof clock() 2018-03-13 08:07:29 -06:00
Gregory Nutt
e6e7dae05b sched/clock: Fix a recently introduced name collision 2018-03-12 13:36:06 -06:00
Gregory Nutt
251924a734 Squashed commit of the following:
net/tcp:  Add logic to send probes when SO_KEEPALIVE is enabled.
    net/tcp:  TCP socket should not have to be connected to configure KeepAlive.
    net/: Add a separate configuration to enable/disable KEEPALIVE socket options.
    net/tcp: Arguments to TCP keep-alive timing functions probably should be struct timeval as are the times for other time-related socket options.
    net/tcp:  Fix a backward conditional
    net/tcp:  Add some more checks and debug output to TCP-protocol socket options.
    net/tcp:  Cosmetic changes to some alignment.
    net/:  Adds socket options needed to manage TCP-keepalive and TCP state machine logic to detect if that the remote peer is alive.  Still missing the timer poll logic to send the keep-alive probes and the state machine logic to respond to probes.
2018-03-12 10:59:46 -06:00
Gregory Nutt
399b9860af Squashed commit of the following:
drivers/lcd/ft80x:  ACTIVE host command appears to be formatted differently than other host commands; Fix ROM CHIPID.  Appears to be big-ending, BCD.
    drivers/lcd/ft80x:  Fix some compile issues when debug features are enabled.
2018-03-09 12:32:59 -06:00
Juha Niskanen
d8311b6493 drivers/power: add pm_unregister 2018-03-06 07:59:17 -06:00
Gregory Nutt
cb31a37c69 Cosmetic changes from review of last PR. 2018-03-05 10:22:22 -06:00
Giorgio Groß
4d78593a0f Merged in ordsen/nuttx/feature-pca9540bdp-i2cmultiplexer (pull request #610)
Feature pca9540bdp i2cmultiplexer

* Implement common i2c multiplexer abstraction to be reused by i2c multiplexer devices. Provide common interface with transfer and reset calls to set up virtual i2c busses.

* Remove i2cmux_lower_half.c and headers, will be implemented by each mux driver

* Implement PCA9540BDP I2C multiplexer lower half which uses the common i2c mux abstraction

* Remove application interface and implement common i2c functions

* Remove application interface from pca driver and implement common i2c functions directly in the pca driver

* Use i2cerr

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-03-05 16:11:05 +00:00
Gregory Nutt
de6b13b3ab Per OpenGroup.org, syslog -- and, hence, nonstandard vsyslog, and debug wrappers -- does not return a value. Rename _vsyslog to nx_vsyslog. Use internal nx_vsyslog in the few cases where a return value is required. 2018-03-04 08:07:07 -06:00
Author: lihaichen
afe5f706f6 Squashed commit of the following:
cc1101:  Changes from review of last PR.
    remove gpio
    remove  cc1101 frame len
    remove FLAGS_RXONLY flags
    add cc1101 function
    remove some waring
    add cc1101 poll function
    add cc1101 register
    add cc1101 isr read data
    add cc1101 spi deviceId
    add cc1101 init2
    add wait cc1101 chip ready
    raw init cc1101
2018-03-03 08:53:51 -06:00
Gregory Nutt
8fe9e81183 drivers/lcd: Add FT80x controls for the case where the audio amplifier is controlled by FT80x GPIOs vs MCU gpios. 2018-02-27 08:45:34 -06:00
Gregory Nutt
dee0eda5ab include/lcd/ft80x: Add definitions stencil operations and midi sounds. 2018-02-26 15:24:41 -06:00
Gregory Nutt
df231a966a include/nuttx/lcd/ft80x.h: Add audio format definitions. 2018-02-25 17:12:39 -06:00
Gregory Nutt
8d2ce5387c Fix a trivial (but important) typo 2018-02-25 11:43:48 -06:00
Gregory Nutt
eeb40dc600 drivers/lcd: Extend FT80x touchscreen initialization; add more touchscreen-related definitions. 2018-02-25 11:18:35 -06:00
Gregory Nutt
b2d415da79 configs/viewtool-stm32f107: Add support for FT80X initialization. Add ft80x configuration that will eventually be used for testing the ft80x if I ever receive hardware. 2018-02-24 13:11:27 -06:00
Gregory Nutt
a903572ff6 drivers/lcd: Add and IOCTL command to fade the backlight on and off. 2018-02-23 10:44:10 -06:00
Gregory Nutt
8dc924f9ae include/nuttx/ldc: Add some FT80x blend-related definitions. 2018-02-22 12:30:02 -06:00
Gregory Nutt
38a258bf3b drivers/ft80x: Now supports reading/writing multiple regisers with single ioctl command. 2018-02-21 11:45:34 -06:00
Gregory Nutt
02df81bc5f Squashed commit of the following:
drivers/lcd:  Add an IOcTL to FT80x driver to write to FIFO CMD RAM.
2018-02-20 15:24:52 -06:00
Gregory Nutt
237ff11db7 Squashed commit of the following:
drivers/lcd and include/nuttx/lcd:  Add FT80x support for writing to graphics memory.  Also add some definitions needed by apps/examples/ft80x for bitmap manipulation.
    drivers/lcd:  Review/update FT80x initializatin logic
2018-02-19 13:08:50 -06:00
Sebastien Lorquet
9527f849f4 drivers/lcd: Detect and handle more errors in return values within the LCD framebuffer and SSD1306 drivers 2018-02-19 07:32:44 -06:00
Gregory Nutt
3d27adc7d1 include/nuttx/lcd: Add some FT80x definitions and modify some structures in order to support apps/examples/ft80x. 2018-02-18 16:49:12 -06:00
Gregory Nutt
2baa155791 drivers/lcd: In order to actually use the new register access IOCTL calls, need to move the register address definitions out of the private header file and into the public header file. 2018-02-18 13:45:20 -06:00
Gregory Nutt
65513d58e3 drivers/lcd: Add FT80x IOCTL commands to access individual registers. 2018-02-18 12:39:15 -06:00
Gregory Nutt
be73c65b64 drivers/lcd: Minor updates to FT80x initialization. 2018-02-18 11:04:29 -06:00
Gregory Nutt
eb3663721e Squashed commit of the following:
drivers/lcd:  Rename ft80x_base.c to just ft80x.c.  Add logic to notify FT80X clients of events via signals.
    drivers/lcd:  Trivial updates to naming.  Add some new definitions.
2018-02-17 18:30:24 -06:00
Gregory Nutt
758e94f7a7 drivers/lcd: Add FT80x interrupt framework. Interrupts are still not used by the driver. 2018-02-17 16:36:11 -06:00
Gregory Nutt
885ab75045 drivers/lcd: Add support for creating display lists incrementally. 2018-02-17 14:48:18 -06:00
Gregory Nutt
e4292dced8 drivers/lcd: Add unlink support to the FT80x driver. 2018-02-17 13:01:06 -06:00
Gregory Nutt
6a405ead67 This commit adds a barbones FTDI FT80x driver. It is untested (I don't even have hardware yet and, hence, it is marked as EXPERIMENTAL
Squashed commit of the following:

    drivers/lcd:  Finishes off basic FT80X.  Still missing some niceties.
    drivers/lcd: Rethink FT80X display list interface.
    drivers/lcd:  More FT800x display list logic.  Still not complete.
    drivers/lcd:  Add some basic FT80x initialization logic.
    drivers/lcd:  Add ft80x display list IOCTL framework.  Still missing low level display list operations.
    drivers/lcd:  FT80x driver cannot be a standard LCD driver but must, instead, be a custom character driver.
    drivers/lcd:  Add FT800 co-processor commands and display list helpers.
    drivers/lcd:  Add SPI interface and framework for the initialization and the basic LCD driver.
    drivers/lcd:  Add beginnings of some FT80x implementation.
    drivers/lcd:  Add definitions for the FTDI FT801 part
    include/nuttx/lcd/ft800.h:  Add initial FT800 interface definition.
    drivers/lcd:  Add ft800 header file.
2018-02-17 11:59:07 -06:00
Sebastien Lorquet
d040316143 include/lcd: Eliminate a warning from an SSD1306 header file by adding a forward reference to struct i2c_master_s. 2018-02-15 13:54:57 -06:00
Matt Thompson
75f68b9d3a Merged in extent3d/nuttx/lis3dh-fix (pull request #600)
LIS3DH: Fix missing shift when writing output data rate to register

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-02-14 20:27:48 +00:00
Sebastien Lorquet
abd3c4a7ea drivers/eeprobom: EEPROM driver for AT24xx compatible EEPROMs. 2018-02-14 07:53:01 -06:00
Gregory Nutt
e07f12954c Trivial changes from review of last PR. 2018-02-13 13:08:38 -06:00
Matt Thompson
e79e2e2d97 Merged in extent3d/nuttx/lis3dh (pull request #598)
Added support for LIS3DH accelerometer sensor.

* Added support for LIS3DH accelerometer sensor.

* Fix line length

* Fix more line lengthts

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-02-13 19:00:29 +00:00
Gregory Nutt
37c9b3d54a sched/sched: Implements a global scheduler lock capability as part of SMP support. This allows the scheduler to be locked with no knowledge or access to the TCB of the currently running task. This is necessary because accessing the TCB of the currenlty running task is, itself, a non-atomic operation. This global scheduler lock cpability was add just to support that atomic access to the TCB. 2018-02-05 13:12:36 -06:00
Gregory Nutt
5beab6fbf0 spin_lock_irqsave() and spin_unlock_irqrestore() are only valid if the CPU supports global disabling of interrupts. 2018-02-04 15:41:22 -06:00
Gregory Nutt
1e59d9dd14 armv7-a, armv7-r, armv7-m: Add atomic read-add-write and read-subtract-write functions. 2018-02-04 12:22:03 -06:00
Gregory Nutt
2683f713ab Make sure that labeling is used consistently in all function headers (part 3). 2018-02-01 12:17:03 -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
Stewart
be81893b55 arm/src/kinetis: Correct some Ethernet PHY register bit tests for the KSZ8081 PHY. 2018-02-01 07:24:36 -06:00
Gregory Nutt
50ca32e254 Squashed commit of the following:
sched/:  Convert legitimate uses of task_create() to nxtask_create().  Review handling of returned values from all uses of kthread_create() (as well as nxtask_create()).
    graphics/:  Review return values for all calls to kthread_start() because it no longer returns an errno.
    drivers/:  threads started by drivers should be kernel threads, not user tasks.  Review return values for all calls to kthread_start() because it no longer returns an errno.
    configs/:  threads started by board bringup logic should be kernel threads, not user tasksi (part 2 of 2).
    sched/task:  Add nxtask_create().  Kthread_create() and nxtask_create() are internal OS functions and should not modify the errno variable.  configs/:  threads started by board bringup logic should be kernel threads, not user tasks.
2018-01-31 16:11:54 -06:00
Gregory Nutt
da50646bcf sched/wdog: wd_start() is an internal OS function and should not set the errno value. Reviewed and updated every call to wd_start() to verify if return value is used and if so if the errno value is accessed. 2018-01-31 10:09:14 -06:00
Masayuki Ishikawa
d295f11a3a SMP: Introduce a new global IRQ clearing logic and tasklist protection.
The previous implementation of clearing global IRQ in sched_addreadytorun()
and sched_removereadytorun() was done too early. As a result, nxsem_post()
would have a chance to enter the critical section even nxsem_wait() is
still not in blocked state. This patch moves clearing global IRQ controls
from sched_addreadytorun() and sched_removereadytorun() to sched_resumescheduler()
to ensure that nxsem_post() can enter the critical section correctly.

For this change, sched_resumescheduler.c is always necessary for SMP configuration.
In addition, by this change, task_exit() had to be modified so that it calls
sched_resumescheduler() because it calls sched_removescheduler() inside the
function, otherwise it will cause a deadlock.

However, I encountered another DEBUGASSERT() in sched_cpu_select() during
HTTP streaming aging test on lc823450-xgevk. Actually sched_cpu_select()
accesses the g_assignedtasks which might be changed by another CPU. Similarly,
other tasklists might be modified simultaneously if both CPUs are executing
scheduling logic. To avoid this, I introduced tasklist protetion APIs.

With these changes, SMP kernel stability has been much improved.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2018-01-31 15:35:36 +09:00
Gregory Nutt
82982f7972 sched/: Fix several inappropriate accesses to get_errno() that were missed in previous changes (some going back to nuttx-.23). Add new nxsched_setscheduler() and nxsched_getaffinity() which are equivalent to their counterparts without the nx on front. These versions do not modify the errno value. Changed all calls within the OS to use these newer versions of the functions. 2018-01-30 16:16:41 -06:00
Gregory Nutt
170a50c690 Squashed commit of the following:
sched/sched:  Correct some build issues introduced by last set of changes.
    sched/sched:  Add new internal OS function nxsched_setaffinity() that is identical to sched_isetaffinity() except that it does not modify the errno value.  All usage of sched_setaffinity() within the OS is replaced with nxsched_setaffinity().
    sched/sched:  Internal functions sched_reprioritize() and sched_setpriority() no longer movidify the errno value.  Also renamed to nxsched_reprioritize() and sched_setpriority().
    sched/sched:  Add new internal OS function nxsched_getscheduler() that is identical to sched_getscheduler() except that it does not modify the errno value.  All usage of sched_getscheduler() within the OS is replaced with nxsched_getscheduler().
    sched/sched:  Add new internal OS function nxsched_setparam() that is identical to sched_setparam() except that it does not modify the errno value.  All usage of sched_setparam() within the OS is replaced with nxsched_setparam().
    sched/sched:  Add new internal OS function nxsched_getparam() that is identical to sched_getparam() except that it does not modify the errno value (actually, the previous value erroneously neglected to set the errno value to begin with, but this fixes both issues).  All usage of sched_getparam() within the OS is replaced with nxsched_getparam().
2018-01-30 11:08:18 -06:00
Juha Niskanen
dafa72edc3 drivers/sensors: add support to MAX44009 ambient light sensor 2018-01-29 07:56:06 -06:00
Gregory Nutt
fef255e5be This commit adds an as-of-yet untested implemented of UDP write buffering.
Squashed commit of the following:

    net/udp:  Address most of the issues with UDP write buffering.  There is a remaining issue with handling one network going down in a multi-network environment.  None of this has been test but it is certainly ready for test.  Hence, the feature is marked EXPERIMENTAL.
    net/udp:  Some baby steps toward a corrected write buffering design.
    net/udp:  Remove pesky write buffer macros.
    Eliminate trailing space at the end of lines.
    net/udp:  A little more UDP write buffering logic.  Still at least on big gaping hole in the design.
    net/udp:  Undefined CONFIG_NET_SENDTO_TIMEOUT.
    net/udp:  Crude, naive port of the TCP write buffering logic into UDP.  This commit is certainly non-functional and is simply a starting point for the implementatin of UDP write buffering.
    net/udp:  Rename udp/udp_psock_sendto.c udp/udp_psock_sendto_unbuffered.c.
2018-01-22 18:32:02 -06:00
Gregory Nutt
9417bfde0e include/termios.h: Update comments; fix long lines. 2018-01-18 12:51:07 -06:00
Gregory Nutt
301bf1ee77 This commit eliminates the BOARDIOC_TSCTEST_SETUP command.
Squashed commit of the following:

    configs:  Each board now initializes the touchscreen controller as a normal part of its board bring-up.  board_tsc_setup() is gone; the touchscreen controller is now treated like any other on-board device.
    Remove all support for BOARDIOC_TSCTEST_SETUP
    Move prototype for board_tsc_setup() from include/nuttx/board.h to individual board header files.
2018-01-17 09:33:28 -06:00
Masayuki Ishikawa
ab3fa89023 SMP: Introduce spin_lock_wo_note() and spin_unlock_wo_note()
These APIs are used in sched_note.c to protect instumentation data.
The deffrence between these APIs to exsiting spin_lock() and spin_unlock()
is that they do not perform insturumentation to avoid recursive call
when SCHED_INSTRUMENTATION_SPINLOCKS=y.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2018-01-17 13:29:42 +09:00
Gregory Nutt
e276d4d16d Remove the BOARDIOC_TSCTEST_TEARNDOWN boardctl() command. Remove all implementations of board_tsc_teardown() (the were all stubs anyway except for the simulation). 2018-01-16 18:03:21 -06:00
Gregory Nutt
8f94ce46f9 arch/arm/src/lpc54xx: The basic SPI driver is code complete but still untested. This driver is 'basic' in that in only supports polled mode operations. 2018-01-14 12:09:26 -06:00
Gregory Nutt
0080225473 sched/irq: Add a configuration option to show interrupt information via a procfs file. 2018-01-12 18:26:46 -06:00
Gregory Nutt
eef1276565 configs/stm32f103-minimum: Remove nonsensical #error. 2018-01-09 11:17:01 -06:00
Gregory Nutt
e4652bd3dc Squashed commit of the following:
fs: Add truncate() support for userfs
    fs/unionfs:  Add truncate() support to the unionfs
    fs/tmpfs:  Add ftruncate() support to tmpfs
    syscall/: Add system call support for ftruncate()
    net/route:  Adding ftruncate() support eliminates an issue in file-based routing table management.
    fs:  Add basic framework to support truncate() and ftruncate().  The infrastructure is complete.  Now, however, the actual implementation of ftruncate() will have to be done for each file system.
2018-01-03 16:03:56 -06:00
Gregory Nutt
b2adb4917f arch/arm/src/lpc54xx: Add register level debug output for Ethernet testing. Fixed a few start up problems. Still hangs on start-up, however. 2017-12-31 11:11:57 -06:00
Gregory Nutt
2de08627e0 arch/arm/src/lpc54xx: Finishes open design issues with AVBTP multi-channel operation. 2017-12-30 19:05:39 -06:00
Gregory Nutt
13b5d4de96 arch/arm/src/lpc54xx: Resolves some design issues with multicast address filtering and also with AVBTP multi-channel operation (the latter design is still incomplete). 2017-12-30 17:19:37 -06:00
Gregory Nutt
cb9e1e7716 arch/arm/src/lpc54xx: Add some Ethernet PHY initialization logic. 2017-12-27 12:01:24 -06:00
Gregory Nutt
7e7bdd181f Cosmetic fixes to comments, README, and other trivial corrections. 2017-12-25 10:45:47 -06:00
Gregory Nutt
b26c70b11f arch/arm/src/lkpc54xx: In SDMMC driver, fix an error which was clobbering the interrupt mask register (xfrmask). Also, add a kludge for the missing DTO interrupt. 2017-12-20 18:39:10 -06:00
Anthony Merlino
058a938268 Merged in antmerlino/nuttx/logupto-fix (pull request #559)
syslog: Fixes LOG_UPTO macro to include specified log level

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-12-20 13:34:29 +00:00
Gregory Nutt
23dfc0bf06 drivers/ft5x06: Add a polled mode of operation for the FT5x06 in attempt to work around the fact that the LPCXpresso-LPC54628 chose a non-interrupt pin for the FT5x06 interrupt. Driver is still not yet functional. 2017-12-18 08:58:07 -06:00
Juha Niskanen
db079608d9 drivers/power/bq2429x.c: Add trickle charging mode 2017-12-18 06:38:41 -06:00
Gregory Nutt
c014400895 drivers/input/ft5x06: Fix a misconception.. WAKE is an output, not an input. 2017-12-18 06:36:44 -06:00
Juha Niskanen
b4875e2286 Merged in juniskane/nuttx-1/juniskane/battery_gaugeh-edited-online-with-bitbuc-1513594794596 (pull request #558)
battery_gauge.h edited online with Bitbucket

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-12-18 12:10:02 +00:00
Gregory Nutt
c62a9ea727 drivers/input/ft5x06.c: Add a driver for the FT5x06 capacitive, multi-touch, touchscreen controller. configs/lpcxpresso-lpc54628: Add support for the the FT5x06. Enable the driver as well as the apps/examples touchscreen test. Untested on initial commit. 2017-12-17 15:17:06 -06:00
Gregory Nutt
87252297d6 arch/arm/src/: Fix a error in last commit that was cloned in three places. 2017-12-17 14:38:20 -06:00
Masayuki Ishikawa
6150299f54 Merged in masayuki2009/nuttx.nuttx/irq_spinlock (pull request #550)
SMP: Introduce spin_lock_irqsave() and spin_unlock_irqrestore()

These APIs are simplified version of enter_critical_section() and
leave_critical_section() to protect data (e.g. registers) in SMP mode.
By using these APIs inside drivers, performace will be improved.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-12-07 19:39:04 +00:00
Ekaterina Kovylova
59a5c24739 drivers/mtd: Add a driver for Macronix MX35LFxGE4AB serial NAND flash. 2017-11-29 07:15:36 -06:00
Gregory Nutt
2fb52cf3d9 Framebuffer Driver: Small modification convention for multi-planar displays (of which there are none). 2017-11-29 07:06:53 -06:00
Gregory Nutt
1338360ff7 Fix a few typos. 2017-11-28 13:40:07 -06:00
Gregory Nutt
0c614311af Eliminate some warnings 2017-11-28 12:49:36 -06:00
Alan Carvalho de Assis
5a814a773d drivers/input/nunchuck.c: Add Nintendo Wii Nunchuck driver 2017-11-28 12:10:06 -06:00
Gregory Nutt
4404be23cb XMC4 Serial: The Alternative Receive Interrupt was not being configured. 2017-11-25 12:21:33 -06:00
Gregory Nutt
3657723208 drivers/lcd: Add support for external LCD initialization required by some board logic. configs/zpa214xpa: Tried to get the LCD working again unsuccessfully. Too much bit rot I suppose. 2017-11-25 11:41:21 -06:00
Masayuki Ishikawa
818901fcf2 include/nuttx/audio: Remove CONFIG_SCHED_WORKQUEUE check in pcm.h
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2017-11-23 19:59:07 +09:00
Gregory Nutt
99a79327d2 include/nuttx/video/fb.h: Add definition for a Y2 color format. I don't know if this standard but I do have 2-bit greyscale hardware so the definition is needed. 2017-11-22 15:33:15 -06:00
Anthony Merlino
cb62580216 Merged in antmerlino/nuttx/mac802154dev-header-offset (pull request #538)
Pass header-payload offset to application for use when the MAC layer is in promiscuous mode

* mac802154_device: When in promiscuous mode, the char driver sends the entire frame, including the MAC header.  This change adds an offset field indicating the header-payload boundary. It is set to 0 when not in promiscuous mode as the header is not passed to the application

* mac802154: Adds support for getting promiscuous mode state

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-22 18:22:35 +00:00
Gregory Nutt
c93320ccd6 net/: Fix some issues with regard to UDP broadcast handling. This is Bitbucket Issue #77. This commit tentatively closes the issues, subject to verification. 2017-11-22 12:06:36 -06:00
Gregory Nutt
514ac3fe98 mm: Add a debug assertin to check for integer overflow in malloc. 2017-11-21 07:24:10 -06:00
Gregory Nutt
ce42b0e030 include/syslog.h: Trivial change in name of formal parameter for consistency. 2017-11-18 19:26:38 -06:00
Gregory Nutt
54fad8d04f mm/mm_gran: Add a function to get information about the state of the granuale allocator. 2017-11-14 14:41:03 -06:00
Gregory Nutt
62b8026976 Remove CONFIG_GRAN_SINGLE. It adds no technical benefit (other than some minor reduction in the number of interface arguments) but adds a lot of code complexity. Better without it. 2017-11-14 11:47:12 -06:00
Gregory Nutt
070d40260b profcs: At file to should user space heap. This replaces the NSH free command. 2017-11-13 12:51:33 -06:00
Gregory Nutt
f3b37e5da3 fs/procfs/fs_procfsprogrem: Add /proc/progmem. This is an alternative way to get the information that was previoulsy available in apps/system/free. apps/system/free was removed beause it made illegal calls into the OS violating the portable interface. This new procfs entry provides the same information with no such violation. 2017-11-13 09:08:39 -06:00
Gregory Nutt
c6f1f5f115 include/netinet/tcp.h: Add trivial standard tcp.h header file. 2017-11-12 13:22:14 -06:00
Gregory Nutt
f81ef55834 Trivial re-ordering of socket option bit numbers to match order presented on OpenGroup.org. 2017-11-12 08:17:46 -06:00
Gregory Nutt
b0e30afd96 include/netinet/tcp.h: Add trivial standard tcp.h header file. 2017-11-12 08:04:54 -06:00
Gregory Nutt
35ee844590 sched/signal/sig_nanosleep.c and libc/time/lib_nanosleep.c: Implement clock_nanosleep(). nanosleep() is now reduced to a libc wrapper around clock_nanosleep(). 2017-11-11 17:44:59 -06:00
Gregory Nutt
bf7839d0f0 libc/signal: Add support for sigwait(). 2017-11-11 12:37:47 -06:00
Gregory Nutt
5004e8b3ea libc: Add support for readv() and write(). Also includes some cosmetic changes to some unrelated files. 2017-11-11 11:44:14 -06:00
Juha Niskanen
cc7af2b0d0 procfs: Fix uptime being close to maximum 32-bit value in certain config 2017-11-10 09:01:39 -06:00
Jussi Kivilinna
509d729825 drivers/power/bq2429x.c: Add BATIO_OPRTN_SYSON for enabling BATFET after SYSOFF 2017-11-08 13:08:54 -06:00
Masayuki Ishikawa
51b19d5f38 Merged in masayuki2009/nuttx.nuttx/lc823450 (pull request #531)
lc823450-xgevk audio support

* arch/arm/src/lc823450: Add IPL2 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Add IPL2 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* libc/audio: Fix compilation error in lib_buffer.c

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* drivers/audio: Add WM8774 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Add I2S support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Add WM8774 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-08 12:25:13 +00:00
Gregory Nutt
d5f8a49f18 fs/userfs: Fix return value from dup method. In order to return a pointer, the parameter must be a pointer to a pointer. 2017-11-06 07:14:24 -06:00
Gregory Nutt
7deb24484c This comment converts the underlying IPC used by the UserFS from Unix domain local sockets to UDP LocalHost loopback sockets. The problem with the local sockets is that they do require operations on the top level psuedo-file system inode tree. That tree must be locked during certain traversals such as enumerate mountpoints or enumerating directory entries.
This conversion is unfortunate in the sense that Unix local domain sockets are relatively lightweight.  LocalHost UDP sockets are much heavier weight since they rely on the full UDP stack.  If anyone is up for a complete redesign, then using some shared memory and a POSIX message queue would be lightweight again.

This commit also fixes several bugs that were not testable before the inode tree deadlock.  I cannot say that the logic is 100% stable but it does not have basic functionality.

Squashed commit of the following:

    fs/userfs:  Order locking so that access to the shared I/O buffer is also locked.
    fs/userfs:  Converts to use LocalHost UDP loopback for IPC.
2017-11-05 12:25:58 -06:00
Mateusz Szafoni
2fc5237854 Merged in raiden00/nuttx (pull request #529)
Master

* cosmetics

* stm32_hrtim: add helper macros

* smps: cosmetics

* stm32f33xxx_adc: injected channels support, fix some definitions, add interface to disable interrupts

* stm32f334-dsico: beginning of lower-half driver for SMPS (buck-boost onboard converter)

* nucleo-f334r8/highpri: missing ADC trigger configuration

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-05 14:15:04 +00:00
Gregory Nutt
6c5397cffd Cosmetic fix to spacing. 2017-11-05 06:25:20 -06:00
Gregory Nutt
0942b5441d Update some comments 2017-11-04 14:33:20 -06:00
Gregory Nutt
205fe8053f Kconfigs: Add CONFIG_LCD_UPDATE that works like CONFIG_NX_UPDATE but can be enabled without enabling the graphics subsystem. 2017-11-04 14:08:21 -06:00
Alan Carvalho de Assis
829e6520e3 drivers/lcd/max7219.c: Add support to MAX7219 LED Matrix as LCD interface 2017-11-04 07:54:48 -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
Gregory Nutt
5c2e740ce3 Cosmetic change. 2017-11-01 13:57:07 -06:00
Gregory Nutt
0614f9673b fs/userfs: Some fixes from initial testing. 2017-10-31 15:26:58 -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
6e9039bb08 Squashed commit of the following:
fs/userfs:  This completes coding of the UserFS client and of the UserFS feature in general.  This feature is being merged to main now because I believe it is innocuous.  It is, however, untesed.  The next step will be to develop a test case to verify the feature.
    fs/userfs:  Completes the request logic for the UserFS client.  Still need the logic that receives the responses.
    fs/userfs:  Completes coding for most of the server side of the user filesystem logic.
    fs/userfs:  Big design changes, simplications. Use Unix domain local sockets instead of message queues.  Easier to transfer big data in local sockets than message queues.  Remove character drvier 'factory' it is not necessary.
    fs/userfs:  Minor reparitioning; volume private info does not need to be held on the OS client side.
    libc/userfs:  Add some of the server side logic.
    fs/userfs:  Add some UserFS initialization logic.
    fs/userfs:  Add frame work for the UserFS proxy.  Remove all references to a block driver.  There is no block dricer... what was I thinking?
    fs/userfs: Add some initialization of the character driver, 'factory' device.
    fs/userfs:  Rename from fusefs to userfs to that we don't stomp on someone else's cool name.
    Add a header file describing the fusefs interface.
2017-10-30 18:07:42 -06: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
Gregory Nutt
1ed816de4b Squashed commit of the following:
fs/mount:  Implements procfs /proc/fs/blocks and /proc/fs/usage files, replacing the NSH df command.
    fs/mount:  Implements procfs /proc/fs/mount file, replacing the NSH mount command when there are not arguments.
    fs/: Move prototype of foreach_mountpoint out of include/nuttx/fs/fs.h to fs/mount/mount.h.  Add framework for the mount procfs (initial commit is just a close of the net/route table procfs.
2017-10-26 13:33:08 -06:00
Jussi Kivilinna
8eaa587c98 sched: move POSIX thread specific data from pthread TCB to common TCB structure. This change allows using pthread_getspecific/pthread_setspecific from main thread. Patch also enables using pthread data with config option CONFIG_DISABLE_PTHREAD=y. 2017-10-25 07:06:42 -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
cccc86da09 This change adds support for semi-standard IPPROTO_ICMP AF_INET datagram sockets. This replaces the old ad hoc, nonstandard way of implementing ping with a more standard, socket interface.
Squashed commit of the following:

    net/icmp:  Finishes off icmp_recvfrom().
    net/icmp:  Add readahead support for IPPROTO_ICMP sockets.
    net/icmp:  Add poll() support for IPPROTO_ICMP sockets.
    net/icmp:  Add a connection structure for IPPROTO_ICMP sockets.
    net/icmp:  Implements sendto for the IPPROTO_ICMP socket.
    net/icmp:  Move icmp_sendto() and icmp_recvfrom() to separate files.  They are likely to be complex (when they are implemented).
    net/icmp:  Hook IPPROTO_ICMP sockets into network.  Fix some naming collisions.  Still missing basic ICMP send/receive logic.
    configs: apps/system/ping current need poll() enabled.
    configs: All defconfig files that use to enable low-level support must now enabled CONFIG_SYSTEM_PING.
    net/icmp:  Adds basic build framework to support IPPROTO_ICMP sockets.
2017-10-23 08:45:12 -06:00
Gregory Nutt
9b31a81b00 Squashed commit of the following:
fs/fat:  Remove mkfatfs from the OS.  This is a user-space application and belongs in apps, not in the OS.
2017-10-20 12:36:25 -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
09cee19cee include/nuttx/sensors/ioctl: deduplicate SNIOC_CFGR 2017-10-20 08:32:09 -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
5d6ecfa3ca Update a document, a README, and some comments. 2017-10-17 06:25:46 -06: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
b1a41b7620 task_delete(): Do not permit user applications to delete kernel threads. 2017-10-16 09:07:27 -06:00
Gregory Nutt
b75952c479 This removes the last traces of single-user mode. 2017-10-15 09:34:08 -06:00
Gregory Nutt
4b56c0cc0c boardctl(): Remove the BOARDIOC_GRAPHICS_SETUP command. 2017-10-15 07:56:04 -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
687aace769 Fix typo introduced with last commit. Also update TODO list. 2017-10-11 10:25:27 -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
Gregory Nutt
536e4d7fa6 fs/vfs: Change the return value of internal function fs_getfilep(). It no longer sets the errno variable but, rather, returns errors in the same manner as other internal OS functions. 2017-10-11 08:39:19 -06:00
Gregory Nutt
ed59867a16 mqueue.h edited online with Bitbucket 2017-10-11 02:49:20 +00: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
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
9b61cc6b25 task: Add new cancellation point interface, check_cancellation_point(). 2017-10-09 09:43:04 -06:00
Mateusz Szafoni
e612ae0803 Merged in raiden00/nuttx (pull request #503)
Master

* stm32_hrtim.c: fix burst mode prescaler update

* powerled.h: add fault field to state structure

* stm32f334-disco: add flash mode support for powerled driver + cosmetics

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-08 19:13:12 +00:00
Gregory Nutt
5e4f4ee788 libc and libnx: When the libraries are built into two libraries, a user space library and a OS space library (as in the PROTECTED and KERNEL build). Then the user space library must not use the OS internal interfaces; similarly, the OS must avoid using the userspace interfaces so that it does not muck the errno value or create spurious cancellation points. 2017-10-08 12:14:18 -06:00
Gregory Nutt
6642e20e05 libc and libnx: When the libraries are built into two libraries, a user space library and a OS space library (as in the PROTECTED and KERNEL build). Then the user space library must not use the OS internal interfaces; similarly, the OS must avoid using the userspace interfaces so that it does not muck the errno value or create spurious cancellation points. 2017-10-08 11:52:32 -06:00
Gregory Nutt
3664b0ab66 SDCC Fixes: Change some prototypes and some assumptions about the size of unsigned int to get to a clean SDCC compile. 2017-10-08 08:50:18 -06:00
Gregory Nutt
a857cc04e4 Fix some build problems after recent separation of internal OS from application interfaces. The build problem only occurs in the PROTECTED and KERNEL builds where separate libraries are built for the applications and for use within the OS. In these cases, the correct interfaces must be used. This commit fixes a few of these, so I can get through build testing, but there are many more that need fixin'. 2017-10-08 08:13:47 -06:00
Gregory Nutt
d633c9bf8c Squashed commit of the following:
Replace all calls to sigprocmask() in the OS proper with calls to nxsig_procmask().

    sched/signal:  Add internal OS interface nxsig_procmask().  This internal interface is equivalent to the standard sigprocmask() used by applications except that it does not modify the errno value.  Also fixes a problem in that the original sigprocmask() was not setting the errno.
2017-10-07 12:16:10 -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
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
7154fc09ff syscall/: Fix some backward conditional compilation 2017-10-07 07:46:42 -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
Gregory Nutt
fdd0dcc0b6 This commit adds internal versions of the signal interfaces:
sigtimedwait() -> nxsig_timedwait()
  sigwaitinfo()  -> nxsig_waitinfo()
  nanosleep()    -> nxsig_nanosleep()

The internal OS versions differ from the standard application interfaces in that:

  - They do not create cancellation points, and
  - they do not modify the application's errno variable

Squashed commit of the following:

    sched/signal:  Replace all usage of sigwaitinfo(), sigtimedwait(), and nanosleep() with the OS internal counterparts nxsig_waitinfo(), nxsig_timedwait(), and nxsig_nanosleep().

    sched/signal:  Add nxsig_nanosleep().  This is an internal OS version of nanosleep().  It differs in that it does not set the errno varaiable and does not create a cancellation point.

    sched/signal:  Add nxsig_timedwait() and nxsig_waitinfo().  These are internal OS versions of sigtimedwait() and sigwaitinfo().  They differ in that they do not set the errno varaiable and they do not create cancellation points.
2017-10-06 08:28:20 -06:00
Gregory Nutt
8198ba6a6d This change renames all internal, private NuttX signal-related functions to use the prefix nxsig_ so that they cannot be confused with application interfaces that begin, primarily, with sig_
This is analogous to similar renaming that was done previously for semaphores.

Squashed commit of the following:

    sched/signal:  Fix a few compile warnings introduced by naming changes.

    sched/signal:  Rename all private, internal signl functions to use the nxsig_ prefix.

    sched/signal:  Rename sig_removependingsignal, sig_unmaskpendingsignal, and sig_mqnotempty to nxsig_remove_pendingsignal, nxsig_unmask_pendingsignal, and nxsig_mqnotempty to make it clear that these are OS internal interfaces.

    sched/signal:  Rename sig_findaction and sig_lowest to nxsig_find_action and nxsig_lowest to make it clear that these are OS internal interfaces.

    sched/signal:  Rename sig_allocatepingsigaction and sig_deliver to nxsig_alloc_pendingsigaction and nxsig_deliver to make it clear that these are OS internal interfaces.

    sched/signal:  Rename sig_cleanup, sig_release, sig_releasependingaction, and sig_releasependingsignal to nxsig_cleanup, nxsig_release, nxsig_release_pendingaction, and nxsig_release_pendingsignal to make it clear that these are OS internal interfaces.

    sched/signal:  Rename sig_tcbdispatch and sig_dispatch to nxsig_tcbdispatch and nxsig_dispatch to make it clear that these are OS internal interfaces.

    sched/signal:  Rename sig_releaseaction and sig_pendingset to nxsig_release_action and nxsig_pendingset to make it clear that these are OS internal interfaces.

    sched/signal:  Rename sig_initialize and sig_allocateactionblock to nxsig_initialize and nxsig_alloc_actionblock to make it clear that these are OS internal interfaces.
2017-10-05 13:25:25 -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
Gregory Nutt
5c4d45a331 Documentation and comments updated to further enshrine exec() as an official NuttX interface. 2017-10-03 07:52:05 -06:00
Gregory Nutt
8e966546c1 syscall/: The non-standard interface exec() is now enshrined as a official NuttX API. I really dislike doing this but I think that this is probably the only want to load programs in the protected mode. It is currently used by some example code under apps/ that generate their own symbol tables for linking. Other file execution APIs relay on a symbol table provided by the OS. In the protected mode, the OS cannot provide any meaning symbol table for execution of code in the user-space blob so that is they exec() is really needed in that build case. And, finally, the interface is completely useless and will not be supported in the KERNEL build mode where the contrary is true: An application process cannot provide any meaning symbolic information for use in linking a different process. 2017-10-03 07:09:35 -06:00
Gregory Nutt
bc2cded397 Squashed commit of the following:
binfmt: Fix some compilation issues introduced in previous changes.  Verfied with the STM32F4-Discovery ELF configuration.

    binfmt:  schedule_unload() is an internal OS function and must not alter the errno variable.

    binfmt:  unload_module() is an internal OS function and must not alter the errno variable.

    binfmt:  load_module() is an internal OS function and must not alter the errno variable.

    binfmt:  exec_module() is an internal OS function and must not alter the errno variable.
2017-10-02 15:30:55 -06:00
Gregory Nutt
0617f0bfb2 stdnoreturn.h: remove C++11 dependency. Applies to C too. 2017-10-02 07:38:43 -06:00
Gregory Nutt
c3bd4fd1d7 stdnoreturn.h: Definitions removed from compiler.h below here 2017-10-02 07:10:48 -06:00
Gregory Nutt
c4ab155002 compiler.h: Fix some GCC warnings introduced for SDCC support. Basically a naming collision. 2017-10-02 07:09:31 -06:00
Gregory Nutt
9eca03b9be tools/configure.sh: Another fix for the script. The last change only worked for Windows Cygwin; for Linux, it needed to remove some additional things from the defconfig file. 2017-10-01 14:24:57 -06:00
Gregory Nutt
3f46857918 include/: Add stdnoreturn.h 2017-10-01 10:39:30 -06:00
Gregory Nutt
94f3cb004f compilers.h: Add definitions for the C11 noreturn keyword. 2017-10-01 09:34:44 -06:00