Commit Graph

3903 Commits

Author SHA1 Message Date
YAMAMOTO Takashi
df86bfd4cd drivers/audio/cs43l22.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
320b7131e0 drivers/wireless/ieee802154/mrf24j40/mrf24j40_regops.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
950fff8e66 drivers/audio/cxd56.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
9a7de336d0 drivers/wireless/ieee802154/mrf24j40/mrf24j40_regops.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
5ef5d2c598 drivers/audio/audio_null.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
2cc96365b0 drivers/audio/wm8904.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
565a67262b drivers/mtd/mtd_partition.c: Fix printf format warnings 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
f8d6a85f90 drivers/syslog/vsyslog.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
4c663c9713 drivers/mtd/mtd_partition.c: Appease nxstyle 2020-11-16 05:46:53 -08:00
Frank-Christian Kruegel
bf5fa5557d Support for MAX1161X family of I2C 12 bit ADC chips:
MAX11612:  4 channels VCC=5V0 Int VRef=4.096V
MAX11613:  4 channels VCC=3V3 Int VRef=2.048V
MAX11614:  8 channels VCC=5V0 Int VRef=4.096V
MAX11615:  8 channels VCC=3V3 Int VRef=2.048V
MAX11616: 12 channels VCC=5V0 Int VRef=4.096V
MAX11617: 12 channels VCC=3V3 Int VRef=2.048V
Note: The chips' auto-scanning feature is not supported in this revision.
2020-11-15 05:59:01 -08:00
Simon Piriou
da70eb5c56 usbdev: adb: fix missing break 2020-11-12 21:35:07 -08:00
dongjiuzhu
089b1c17f6 driver/sensor: add fetch api to read sensor data directly
1.use userspace buffer rather than intermediate buffer of upperhalf driver
2.support block and non-block ways.

Change-Id: I1d0cecfaa20ce54961c58713d8f2f8857e349791
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 18:25:22 -08:00
dongjiuzhu
2cda16b606 driver/sensor: add new feature about sensor driver
1.support for multi-user access
2.support special cmd to control sensor
3.support userspace to set size of intermediate buffer
  by ioctl: SNOIC_SET_BUFFER_SIZE

Change-Id: I9ce3a65b88b12c28388ec397431f1a277b120c2a
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 18:25:22 -08:00
dongjiuzhu
2482052228 driver/sensor: user specifies device register number
N/A

Change-Id: Idd11461f933dd21b7271cd3ca87a2e33127a9d34
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 18:25:22 -08:00
Juha Niskanen
ca7a7ccbeb Fix some typos in comments
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-11-08 18:58:20 +01:00
Juha Niskanen
62d38c32e8 drivers/lcd/memlcd.c: fix typos and nxstyle
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-11-08 18:58:20 +01:00
Tobias Johansson
2cce572162 drivers: audio: cxd56: rename queue status
This commit improves the readability for each state

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-11-06 11:11:27 +09:00
Tobias Johansson
43b21a4693 drivers: audio: cxd56: add I2S debugging
When audio fails it is usefull to have I2S transfer errors in place
to be able to track the issue

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-11-06 11:11:27 +09:00
Tobias Johansson
d572b06a6c drivers:audio: cxd56: move helpers to the header file
The Queue helpers should be moved to the header file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-11-06 11:11:27 +09:00
dongjiuzhu
8562e17ef1 rc/dummy: add dummy driver to test driver skeleton
N/A

Change-Id: Iae3c22587f9939f6923b102bf4c51bb7f88a6429
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-05 11:38:28 -03:00
dongjiuzhu
2ed6e13241 driver/rc: support IR remote control
N/A

guide link: https://www.kernel.org/doc/html/v4.14/media/uapi/rc/lirc-dev.html

Change-Id: I84abfc12578d444d72c8c0df31d06d1a85ce0725
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-05 11:38:28 -03:00
Brennan Ashton
54832f37f2 sim: Initial Linux i2c bus support
This adds the inital wiring for i2c bus support in the sim target
and for Linux host adds the lower half that uses the i2c chardev.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-11-04 23:51:09 -08:00
Matias N
9266c54bc2 lcd: add optional putarea()/getarea() operations 2020-11-04 04:00:22 -08:00
Masatoshi Ueno
04ec9cf989 gs2200m: Add function to get IWNWID / IWFREQ / IWSENS information
Summary:
- This commit enables gs2200m driver to get IWNWID/IWFREQ/IWSENS information

Impact:
- Affects gs2200m only

Testing:
- Tested with spresense:wifi
2020-11-02 19:58:58 +09:00
Nakamura, Yuuichi
7905ee17d4 Add task name recording for note RAM driver 2020-11-02 01:12:08 -08:00
Brennan Ashton
21f9093966 nxstyle fixes
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-11-02 00:04:08 -08:00
Brennan Ashton
b459645105 lcd: Minor fixes to ssd1306 i2c driver
The sendblk function was missing NOSTOP on the first msg of the
i2c transaction. This could cause an extra STOP to be inserted
in the transaction.

The driver uses up_mdelay for some timing where it should be
using a sleep.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-11-02 00:04:08 -08:00
Masatoshi Ueno
c0b4bd2f85 gs2200m: Check disassociation from AP and enable rejoin
Summary:
- This commit enables gs2200m driver re-associate to the access point when disassociated

Impact:
- Affects gs2200m only

Testing:
- Tested with spresense:wifi
2020-11-02 16:11:13 +09:00
Matias N
f97f1bbd1a lcd_dev: put header in correct location; fix missing const 2020-10-31 13:26:30 -07:00
Matias N
278e7af5e5 Add LCD character driver: allows interacting with LCD directly from userspace 2020-10-30 19:55:10 -07:00
Yoshinori Sugino
c13f869432 Modify SIGSTP to SIGTSTP
Follow the POSIX description.
SIGTSTP should be sent when the Ctrl-Z characters is encountered, not SIGSTP.

Testing:
Built with hifive1-revb:nsh (CONFIG_SERIAL_TERMIOS=y, CONFIG_SIG_DEFAULT=y and CONFIG_TTY_SIGTSTP=y)
2020-10-29 01:12:43 -07:00
Yoshinori Sugino
13c0debec7 drivers/serial/Kconfig: Fix typos 2020-10-28 23:47:39 -07:00
Juha Niskanen
d53abbc4ac drivers/lcd: ssd1306: cleanup to comments, README, nxstyle issues
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-10-28 19:28:30 -07:00
Juha Niskanen
bdb398fa8c drivers/lcd: ssd1306: fix one bad debug assert
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-10-28 19:28:30 -07:00
Masayuki Ishikawa
1e321ca032 drivers: wireless: Fix tcp/udp connect with heavy bulk data traffic in gs2200m.c
Summary:
- During network stress testing, ASSERT happened in gs2200m_ioctl_connect()
- The test was nxplayer (http audio streaming) and repeating wget every 0.5sec
- gs2200m_ioctl_connect() calls gs2200m_send_cmd() to send an AT command
- Then it waits for a synchronous command response.
- However, if heavy tcp traffic happens on another socket, it can receive a bulk packet
- With this commit, if it receives such a packet then the packet is duplicated.
- After that, the duplicated packet is added to the packet queue and notify the userland.

Impact:
- Affect almost all use cases with gs2200m

Testing:
- Tested with both spresense:wifi and spresense:wifi_smp
- Tested with nxplayer (http audio streaming) and repeat wget

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-28 11:36:17 -07:00
Juha Niskanen
1115452061 drivers/pipes: nx_pipe syscall takes three params, also use nx_close on error path
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-10-28 09:11:05 -07:00
Simon Piriou
b405722276 usbdev: add Android Debug Bridge driver 2020-10-26 08:28:48 -03:00
dongjiuzhu
d452a05910 pollnotify: we should send poll events before semaphore incrementes.
There is a good case on sim platform:
When we input some cmd and click enter key to start application in terminal,
this context will change to application from IDLE loop. Althrough entey key '\r'
has been received to recv buffer and complete post semaphore of reader, but
pollnotify may not be called because context change. So when application run
poll function, because no events happend and poll enter wait, context will
again change to IDLE loop, this pollnotify of IDLE loop will run to send poll
events, poll function of applicaton will wake up. It's wrong!

Change-Id: I812a889f2e90781a9c3cb4b0251cccc4d32bebd1
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-26 08:27:09 -03:00
Masayuki Ishikawa
df952074eb drivers: wireless: Add support for ioctl(fd, SIOCGIFADDR, ...) to gs2200m.c
Summary:
- This commit adds support for ioctl(fd, SIOCGIFADDR, ...) to gs2200m.c

Impact:
- Only affects ioctl(fd, SIOCGIFADDR, ...) with gs2200m
- Need to update apps/wireless/gs2200m as well

Testing:
- Tested with spresense:wifi
- Tested with dhcpc

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-26 10:53:34 +01:00
Masayuki Ishikawa
f12d49076c drivers: wireless: Fix to handle address info in accept() in gs2200m.c
Summary:
- This commit fixes to handle address info in accept() in gs2200m.c

Impact:
- All use cases which use accept() with gs2200m
- Need to update apps/wireless/gs2200m as well

Testing:
- Tested with spresene:wifi
- Tested with telnet daemon

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>>
2020-10-26 10:53:34 +01:00
Masayuki Ishikawa
02b08590a1 drivers: wireless: Fix to handle UDP connect() with bind() in gs2200m.c
Summary:
- This commit fixes to handle UDP connect() with bind() to a local port.

Impact:
- All UDP cases which use connect() with gs2200m
- Need to update apps/wireless/gs2200m as well

Testing:
- Tested with spresense:wifi
- Create a UDP socket and bind() to a local port.
- Then connect() to remote address with port and send()

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-26 10:53:34 +01:00
Yoshinori Sugino
3ac90fca79 Remove tabs and spaces at the end of lines 2020-10-24 09:38:21 +01:00
dongjiuzhu
a3f978da02 sensor/driver: wtgahrs2 by serial interface follow sensor.c/sensor.h
Wtgahrs2 integrates multiple sensor: accel, gyro, mag, baro and gps.

Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-22 10:17:36 -03:00
dongjiuzhu
fa09c6a8bc driver/sensor: add unified management for sensor
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-22 10:17:36 -03:00
Alexander Vasiljev
d523757d4a serial: break from read after closing 2020-10-21 09:20:04 -07:00
Xiang Xiao
eb4121ce38 Change all 'Nuttx' to 'NuttX'
Unify the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-20 01:45:06 -07:00
Philippe Coval
cafe24528c sensors: Support fxos8700cq motion I2C sensor
Device is composed of
3-axis, linear accelerometer and 3-axis, magnetometer

It is onboarded in NXP FRDM-K64F SBC.

Change-Id: I405a12cbf2c9994f3bd66e108d2eb8faeee00e18
Bug: https://github.com/apache/incubator-nuttx/issues/1988
Relate-to: https://www.nxp.com/docs/en/data-sheet/FXOS8700CQ.pdf
Forwarded: https://github.com/apache/incubator-nuttx/pull/1989
Signed-off-by: Philippe Coval <rzr@users.sf.net>
2020-10-16 10:10:35 +08:00
raiden00pl
33901969fe Fix nxstyle warnings 2020-10-10 12:24:28 -06:00
raiden00pl
1621305e79 drivers: Changed headers for apache 2.0 license 2020-10-10 12:24:28 -06:00
Masayuki Ishikawa
822497d021 drivers: note: Fix compile errors in noteram_driver.c
Summary:
- This commit fixes compile errors if CONFIG_DEBUG_ASSERTIONS=y

Impact:
- Affects noteram_driver only

Testing:
- Tested with spresense:wifi_smp with CONFIG_DEBUG_ASSERTIONS=y

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-06 16:42:40 +08:00
Nakamura, Yuuichi
89ea234af8 Add on-boot instrumentation support for note filter 2020-10-06 03:26:46 +08:00
Nakamura, Yuuichi
a373079a94 Fix /dev/note driver for task trace support 2020-10-06 03:26:46 +08:00
Nakamura, Yuuichi
6efecd2105 Add notectl driver 2020-10-06 03:26:46 +08:00
Nathan Hartman
80ce7800a9 Sources and Docs: Fix typos and nxstyle issues
Documentation/contributing/coding_style.rst:

    * Fix repeated words: ("this this").
    * Remove trailing spaces.

boards/z80/z80/z80sim/README.txt:

    * Fix repeated words: ("this this") and rewrap lines.

graphics/Kconfig,
libs/libc/math/Kconfig:

    * Fix repeated words: ("this this").

arch/arm/src/armv7-a/arm_assert.c,
arch/arm/src/armv7-r/arm_assert.c,
arch/arm/src/imxrt/imxrt_enet.c,
arch/arm/src/kinetis/kinetis_enet.c,
arch/arm/src/kinetis/kinetis_flexcan.c,
arch/arm/src/s32k1xx/s32k1xx_enet.c,
arch/arm/src/s32k1xx/s32k1xx_flexcan.c,
arch/arm/src/stm32/stm32_pwm.c,
arch/arm/src/stm32h7/stm32_pwm.c,
arch/arm/src/stm32l4/stm32l4_pwm.c,
arch/renesas/src/rx65n/rx65n_usbdev.c,
binfmt/libnxflat/libnxflat_bind.c,
drivers/pipes/pipe_common.c,
net/igmp/igmp_input.c,
net/tcp/tcp_conn.c,
sched/sched/sched_roundrobin.c:

    * Fix typo in comment ("this this").

arch/arm/src/cxd56xx/cxd56_usbdev.c,
arch/arm/src/lc823450/lc823450_usbdev.c:

    * Fix typo in comment and rewrap lines.

arch/arm/src/imxrt/imxrt_usbdev.c,
arch/arm/src/stm32/stm32_dac.c,
arch/arm/src/stm32f0l0g0/stm32_pwm.c,
arch/arm/src/stm32f7/stm32_pwm.c,
arch/arm/src/tiva/lm/lm4f_gpio.h,
fs/nxffs/nxffs_write.c,
include/nuttx/analog/pga11x.h,
include/nuttx/usb/usbdev.h,
net/mld/mld_join.c:

    * Fix typo in comment ("this this").
    * Fix nxstyle issues.
2020-10-02 04:54:52 +02:00
Brennan Ashton
f41b9a10b3 ws2812: moved SPI_LOCK and forgot to change spi drv var name
This snuck in durring a slight PR fixup.
2020-09-28 08:25:43 +01:00
Xiang Xiao
650e18baa1 serial: Shouldn't mangle pid when ISIG is changed
Let's check ISIG flag directly instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I060f70eefc79b1c34aa11ed4071179d2ae5fa5ca
2020-09-25 06:48:26 -07:00
Alexander Vasiljev
834e584169 spi_xx25xx: in write operation return the number of bytes written not the result of ee25xx_semtake 2020-09-25 04:51:25 -07:00
Xiang Xiao
eacca2b7a2 wireless/bluetooth: replace open with file_open in uart shim drivers
it is simpler than open and then file_detach

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I22585b7450804c6c012fecf369a8d7e25970c192
2020-09-23 15:08:18 -03:00
Masayuki Ishikawa
89cfaf1e6a drivers: audio: Fix cxd56.c for SMP
Summary:
- Add spin_unlock_irqrestore to avoid deadlock
- Improve cxd56_resume() sequence
- Remove AUDIO_MSG_USER and call cxd56_stop_dma() for buffering
- Remove redandant 'Lock interrupt' and 'Unlock interrupt'

Impact:
- Affects all use cases with cxd56.c audio driver

Testing:
- Tested with spresense:rndis and spresense:rndis_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-09-23 10:45:29 +02:00
spiriou
65bb956e5e pipe: check for writers first in case of pipe empty 2020-09-21 19:30:21 -07:00
Brennan Ashton
5498f72fa5 input: Q10 BlackBerry Keyboard from Solder Party
This adds support for the Q10 BlackBerry based keyboard
from Solder Party. https://www.solder.party/docs/keyboard-pmod/

They keyboard device registered at /dev/kbdN is fully compatible
with hidkbd and has been testing with the Keyboard FeatherWing
on the nRF52 platform.

The buttons are added as a standard discrete joystick if
optionally enabled.  The PMOD variant of this does not
include these buttons, but the Keyboard FeatherWing does.
This joystick is usually defined at /dev/djoyN and
can be used with the djoy example application.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-09-21 07:40:42 -06:00
chao.an
614ac5b0f2 libs/libc/unistd: Implement pipe2(2) syscall
See the reference here:
https://www.man7.org/linux/man-pages/man2/pipe2.2.html

Change-Id: Ife19b9bdbde73c7421be381a094da67017819e63
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-18 20:01:26 -07:00
chao.an
8f52d4536c timers/watchdog: configable keep alive interval
Change-Id: I519f5f9e0a8ab7ca298f834af20f7ad437ef92a4
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-18 19:58:29 -07:00
Augusto Fraga Giachero
f92e9641cd Fix coding style issues
Fix long lines pointed by nxstyle.
2020-09-18 07:03:09 -07:00
Augusto Fraga Giachero
1efbb4c114 Fix build errors when using DEBUGASSERT
I never tested these drivers with debug assertions enabled as I should
have. This commit fixes build errors due to wrong variable names used.
2020-09-18 07:03:09 -07:00
Brennan Ashton
7554eedf9a input: STMPE811 GPIO interrupt bug fixes
This patch resolves to bugs in the GPIO interrupt logic:

1. Any pins did not have STMPE811_GPIO_RISING in their pincfg
   would clear the rising edge interrupt enable flag for all
   pins due to a masking bug.

2. Pins would never trigger a second interrupt.  There is an
   undocumented requirement that you have to clear both the
   GPIO interrupt status register __and__ also the edge
   detection status register.  Failure to clear either of
   these will result in no further interrupts being triggered.
   This requirement exists both for edge and level modes of
   operation.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-09-17 21:32:05 -07:00
Gregory Nutt
415d83cf19 STMPE811: Fix name collision in include/nuttx/input/stmpe811.h
The macro name GPIO_PIN collides with naming used by many architectures:

    $ find . -name "*.h" | xargs grep "define GPIO_PIN[(]"
    ./arch/arm/src/am335x/hardware/am335x_gpio.h:#define GPIO_PIN(n)              (1 << ((n) & 0x1f)) /* Bit n: Pin n, n=0-31 */
    ./arch/arm/src/imx6/hardware/imx_gpio.h:#define GPIO_PIN(n)              (1 << (n)) /* Bit n: Pin n, n=0-31 */
    ./arch/arm/src/imxrt/hardware/imxrt_gpio.h:#define GPIO_PIN(n)              (1 << (n)) /* Bit n: Pin n, n=0-31 */
    ./arch/arm/src/lpc43xx/hardware/lpc43_gpio.h:#define GPIO_PIN(p)                 (1 << (p)) /* Bits 0-31: Read/write pin state */
    ./arch/arm/src/nrf52/nrf52_gpio.h:#  define GPIO_PIN(n)           ((n) << GPIO_PIN_SHIFT)
    ./arch/arm/src/nuc1xx/hardware/nuc_gpio.h:#define GPIO_PIN(n)                (1 << (n)) /* Bit n: GPIOx Pin[n] pin value */
    ./arch/avr/src/at32uc3/at32uc3_gpio.h:#define GPIO_PIN(n)              (1 << (n))
    ./include/nuttx/input/stmpe811.h:#define GPIO_PIN(n)                  (1 << (n))

This commit changes the name used by the STMPE811 driver to STMPE11_GPIO_PIN
2020-09-17 12:10:29 -07:00
Brennan Ashton
204e84f1ad input: Add SPI mode for STMPE811 touch screen controller
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-09-17 08:34:41 -06:00
Masayuki Ishikawa
e53970583e drivers: wireless: Apply NET_LL_IEEE80211 to gs2200m.c
Summary:
- This commit applies NET_LL_IEEE80211 to gs2200m.c
- Also selects DRIVERS_IEEE80211 in Kconfig

Impact:
- Affects use cases with gs2200m driver

Testing:
- Tested with spresense:wifi and spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-09-17 09:24:39 +02:00
Brennan Ashton
e2fd1fdd84 LED: Support for WS2812 led controller (aka Adafruit NeoPixel)
The WS2812 is very common in LED strips as it is an integrated
controller and LED. It is driven by a single data line, but
the timing requirements can be met by using most SPI controllers
and the use of DMA.

This driver has been validated on the nRF52 arch both with a
single LED and a strip of 144.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-09-16 10:35:56 -07:00
Brennan Ashton
26395a6908 mmcsd: Allow setting ID mode frequency vi Kconfig
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-09-16 03:13:43 -07:00
Xiang Xiao
77ae03788a note: Rename note driver to noteram driver
to reflect this is just a normal note driver with ram buffer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-15 14:55:22 +08:00
raiden00pl
493b0bf074 drivers/timers/pwm.c: add missing new lines to some debug messages 2020-09-13 10:57:11 -03:00
Xiang Xiao
0c3930ba11 sched: Rename note_add to sched_note_add
to better match other sched_note_* function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-12 08:42:30 -07:00
Masayuki Ishikawa
58317b1430 drivers: wireless: Fix warnings in gs2200m.c
Summary:
- This commit fixes warnings when we remove noreturn from _assert()

Impact:
- Should have no impact

Testing:
- Tested with spresense:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-09-11 08:25:31 +02:00
David Sidrane
55b48b14eb mmcsd_sdio: Arm the write complete detection
The Multiblock write path was missing the
   the SDIO_WAITENABLE with SDIOWAIT_WRCOMPLETE.

   This could be seen with debugging turned on as

   mmcsd_eventwait: ERROR: Awakened with 10
   mmcsd_transferready: ERROR: mmcsd_eventwait for transfer ready failed: -5
2020-09-10 14:55:41 +01:00
Xiang Xiao
952af92690 sched/note: Move the circle buffer code to driver
so the format code can be shared by different transport

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-07 11:54:10 +08:00
Xiang Xiao
f99719e260 Move note driver from drivers/syslog to drivers/note
it's better to put the note transport layer into a common folder

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-07 11:54:10 +08:00
Xiang Xiao
8e8f41faeb drivers/timer: auto select the related option in Kconfig
to avoid the user make the wrong combination in defconfig

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-04 16:16:51 -03:00
Ouss4
c98ec2ad3e drivers/sensors/mpu60x0.c: Correct comments. 2020-09-01 18:18:24 -03:00
Xiang Xiao
62a840f992 drivers/rwbuffer: Should call rwb_wrflush in rwb_uninitialize
to avoid lose the cached data in the write buffer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-29 02:57:36 -07:00
Xiang Xiao
a86a3d4d02 drivers/rwbuffer: Remove the redundant check in rwb_initialize
the same check already done before

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-29 02:57:36 -07:00
Xiang Xiao
73723dd31c drivers/rwbuffer: Avoid ftl driver allocate the temporary erase buffer
If the buffer to be flushed isn't multipled by the erase size,
let's pad the buffer proactively to avoid the allocation in ftl.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6d7904aafab93a7886a594319d65826b81cd3cd1

3Change-Id: I88276149cc7826e7416929ca60b06314e96079a6
2020-08-29 02:57:36 -07:00
leomarradke
8a2c480a48 arch: samd5e5:
- Add MTD progmem support.
- NVM USER PAGE IOCTLs support.

boards: metro-m4  Add support for:

- SmartFS inicialization.
- AT24 EEPROM.
- GPIO dev support.
- BQ27426 gauge inicialization.

drives: power
- Add BQ27426 fuel gauge support.

Testing:
- Build check only.

Signed-off-by: Leomar Mateus Radke  <leomar@falker.com.br>
2020-08-27 11:46:50 -03:00
Masayuki Ishikawa
07b4b219cd drivers: wireless: Refactor gs2200m.c
Summary:
- Remove unnecessay code from gs2200m_irq()
- Fix irq control in case that work_available() returns false

Impact:
- All use cases with gs2200m driver

Testing:
- Tested with spresense:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-25 11:49:21 +02:00
Xiang Xiao
b5f429c88b Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
Xiang Xiao
ae356001cf Change all files come from Xiaomi/Pinecone to Apache License 2.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
Johannes Schock
83f6c94209 telnet.c: td_offset had been uint8_t. TELNET_RXBUFFER_SIZE over 256 had been broken. 2020-08-19 04:44:03 -05:00
David Sidrane
e21dd68755 mmcsd_sdio:Fix breakage from 997d4 SD not functional
When CONFIG_MMCSD_MULTIBLOCK_DISABLE is lit, all SD
   read/write failed. The function return the number of
   blocks in `ret`, set on entry to nsectors. That was
   then wiped out by using the ret for the mmcsd_takesem.

   Since the code had many path setting return, the choices for
   the fix could have been add a new varaible or simple init it
   were used. I choose the latter.
2020-08-19 03:22:09 -05:00
chao.an
f97b8436b3 drivers/bch: flush the dirty sector to keep the sector sequence
flush the dirty sector to keep the sector sequence before ftl write

Change-Id: I1096cce39965806d5c877c2929b5a2ecdab27ac9
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 23:38:57 -05:00
chao.an
ed3cddb684 drivers/bch: delay the sector flush
Delay the sector flush to avoid multiple earse/write operations in sequence write

Change-Id: If4331b7fc8d2c2061325533212b28e826141b411
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 23:38:57 -05:00
Gregory Nutt
2af62314d7 Fix build breakage from PR #1565
Fixes:

    ##[error]net/tun.c:837:13: error: conflicting types for 'tun_poll_expiry'
      837 | static void tun_poll_expiry(FAR void *arg)
          |             ^~~~~~~~~~~~~~~
    net/tun.c:196:13: note: previous declaration of 'tun_poll_expiry' was here
      196 | static void tun_poll_expiry(wdparm_t arg);
          |             ^~~~~~~~~~~~~~~

And

    ##[error]net/tun.c:881:57: error: passing argument 4 of 'wd_start' makes integer from pointer without a cast [-Werror=int-conversion]
      881 |   wd_start(&priv->txpoll, TUN_WDDELAY, tun_poll_expiry, priv);
          |                                                         ^~~~
          |                                                         |
          |                                                         struct tun_device_s *
    In file included from /github/workspace/sources/nuttx/include/nuttx/sched.h:41,
                     from /github/workspace/sources/nuttx/include/sched.h:34,
                     from /github/workspace/sources/nuttx/include/nuttx/arch.h:81,
                     from net/tun.c:60:
    /github/workspace/sources/nuttx/include/nuttx/wdog.h:134:42: note: expected 'wdparm_t' {aka 'long unsigned int'} but argument is of type 'struct tun_device_s *'
      134 |              wdentry_t wdentry, wdparm_t arg);
          |                                 ~~~~~~~~~^~~

And

    chip/cxd56_rtc.c: In function 'up_rtc_initialize':
    ##[error]chip/cxd56_rtc.c:358:3: error: too many arguments to function 'cxd56_rtc_initialize'
      358 |   cxd56_rtc_initialize(1, NULL);
          |   ^~~~~~~~~~~~~~~~~~~~
    chip/cxd56_rtc.c:253:13: note: declared here
      253 | static void cxd56_rtc_initialize(wdparm_t arg)
          |             ^~~~~~~~~~~~~~~~~~~~
2020-08-14 14:12:51 -03:00
Xiang Xiao
acca9fcc3b sched/wdog: Remove MAX_WDOGPARMS and related stuff
since the variable arguments are error prone and seldom used.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-14 08:19:50 -06:00
Ouss4
ccf7154f05 drivers: Add the configuration option to select a board specific folder. 2020-08-13 03:48:17 -05:00
Xiang Xiao
ed786986ed sensors/ak09912: Ensure ak09912_dev_s zero in ak09912_register
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-12 08:27:19 -03:00
Xiang Xiao
61ea875c94 Fix build break introduced by commit a0ce81d659
sam_ili9488.c:1605:7: error: label 'errout_with_dmadog' used but not defined
bcmf_sdio.c:855:16: error: passing argument 1 of 'wd_start' from incompatible pointer type

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-12 02:11:56 -07:00
Xiang Xiao
ae94688dc4 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-11 12:28:55 -06:00
Xiang Xiao
a0ce81d659 sched/wdog: Don't dynamically allocate wdog_s
to save the preserved space(1KB) and also avoid the heap overhead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
2020-08-11 12:28:55 -06:00
zhongan
2818b6b2c0 drivers/rptun: Add 'RPTUN_CONFIG' interface.
Change-Id: I1c6177ffe0c49c385f0d784b1ff0dbb69b6432f8
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-08-11 15:58:27 +01:00
Masayuki Ishikawa
a104490b00 drivers: wireless: Add retry sequence in gs2200m_send_cmd()
Summary:
- This commit is a workaround to avoid errors in gs2200m_send_cmd()
- See the actual sequence in Testing for details

Impact:
- gs2200m driver

Testing:
- Test with spresense:wifi
- 1-1 Run tcpclient on NuttX and run nc on Linux
- 1-2 Stop nc on Linux then tcpclient also stops
- 1-3 Run tcpclient then the first AT+NCTCP will fail
- 1-4 But the second AT+NCTCP will succeed
- 2-1 Run tcpclient on NuttX and run nc on Linux
- 2-2 Stop nc on Linux then tcpclient also stops
- 2-3 Run tcpserver then the first AT+NSTCP will fail
- 2-4 But the second AT+NSTCP will succeed

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-11 01:25:40 -05:00
Huang Qi
fd78f83e02 drivers/video: Refine the update region notification mechanism
1.Expose the notification through fb_vtable_s::updatearea
2.Incorporate old nx_notify_rectangle into the new updatearea callback
3.Migrate the calle of nx_notify_rectangle to fb_vtable_s::updatearea

Change-Id: Ia3d1f73e8757b2d381586d76ec6adc16c810018d
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-08-10 08:08:33 +02:00
Johannes Schock
662e6789ea Added another usbid with proto = 1 (HighSpeed Hub). Nxstyle fixes. 2020-08-09 16:12:18 -03:00
Johannes Schock
2a11ad520b usbhost_storage.c: Fixed Bug in usbhost_freedevno(...), worked only for 'a'. 2020-08-09 11:54:04 -06:00
Johannes Schock
02a9228c1f Added USB MSC state change notifier in notifier work queue.
Added USB MSC automount for Freedom K28 using the above.
2020-08-09 11:54:04 -06:00
Xiang Xiao
f618de9c97 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Xiang Xiao
4c706771c3 sched/wdog: Replace all callback argument from uint32_t to wdparm_t
and alwasy cast the argument of wd_start to wdparm_t

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Masayuki Ishikawa
3b76666a1e drivers: usbdev: Fix default value for RNDIS_NWRREQS
Summary:
- Change default value for RNDIS_NWRREQS based on NET_TCP_WRITE_BUFFERS

Impact:
- This commit affects RNDIS use cases

Testing:
- spresense:rndis with CONFIG_NET_TCP_WRITE_BUFFERS=y

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-08 05:36:07 -05:00
Gregory Nutt
188d4b0fb4 user-space memalign() must not be called from within the OS.
drivers/net/ftmac100.c, libs/libc/stdlib/lib_aligned_alloc.c

A continuation of PRs #1507, #1510, and #1512.  See Issue #1481 for additional information.
2020-08-04 22:45:47 +01:00
Gregory Nutt
d09f6aaa72 Correct more improper use of malloc(), zalloc(), and free()
malloc() and free() should never be used within the OS. This will work in the FLAT build because there is only a single heap, but will cause problems in PROTECTED and KERNEL build modes where there are separate heaps for user and kernel memory.

Typically kmm_malloc(), kmm_zalloc(), and kmm_free() should be called within the kernel in those build modes to use the kernel heap.

Memory is never free.  Possible memory leak:

    ./boards/arm/cxd56xx/common/src/cxd56_crashdump.c:  pdump = malloc(sizeof(fullcontext_t));

Memory allocated with malloc(), but freed with kmm_free():

    ./drivers/usbhost/usbhost_composite.c:  cfgbuffer = (FAR uint8_t *)malloc(CUSTOM_CONFIG_BUFSIZE);

Memory is never freed in these cases.  It is allocated in the driver initialization logic, but there is no corresponding uninitialization logic; memory is not freed on error conditions:

    ./arch/arm/src/lc823450/lc823450_i2s.c:  priv = (struct lc823450_i2s_s *)zalloc(sizeof(struct lc823450_i2s_s));
    ./arch/arm/src/sam34/sam_spi.c:  spics = (struct sam_spics_s *)zalloc(sizeof(struct sam_spics_s));
    ./arch/arm/src/sama5/sam_spi.c:  spics = (struct sam_spics_s *)zalloc(sizeof(struct sam_spics_s));
    ./arch/arm/src/samv7/sam_spi.c:  spics = (struct sam_spics_s *)zalloc(sizeof(struct sam_spics_s));

Memory is allocated with zalloc() but freed on error conditions with kmm_free():

    ./arch/arm/src/sama5/sam_ssc.c:  priv = (struct sam_ssc_s *)zalloc(sizeof(struct sam_ssc_s));
    ./arch/arm/src/samv7/sam_ssc.c:  priv = (struct sam_ssc_s *)zalloc(sizeof(struct sam_ssc_s));
    ./arch/arm/src/stm32/stm32_i2s.c:  priv = (struct stm32_i2s_s *)zalloc(sizeof(struct stm32_i2s_s));

Memory is never freed:

    ./drivers/spi/spi_bitbang.c:  priv = (FAR struct spi_bitbang_s *)zalloc(sizeof(struct spi_bitbang_s));
2020-08-04 20:41:43 +01:00
Gregory Nutt
2dae970ec6 Fix cases where memory is allocated using malloc()
arch/arm/src/cxd56xx/cxd56_gnss.c, arch/arm/src/xmc4/xmc4_spi.c,
 crypto/blake2s.c, drivers/lcd/pcf8574_lcd_backpack.c, drivers/lcd/st7032.c

User space memory should not be used within the OS and, when it is absolutely necessary to use user-space memory, it should be allocated using kumm_malloc().
2020-08-04 20:40:57 +01:00
Gregory Nutt
3cad9f498f drivers/mkrd.c
drivers/net/telnet.c
 drivers/wireless/bluetooth/bt_uart_bcm4343x.c
 drivers/wireless/ieee802154/mrf24j40/mrf24j40.c

Kernel memory was allocated using kmm_malloc() or kmm_zalloc() but freed with with the user-space allocator free().  In the FLAT build, this is bad style, but not harmful because there is only a single, heap and malloc() and kmm_malloc() map to the same function.

But that is not true in the case of the PROTECTED or KERNEL builds.  In those cases, there are separate heaps.  kmm_malloc() will allocate from the kernel heap.  free() will attempt to free the kernel memory from the user heap and will cause an assertion (or other obscure failure if assertions are disabled).
2020-08-04 13:00:53 -05:00
YAMAMOTO Takashi
123a31e3a2 drivers/usbhost/hid_parser.c: nxstyle fixes 2020-08-03 22:52:31 -05:00
YAMAMOTO Takashi
59ba52aee8 drivers/usbhost/hid_parser.c: Fix out of range array accesses
Found by clang-check:

usbhost/hid_parser.c:278:26: warning: Assigned value is garbage or undefined
                usage[i] = usage[i + 1];
                         ^ ~~~~~~~~~~~~
usbhost/hid_parser.c:321:34: warning: Assigned value is garbage or undefined
                        usage[i] = usage[i + 1];
                                 ^ ~~~~~~~~~~~~
2 warnings generated.
2020-08-03 22:52:31 -05:00
SPRESENSE
15be5e5e11 drivers/video: Store device operations table
Fix a bug which the device operation structure is not stored in
video_initialize().
2020-07-31 09:37:20 +02:00
SPRESENSE
3befe16f52 drivers/video: Support JPEG format in VIDEO_CAPTURE
Add support for the VIDEO stream with JPEG frames supported by ISX012.
2020-07-31 09:37:20 +02:00
YAMAMOTO Takashi
1a669e09cd drivers/syslog/syslog_write.c: nxstyle fix 2020-07-29 21:13:20 -07:00
YAMAMOTO Takashi
9274b67a45 syslog_default_write: Fix the return value
Found by clang-check:

syslog/syslog_write.c:96:7: warning: Value stored to 'nwritten' is never read
      nwritten = g_syslog_channel->sc_write(buffer, buflen);
      ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
2020-07-29 21:13:20 -07:00
Masayuki Ishikawa
8a7ecf0858 drivers: wireless: Fix null pointer dereference in gs2200m.c
Summary:
- This PR fixes null pointer dereference in gs2200m.c

Impact:
- This PR affects gs2200m driver.

Testing:
- Use spresense:wifi and run gs2200m daemon in STA mode.
- Then execute 'renew eth0' to obtain DHCP address.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-28 23:02:20 -05:00
SPRESENSE
27835c8c0a ramlog: Add overwrite option to ramlog
Enable overwrite of circular buffer. If RAMLOG buffer overflows,
overwrite it from the top of buffer and always keep the latest log.
2020-07-28 04:00:18 -05:00
SPRESENSE
e249a2f82f Makefile: Fix Make.dep not updated by config changes
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:

 1) Add source files by config symbol
 2) Include header files in #ifdef directive

These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
2020-07-28 03:59:45 -05:00
SPRESENSE
d560ce65ff cxd56xx: spresense: Add some improvements and fix bugs for Spresense board
- Add new functions of GNSS
- Support the lower PWM frequency
- Add CONFIG_CPUFREQ_RELEASE_LOCK
- Add high speed ADC support
- Add HPADC input gain configuration
- Add eMMC device
- Frame buffer support
- Fix SD/GNSS/sensor drivers not worked
- Build errors
- Fix nxstyle issues
2020-07-28 09:13:05 +02:00
SPRESENSE
500ead8101 drivers/modem/altair: Update altair modem driver
- Add board specific logic to altair modem dirver
- Fix issue that SPI4 RX frequency violated AC Spec
- Remove dummy buffer in altair driver
- Fix priority of SPI transfer task is too low
- Remove unnecessary configuration
- Modify timeout value for RX ready
- Fix minor bugs
2020-07-28 09:09:18 +02:00
Masayuki Ishikawa
b6218c67f8 drivers: audio: Replace license header with Apache License 2.0
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-28 00:47:39 -05:00
Johanne Schock
8792ade0fe Several USB improvements.
Kinetis: Reworked USB driver for setup out data phase.
Freedom K28: New config nshsdusb, with RNDIS support
PL2303: Try to avoid clone detection.
General: various nxstyle fixes
General: license changed
2020-07-24 13:24:53 -03:00
Xiang Xiao
a5ef3731b1 drivers/video: fb_read/fb_write need consider the current file position
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id3a475dac928ed3dff4eee96150badadf5210f44
2020-07-24 10:49:37 +02:00
Xiang Xiao
f044c82dae drivers/lcd: Remove the redundant LCD_HWCURSOR
reuse FB_HWCURSOR instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I568104a87b9c08308374a9723c248287332bc9e4
2020-07-24 10:47:02 +02:00
Xiang Xiao
da6bb94740 drivers/lcd: Don't select NX_LCDDRIVER automatically
since graphics/Kconfig already do the similar thing

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib2c1955a6b027cfa4e83c3b81ddfb505902dd85d
2020-07-24 10:47:02 +02:00
Xiang Xiao
131535dfe4 drivers/lcd: Fix the memory leak when board_graphics_setup fail
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I08a7ecc48b2c28b1c8c97f74e7a163ca67de6fca
2020-07-23 13:05:58 +01:00
SPRESENSE
e4b50c4ba0 drivers/mmcsd: Fix minor bugs
- Add missing cancel process when the send command fails
- Make it possible to recover from SD initialization error
- Reduce time in changing transfer mode to 5msec from 500msec.
  Replace usleep function instead of up_udelay in other to avoid
  blocking other tasks from working.
2020-07-22 09:51:54 -05:00
Xiang Xiao
e1ecb3e27c libc: Don't define localtime[_r] to macro when CONFIG_LIBC_LOCALTIME not define
since libc++ declare these function in ctime by:
using ::localtime[_r];

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic0bb68b44c0cab838ab7cc34baee2aaa3ca8a9b5
2020-07-19 19:35:21 -07:00
Masayuki Ishikawa
0475540c83 drivers: wireless: Add 'select SCHED_LPWORK' to WL_GS2200M
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-19 21:11:46 -05:00
Xiang Xiao
aa57174eb9 rwbuffer: Optimize the buffer algorithm
avoid the buffer flush as much as possible

Change-Id: I902f374e9540b36bd0b0c77a34cab5014a2c24fc
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-19 13:13:50 -07:00
Xiang Xiao
e7034c102f rwbuffer: Fix the wrong remaining block calculation in invalidation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I00e6e7332f397bcddfd44e1b3c5c514a8f07923f
2020-07-19 13:13:50 -07:00
Masayuki Ishikawa
f5540e8922 drivers: wireless: Fix compile error with DEBUG_WIRELESS_INFO in gs2200m.c
Also, remove an inappropriate comment.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-17 11:59:27 +01:00
Adam Feuer
65a866fbe2 support for SAMA5D27 SDMMC peripheral
- MMC and SD Card driver
- ported from imxrt_usdhc.c

Squashed commit of the following:

commit 46cbe18ad6a6e41ec2727d839f86f5670577878a
Author: Adam Feuer <adam@starcat.io>
Date:   Wed Jul 15 10:28:02 2020 -0700

    nxstyle change - Public Function Prototypes

    - instead of Public Functions

commit 486b7b62e83a78ae15b114e34846900d8fef8248
Author: Adam Feuer <adam@starcat.io>
Date:   Wed Jul 15 10:06:51 2020 -0700

    nxstyle changes

commit 28280d585a40aac99fd0e538295828ea013739b7
Author: Adam Feuer <adam@starcat.io>
Date:   Wed Jul 15 10:06:29 2020 -0700

    removing unused enum value

commit 7da6ba437e7e023d348e63c497732fea985a2d1b
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 21:17:49 2020 -0700

    CI build error fixes

    - unused vars
    - incorrect method calls

commit 145a73449b9d1eaed8a6cbf47cb53fb5b7a551f6
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 17:29:56 2020 -0700

    adding #defines to prevent unused var warning

commit 47ed2c08235816caded26a019cf33899daed1621
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 16:29:07 2020 -0700

    removing obsolete config values

commit b43f129c03a8bb8dc57ae6984d124ce9e9306196
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 09:58:42 2020 -0700

    removed obsolete config setting

commit 23e3af846ac24cac928442c7af86c5d0ef183ad3
Merge: 8b47330fe5 6f6d61eec4
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 09:53:12 2020 -0700

    Merge remote-tracking branch 'upstream/master' into feature/sama5d27-sdmmc-support

commit 8b47330fe5bb49bbd1991f2f3e2c69bdfb833d2c
Author: Adam Feuer <adam@starcat.io>
Date:   Tue Jul 14 09:51:56 2020 -0700

    replaced license headers with Apache License 2.0

commit 865e69b9a84d077ab9e05c2056dc7a515222c6c7
Author: Adam Feuer <adam@starcat.io>
Date:   Thu Jul 9 18:38:01 2020 -0700

    SAMA5D2x SDMMC peripheral support (SD Card driver)

    - reading and writing at 25 MHz and 50Mhz
    - UHS_SDR50, UHS_DDR50, and UHS_SDR104 are supported
    - ported from imxrt_usdhc.c
    - only tested on SAMA5D27

    Squashed commit of the following:

    commit e3122baef2feaeb32bb00798ae56310b2cc5c448
    Author: Adam Feuer <adam@starcat.io>
    Date:   Thu Jul 9 18:30:03 2020 -0700

        added sdmmcnsh defconfig and basic docs

    commit 12a290d7465a0a006473ba67893bf891a7bcea83
    Author: Adam Feuer <adam@starcat.io>
    Date:   Thu Jul 9 17:50:06 2020 -0700

        nxstyle changes

    commit 33409c0f63c328dc200150ba883327cadf0300b2
    Author: Adam Feuer <adam@starcat.io>
    Date:   Thu Jul 9 16:15:00 2020 -0700

        add short delay to in recvshortcrc

        - to allow SDMMC to respond

    commit 3be7a7fb6f79900042d1fdbef72810f364ac5f62
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 9 10:54:59 2020 -0700

        added SDR50 and SDR104 SDMMC bus modes

    commit 2888408866548ca53e582ea1525178a7733617b4
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 9 10:54:25 2020 -0700

        comment formatting cleanup

    commit 06cf2c39193971155eaa6f9c89a39a88b53964a8
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 9 10:34:01 2020 -0700

        removed unneeded comment

    commit ac89b69231bdf19563754865fda93d4bbbb4488d
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 9 10:30:23 2020 -0700

        code cleanup

        - removing custinfo() logging
        - remove duplicate #defines
        - move var declarations to the beginning of methods

    commit bcd4abec7935ee9023ab72edfb02685dbeee243c
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Wed Jul 8 16:34:31 2020 -0700

        handle SDMA Boundary Pause interrupt (DMAINT)

        - SDMMC_INT_DINT
        - add to waitints
        - add handler to sam_interrupt

    commit e9da026c1270e999df520ee2c60487195799f58c
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Tue Jul 7 16:07:34 2020 -0700

        Kconfig setting for SDMMC bus speed

        - 25 and 50 MHz
        - 50 MHz is the default

    commit 9edc636b7f18f981d653f85970c3af0b80801778
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Mon Jul 6 21:55:51 2020 -0700

        added HSEN bit change for high speed mode

        - above 26 MHz

    commit b8e91c95b0f7b2f8220f02b1eb42b6134e0660d0
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Mon Jul 6 21:28:03 2020 -0700

        added calloc to fix bug

        - not sure why this works.

    commit 1ceaf2f8487fe39d4d6fb21adecd57e4c4992e07
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Mon Jul 6 21:25:47 2020 -0700

        removing spurious typo characters

    commit 14ba51743bcca35686b07a76f5af17bcce078a5f
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 18:10:46 2020 -0700

        nxstyle changes

    commit d8af26df47b7840117de0d3a44ec548b3a72bc2b
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 17:01:11 2020 -0700

        nxstyle changes

    commit 0ae532bd62d02c5ac36aa2192f31fa1f7f1cde99
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 16:37:17 2020 -0700

        remove long lines in comments - nxstyle

    commit 3d025a84f8e9ddb7f7a4570504118d782dd5574c
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 16:36:52 2020 -0700

        removed custinfo logging

    commit 366b5d9d241a42d693583679cb49aa7bf25615aa
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 16:35:08 2020 -0700

        removed custinfo logging

    commit c74396e4a4943873c7de5b6ffee193787c39baef
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 16:34:36 2020 -0700

        fixed typo

    commit 7f51e99d7f4c1e5e0bf71a84fd0b2467157fea59
    Merge: c40f8c1039 2481b1bfd5
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Sat Jul 4 15:33:06 2020 -0700

        Merge remote-tracking branch 'upstream/master' into feature/sama5d27-sdmmc-support

    commit c40f8c10390ecefeb3a113046edd6740b07ab31b
    Author: Adam Feuer <adam@adamfeuer.com>
    Date:   Thu Jul 2 22:08:20 2020 -0700

        SDMMC support for SAMA5D27
2020-07-16 23:39:37 +01:00
Oleg Evseev
b6ed3392a4 drivers/can: base readers checks on cd_readers list itself
Get rid of several useless dev vars
2020-07-11 15:06:56 -03:00
Oleg Evseev
06a5b1f566 drivers/can: fix tx_sem and rx_sem to be SEM_PRIO_NONE
issue 1354
2020-07-11 15:06:56 -03:00
Anthony Merlino
731594b7d2 drivers/eeprom/spi_xx25xx: Fixes build error. 2020-07-10 12:13:22 -07:00
Beat Küng
a349595316 gpio: extend gpio_pintype_e for pulldown/up and opendrain
- fix code style
- fix bool conversion when calling go_read()
2020-07-07 08:34:25 -05:00
Oleg Evseev
1798383a2d drivers/can: correct checking sem is locked
Object filled by nxsem_get_value can be zero or a negative number
fix for 190782c2959de2b28867022941e52f429d5d07fb

issue #1354
2020-07-06 09:53:22 -03:00
Oleg Evseev
908ee31e7d drivers/can: enter_critical_section in can_poll 2020-07-05 14:38:55 -03:00
Oleg Evseev
247bc10c26 drivers/can: fix wrong use of nxsem_getvalue
Bug caused increase of fifo->rx_sem with each received msg until finally after 32767 messages get into
DEBUGASSERT(sem->semcount<SEM_VALUE_MAX);
or stopping receiving anything at all without debug, while tx was working.

issue #1354
2020-07-05 14:38:55 -03:00
Claudio Micheli
7a346bee26 stm32f7: Add the option to include RTR in CAN header
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-06-29 09:05:44 -03:00
Xiang Xiao
095e492cb3 libc: Replace nuttx/lib/math.h with math.h
Because user may replace math library with other implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Idb5f2a8b2a70302c8561553b3bcbc40529b5257f
2020-06-29 06:32:10 +02:00
Matias Nitsche
b3327419d3 tone: stop tone using 0 duty, not stop() 2020-06-25 11:04:14 +01:00
Matias Nitsche
10a9464bcf tone: start playing tune immediately without delay 2020-06-25 11:04:14 +01:00
Ouss4
701100f6f9 drivers/sensors/mpu60x0: Add I2C support. 2020-06-24 23:30:34 -03:00
Ouss4
530cad304f drivers/spi/spi_bitbang.c: Fix typos and nxstyle complaints. 2020-06-21 14:13:32 -06:00
Ouss4
bd82486f1c drivers/lcd: Add support for the ST7735 TFT controller. 2020-06-21 14:13:32 -06:00
Nakamura, Yuuichi
ec0212cc8a drivers/syslog/note_driver.c: nxstyle fix 2020-06-17 20:15:54 +08:00
Masayuki Ishikawa
ae92afd250 drivers: audio: Fix cxd56_stop in cxd56.c
In the previous implementation, cxd56_stop() checked the internal
state before sending AUDIO_MSG_STOP to the message queue. However,
if the worker thread took time to turn on AMP, cxd560_stop() was
not able to send the message and caused a deadlock.

This commit fixes this issue by always sending AUDIO_MSG_STOP
regardless of the internal state.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-06-16 08:52:40 +02:00
Matias Nitsche
53387b53c6 style fixes 2020-06-16 01:01:14 +01:00
Matias Nitsche
6c333d7cbf bmp280: support getting temperature via ioctl() 2020-06-16 01:01:14 +01:00
Alan C. Assis
3a95c41370 Fix devif_timer() function call 2020-06-15 07:13:21 -06:00
Alan C. Assis
7609b67496 Fix issues reported on PR #1233 2020-06-15 07:13:21 -06:00
Alan C. Assis
e1be7ace4b Fix netdev and add Apache license to the file 2020-06-15 07:13:21 -06:00
Adam Porter
07c0faff59 Add support to CDC-MBIM USB host driver
This driver was created by Adam Porter and posted on NuttX
mailing list at Google Group on Nov 14 2019
2020-06-15 07:13:21 -06:00
Alin Jerpelea
c6c0214f9a boards: arm: cxd56: initilize the video stream driver from the board
The video stream driver must be intialized from the board to comply with NuttX

NOTE:
Please remove the initalization from any camera example

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-06-15 08:10:49 +09:00
Alin Jerpelea
8fdfb745d6 drivers: video: fix uninitialized variables
Fix the build error by initializing the variables before we perform
th querry for the ext control.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-06-15 08:10:49 +09:00
Ouss4
02ad0e9094 drivers/leds/ncp5623c&pca9635pw: Fix nxstyle issues. 2020-06-12 17:51:23 -03:00
Ouss4
ebfc12d3d2 drivers/: Fix some drivers mode priviliges. It's not used but it's
better to get it right.
2020-06-12 17:51:23 -03:00
Ouss4
0acf6da4d8 drivers/analog/ and include/nuttx/analog: Fix typos and nxstyle issues. 2020-06-12 16:04:02 -03:00
Masayuki Ishikawa
958ddc1926 drivers: audio: Add a buffering feature to cxd56
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-06-10 09:11:15 -03:00
Masayuki Ishikawa
8a60cc01e2 drivers: audio: Send stop message when received the final buffer
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-06-10 09:11:15 -03:00
Xiang Xiao
76965474ac drivers/led: Let board_userled_initialize return the led number
so the lower half driver don't need include the specific board.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icf6638a6865bac42150b5957376e55909f041d40
2020-06-07 19:28:10 +01:00
Xiang Xiao
1ba1c34b01 drivers/led: Decopule USERLED from ARCH_HAVE_LEDS
and let USERLED_LOWER depends on ARCH_HAVE_LEDS instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie03e76d90b61a3d8d3457ccdd319a247b6075fa8
2020-06-07 19:28:10 +01:00
Xiang Xiao
1b47aa1cb2 drivers/button: Let board_button_initialize return the button number
so the lower half driver don't need include the specific board.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2ff5c30049a5c5e8ee90baea56e9f4cb1a8a4f87
2020-06-07 19:28:10 +01:00
Alan C. Assis
a7a272661e Char drivers should return -ENOTTY if CMD is not recognized 2020-06-06 14:51:02 -03:00
Ouss4
36f54e280f Fix PR1201 nxstyle issues. 2020-06-05 15:54:17 -03:00
Ouss4
8da4b02350 drivers/audio: Add CS4344 driver. 2020-06-05 15:54:17 -03:00
Tobias Johansson
368fbd0dea cxd56: Fix lock issue in Spresense audio driver
Replace semaphore with spinlock in the DMA buffer handling code
since it is called from an interrupt.
2020-06-05 19:50:27 +08:00
Masayuki Ishikawa
4b9886fa29 drivers: audio: Return -ENOTTY in xxx_ioctl() if not handled
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-06-05 12:02:33 +08:00
Gregory Nutt
0e425584b8 include/nuttx/video/video.h: Move global variable declaration out of header file
Move global variable declaration out of include/nuttx/video/video.h and into the file where it is initialized.  With some toolchains/environments, declaring globals in header files results in multiply defined symobl errors at link time.  This corrects that build problem.
2020-06-01 20:22:40 +01:00
Gregory Nutt
43183e5843 drivers/serial/pty.c: Correct returned number of bytes.
Reported by 권석근 <kwonsksj@gmail.com>:

I found a bug at "pty.c" during ssh server implementation.

When I turn on CONFIG_SERIAL_TERMIOS and OPOST|ONLCR on pty device
for nsh console's stdin/stdout (ssh shell service), I've got system crash.

Bugs at line 687 of pty.c, pty_write()
ntotal++;

when converting '\n' to '\r\n', pty_write() will return more than requested
(+1, for example) length. and this will break caller lib_fflush(), line 150
of lib_libfflush.c.
When she get (libfflush()) bytes_nwritten which is greater than nbuffer,
nbuffer goes to negative at line 150 and eventually destroys
*stream->fs_bufpos at line 163 of lib_libflush.c

Removing ntotal++;  line 687 of pty.c will fix this bug.

BTW, nsh using ptm/pty as a ssh shell service works great with libssh +
mbedtls.
2020-06-01 16:39:49 +01:00
Masayuki Ishikawa
806710b225 drivers: wireless: New flow control based on total bulk size in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-06-01 09:08:05 +02:00
Gregory Nutt
738f3c61f7 drivers/usbhost/usbhost_ft232r.c: Cosmetic
Cosmetic changes to alignment.  Also fixes some C89 non-compliance.  Sorry to be so OCD.
2020-05-28 21:17:58 +01:00
Gregory Nutt
5a9f7927ee nxstyle fixes 2020-05-28 12:22:46 -06:00
Nicholas Chin
560ba3adcd usbhost: adds a driver for the FTDI FT232R USB to serial converter 2020-05-28 12:22:46 -06:00
Kazuya Hioki
075334cfcc drivers: wireless: Fix buffer overrun in gs2200m.c
Warning ID: 85719.12039200

Reviewed-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Signed-off-by: Kazuya Hioki <Kazuya.Hioki@sony.com>
2020-05-26 15:38:43 +08:00
Xiang Xiao
8b20b97d26 build: Remove the dummy drivers folder under boards
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao
23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao
edb0ce2d5a build: Don't need use $(DELIM) in include statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao
dd61d3d9f9 build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 18:00:40 +01:00
Masayuki Ishikawa
287b9f9c38 drivers: wireless: Add WPA2-PSK in AP mode for gs2200m
NOTE: By default, WPA2-PSK is used instead of WEP

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>>
2020-05-22 10:20:07 +02:00
Masayuki Ishikawa
65e81a6159 drivers: wireless: Add do packet flow cotrol in gs2200m_ioctl_close()
NOTE: active close now works during http audio streaming

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-21 12:46:10 +02:00
Xiang Xiao
1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Masayuki Ishikawa
3c622db780 drivers: wireless: Fix pkt_q_cnt overflow in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-20 13:59:12 +02:00
Xiang Xiao
5eae32577e build: Move INCDIROPT to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Xiang Xiao
bd656888f2 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Gregory Nutt
57bc329aac Run nxstyle all .c and .h files modified by PR. 2020-05-17 14:01:00 -03:00
Gregory Nutt
a569006fd8 sched/: Make more naming consistent
Rename various functions per the quidelines of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions

    nxsem_setprotocol -> nxsem_set_protocol
    nxsem_getprotocol -> nxsem_get_protocol
    nxsem_getvalue -> nxsem_get_value
2020-05-17 14:01:00 -03:00
Masayuki Ishikawa
60b404e076 drivers: wireless: Apply max payload size to gs2200m.c
Also, remove unnecessary initialization for tx packet.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-15 06:49:02 -06:00
Masayuki Ishikawa
3ead63c353 drivers: wireless: Fix to bind() with port=0 in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-14 14:17:47 +02:00
Masayuki Ishikawa
21c588b126 drivers: wireless: Add support for getsockname() to gs2200m
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-14 14:17:47 +02:00
Matias Nitsche
e0d21275df fix all remaining nxstyle errors 2020-05-14 08:32:48 +02:00
Matias Nitsche
5fd9bd5837 stm32: moved all remaining sensor initialization to common board logic 2020-05-14 08:32:48 +02:00
Masayuki Ishikawa
ef169b7ebf drivers: wireless: Handle multiple incoming packets in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-13 13:11:08 +02:00
Juha Niskanen
d666aa623f drivers/mtd/filemtd.c: fix build error 2020-05-11 09:25:45 -04:00
Xiang Xiao
517974787f Rename clock_systime[r|spec] to clock_systime_[ticks|timespec]
follow up the new naming convention:
https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-10 14:35:50 -06:00
Xiang Xiao
b7d922960f Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-08 07:20:49 -06:00
Tobias Johansson
f2c957144a cxd56: Add input support to Spresense audio driver
Add recording support to the Nuttx audio driver for Spresense.
- Supports 16 bit data with 48 kHz sample rate only for now.
- Supports 1 (dual mono) 2 or 4 channels.
- Only analog mics have been tested so digital is considered
  unsupported.
2020-05-08 07:18:22 -06:00
Xiang Xiao
3e00d182d2 Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-06 20:53:11 -06:00
Xiang Xiao
94bb2e05bb syslog: Code outside libc shouldn't call nx_vsyslog directly
since nx_vsyslog is the implementation detail

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-06 20:53:11 -06:00
Pelle
b525218b55 Changed headers for apache 2.0 license 2020-05-05 12:20:53 -06:00
Pelle
59fcd9a3ee hdc1008: minor fixes to comments. 2020-05-05 12:20:53 -06:00
Pelle
8a0b2bc14e Added driver for the hdc1008 temperature/humidity sensor. 2020-05-05 12:20:53 -06:00
Xiang Xiao
d9d2fc0d0a debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-05 08:27:58 -06:00
Xiang Xiao
32b79b22ec Rename pipe2/mkfifo2 to nx_pipe/nx_mkfifo
and don't modify errno anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-04 07:20:02 -06:00
Xiang Xiao
f8a809eb5b Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
Masayuki Ishikawa
350ffb20ad drivers: wireless: Improve packet receiving performance in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-04-30 09:09:17 +02:00
Masayuki Ishikawa
a5e4f0435d drivers: wireless: Fix packet queue overflow in gs2200m.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-04-30 09:09:17 +02:00
Ouss4
d0bb7c137a Use NuttX's signal set functions inside the OS. 2020-04-29 16:40:27 -06:00
liuhaitao
bd924bf7fb syslog: correct to #ifdef CONFIG_SYSLOG_RPMSG to call syslog_rpmsg_init
Same as syslog/Make.defs to use #ifdef CONFIG_SYSLOG_RPMSG to build syslog_rpmsg.c
in which syslog_rpmsg_init defined.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-29 07:08:25 -06:00
Xiang Xiao
972033a61f syslog: Check sc_flush in't NULL before invocation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-27 13:48:56 +08:00
Xiang Xiao
e9773addfa syslog/rpmsg: Fix warning: ‘syslog_rpmsg_write’ defined but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-27 13:48:56 +08:00
zhongan
927cb00f5e fix nxstyle warning
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-26 19:53:43 -06:00
zhongan
546e35fc98 drivers/rptun: replace 'rxbuf_size' and 'txbuf_size' to 'buf_size' in struct 'rptun_rsc_s'.
Change-Id: I7c9da4bd985712a3fde4c56999901434740b33f7
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-26 19:53:43 -06:00
Tobias Johansson
79589eca1a cxd56: replace Sony return values
- Replace Sony error codes with standard ones where possible
- Unify error message and remove some unnecessary info prints
2020-04-21 17:19:52 -06:00
Tobias Johansson
ecc4939453 cxd56: fix volume setting and improve volume range
- Setting volume now works except when in paused state
- Volume range decreased to be a little more sane
2020-04-21 17:19:52 -06:00
Tobias Johansson
36e756a915 cxd56: add support for pause and resume
Implements pause and resume functionality
2020-04-21 17:19:52 -06:00
Tobias Johansson
7a83177419 cxd56: disable unused audio effects
Disables audio effects that are not currently in use.
Also fixes some minor indentation issues.
2020-04-21 17:19:52 -06:00
Alin Jerpelea
d9d720b296 audio: nxstyle fixes for core and drivers
nxstyle fixes for the audio core and drivers

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-04-21 17:19:52 -06:00
Xiang Xiao
6ad91aeb05 Kconfig: change the stack size default to DEFAULT_TASK_STACKSIZE
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-18 07:17:38 -06:00
Tobias Johansson
57e8f0451a cxd56: add initial Nuttx audio driver
Adds an initial Nuttx audio driver supporting the Spresense CXD56.
Being a work in progress the driver has a number of limitations:
- Audio playback only, no recording yet.
- Only 16 bit stereo playback is supported.
- In practice only 48kHz playback is supported due to missing SRC.
- Configure driver in "Device Drivers --> Audio Device Support".
2020-04-16 12:50:05 -06:00
Nathan Hartman
3c829226f9 Fix typos and nxstyle complaints.
arch/x86_64/src/intel64/intel64_tickless.c:
boards/x86_64/intel64/qemu-intel64/src/qemu_freq.c:
drivers/modem/altair/altmdm.c:

    * Fix typos and nxstyle complaints.
2020-04-15 17:04:58 +01:00
zhongan
b4a50a9192 fix nxstyle warning.
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-15 12:30:50 -03:00
zhongan
987472d3bb syslog/rpmsg: remove unused local variable 'g_syslog_rpmsg_channel' which would cause build break.
Change-Id: Ie02ef9202ec2a9ecade62c47e4f8956adb96673f
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-15 12:30:50 -03:00
zhongan
ab566de77a syslog/rpmsg: fix the naming conflict of function 'syslog_rpmsg_putc'.
Change-Id: I3f89bfed71edb85bc3006446c1f9141e95202b5c
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-15 12:30:50 -03:00
Gregory Nutt
6548b41cab drivers/usbdev/usbmsc.c: Run nxstyle; fix complaints. 2020-04-15 12:30:08 -03:00
Juha Niskanen
c2ecdaecf7 drivers/usbdev/usbmsc.c: Fix build error with DEBUGASSERT 2020-04-15 12:30:08 -03:00
Masayuki Ishikawa
6725a29b60 drivers: wireless: Add support for UDP connect in gs2200m.c
NOTE: gs2200m_main.c needs to be updated as well

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-04-14 13:07:17 +02:00
Xiang Xiao
d3c4879113 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-13 12:01:39 -06:00
Xiang Xiao
b22e3b9e28 nuttx: Fix the nightly build warning
lpc2148_spi1.c:142:24: warning: initialization of 'uint32_t (*)(struct spi_dev_s *, uint32_t)' {aka 'unsigned int (*)(struct spi_dev_s *, unsigned int)'} from incompatible pointer type 'uint16_t (*)(struct spi_dev_s *, uint16_t)' {aka 'short unsigned int (*)(struct spi_dev_s *, short unsigned int)'} [-Wincompatible-pointer-types]
  142 |   .send              = spi_send,
      |                        ^~~~~~~~
lpc2148_spi1.c:142:24: note: (near initialization for 'g_spiops.send')

In file included from ieee802154/mac802154_bind.c:49:
ieee802154/mac802154_internal.h: In function 'mac802154_setdevmode':
ieee802154/mac802154_internal.h:788:42: warning: converting a packed 'enum ieee802154_devmode_e' pointer (alignment 1) to a 'const union ieee802154_attr_u' pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  788 |                         (FAR const union ieee802154_attr_u *)&mode);
      |                                          ^~~~~~~~~~~~~~~~~

chip/stm32_hciuart.c: In function 'hciuart_read':
chip/stm32_hciuart.c:2104:30: warning: statement with no effect [-Wunused-value]
 2104 |                       ntotal == (ssize_t)ret;
      |                       ~~~~~~~^~~~~~~~~~~~~~~

wireless/ieee80211/bcm43xxx/bcmf_driver.c: In function 'bcmf_wl_auth_event_handler':
wireless/ieee80211/bcm43xxx/bcmf_driver.c:579:23: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  579 |   type = bcmf_getle32(&event->type);
      |                       ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/bcmf_driver.c:580:25: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  580 |   status = bcmf_getle32(&event->status);
      |                         ^~~~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/bcmf_driver.c: In function 'bcmf_wl_scan_event_handler':
wireless/ieee80211/bcm43xxx/bcmf_driver.c:619:25: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  619 |   status = bcmf_getle32(&event->status);
      |                         ^~~~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/bcmf_driver.c:620:35: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  620 |   escan_result_len = bcmf_getle32(&event->len);
      |                                   ^~~~~~~~~~~
wireless/ieee80211/bcm43xxx/bcmf_bdc.c: In function 'bcmf_bdc_process_event_frame':
wireless/ieee80211/bcm43xxx/bcmf_bdc.c:166:27: warning: taking address of packed member of 'struct bcmf_event_s' may result in an unaligned pointer value [-Waddress-of-packed-member]
  166 |   event_id = bcmf_getle32(&event_msg->event.type);
      |                           ^~~~~~~~~~~~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c: In function 'sdio_io_rw_direct':
wireless/ieee80211/bcm43xxx/mmc_sdio.c:157:3: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  157 |   ret = SDIO_RECVR5(dev, SD_ACMD52, (uint32_t *)&resp);
      |   ^~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c: In function 'sdio_io_rw_extended':
wireless/ieee80211/bcm43xxx/mmc_sdio.c:239:11: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  239 |           ret = SDIO_RECVR5(dev, SD_ACMD53, (uint32_t *)&resp);
      |           ^~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:244:11: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  244 |           ret = SDIO_RECVR5(dev, SD_ACMD53, (uint32_t *)&resp);
      |           ^~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:257:7: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  257 |       ret = SDIO_RECVR5(dev, SD_ACMD53, (uint32_t *)&resp);
      |       ^~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:265:3: warning: converting a packed 'struct sdio_resp_R5' pointer (alignment 1) to a 'uint32_t' {aka 'unsigned int'} pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
  265 |   SDIO_RECVR1(dev, SD_ACMD52ABRT, (uint32_t *)&resp);
      |   ^~~~~~~~~~~
wireless/ieee80211/bcm43xxx/mmc_sdio.c:79:28: note: defined here
   79 | begin_packed_struct struct sdio_resp_R5
      |                            ^~~~~~~~~~~~

chip/stm32_adc.c: In function 'adc_reset':
chip/stm32_adc.c:2860:7: warning: unused variable 'ret' [-Wunused-variable]
 2860 |   int ret;
      |       ^~~
chip/stm32_adc.c: In function 'adc_shutdown':
chip/stm32_adc.c:3044:7: warning: unused variable 'ret' [-Wunused-variable]
 3044 |   int ret;
      |       ^~~

chip/stm32_i2c.c:722:12: warning: 'stm32_i2c_sem_wait_noncancelable' defined but not used [-Wunused-function]
  722 | static int stm32_i2c_sem_wait_noncancelable(FAR struct i2c_master_s *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

wireless/gs2200m.c: In function 'gs2200m_read':
wireless/gs2200m.c:727:20: warning: passing argument 1 of 'nxsem_wait' from incompatible pointer type [-Wincompatible-pointer-types]
  727 |   ret = nxsem_wait(dev);
      |                    ^~~
      |                    |
      |                    struct gs2200m_dev_s *

.config:1207:warning: symbol value '' invalid for TESTING_OSTEST_FPUSIZE

platform/audio/cxd56_audio_analog.c:69:13: warning: inline function 'cxd56_audio_clock_is_enabled' declared but never defined
   69 | inline bool cxd56_audio_clock_is_enabled(void);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
platform/audio/cxd56_audio_analog.c:68:13: warning: inline function 'cxd56_audio_clock_disable' declared but never defined
   68 | inline void cxd56_audio_clock_disable(void);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
platform/audio/cxd56_audio_analog.c:67:13: warning: inline function 'cxd56_audio_clock_enable' declared but never defined
   67 | inline void cxd56_audio_clock_enable(uint32_t clk, uint32_t div);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~

chip/stm32_adc.c: In function 'adc_reset':
chip/stm32_adc.c:1348:7: warning: unused variable 'ret' [-Wunused-variable]
 1348 |   int ret;
      |       ^~~
chip/stm32_adc.c: In function 'adc_shutdown':
chip/stm32_adc.c:1496:7: warning: unused variable 'ret' [-Wunused-variable]
 1496 |   int ret;
      |       ^~~

chip/stm32_i2c.c:729:12: warning: 'stm32_i2c_sem_wait_uninterruptble' defined but not used [-Wunused-function]
  729 | static int stm32_i2c_sem_wait_uninterruptble(FAR struct i2c_master_s *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

wireless/lpwan/sx127x/sx127x.c:147:52: warning: missing terminating ' character
  147 | #  warning OOK support is not complete, RX+TX doesn't work yet!
      |                                                    ^

str71_spi.c:435:24: warning: initialization of 'uint32_t (*)(struct spi_dev_s *, uint32_t)' {aka 'unsigned int (*)(struct spi_dev_s *, unsigned int)'} from incompatible pointer type
                                               'uint16_t (*)(struct spi_dev_s *, uint16_t)' {aka 'short unsigned int (*)(struct spi_dev_s *, short unsigned int)'} [-Wincompatible-pointer-types]
  435 |   .send              = spi_send,
      |                        ^~~~~~~~
str71_spi.c:435:24: note: (near initialization for 'g_spiops.send')

chip/pic32mx-lowconsole.c:147:24: warning: 'pic32mx_getreg' defined but not used [-Wunused-function]
 static inline uint32_t pic32mx_getreg(uintptr_t uart_base,
                        ^
chip/pic32mx-gpio.c:113:20: warning: 'pic32mx_value' defined but not used [-Wunused-function]
 static inline bool pic32mx_value(uint16_t pinset)
                    ^
chip/pic32mz-gpio.c:124:20: warning: 'pic32mz_value' defined but not used [-Wunused-function]
 static inline bool pic32mz_value(pinset_t pinset)
                    ^
chip/pic32mx-usbdev.c:3065:1: warning: 'pic32mx_epreserved' defined but not used [-Wunused-function]
 pic32mx_epreserved(struct pic32mx_usbdev_s *priv, int epno)
 ^

mmcsd/mmcsd_spi.c: In function 'mmcsd_mediachanged':
mmcsd/mmcsd_spi.c:1938:7: warning: 'return' with a value, in function returning void
       return ret;
       ^

In file included from partition/fs_partition.c:42:0:
partition/partition.h:66:19: warning: 'read_partition_block' defined but not used [-Wunused-function]
 static inline int read_partition_block(FAR struct partition_state_s *state,
                   ^

local/local_netpoll.c: In function 'local_pollsetup':
local/local_netpoll.c:305:1: warning: label 'pollerr' defined but not used [-Wunused-label]
 pollerr:
 ^~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: If3ea8f32b878aa218072130f7c3018f0d3c1aca5
2020-04-13 12:01:39 -06:00
Gregory Nutt
759d8c1bfa Run nxstyle against files modified in previous commit. 2020-04-13 02:09:34 +08:00
Gregory Nutt
ca2b0a3657 Fix more warnings noted in PR checks
arp/arp_notify.c:132:43: warning: for loop has empty body [-Wempty-body]
           prev = curr, curr = curr->nt_flink);
                                              ^

    sixlowpan/sixlowpan_tcpsend.c:806:31: warning: implicit conversion from 'unsigned int' to 'uint16_t' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Wconstant-conversion]
                                  _SO_TIMEOUT(psock->s_sndtimeo));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Numerous warnings like:

    ieee802154_getreq.c:93:3: warning: implicit declaration of function 'memcpy' is invalid in C99 [-Wimplicit-function-declaration]
      IEEE802154_EADDRCOPY(eaddr, req.attrval.mac.eaddr);
      ^

    nxfonts/nxfonts_cache.c:839:35: warning: for loop has empty body [-Wempty-body]
               fcache = fcache->flink);

    bluetooth/bluetooth_finddev.c💯11: warning: implicit declaration of function 'memcmp' is invalid in C99 [-Wimplicit-function-declaration]
          if (BLUETOOTH_ADDRCMP(dev->d_mac.radio.nv_addr, match->bf_addr))
              ^

    rwbuffer.c:559:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (rwb->rhmaxblocks > 0 && rwb->rhnblocks > 0)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-04-13 02:09:34 +08:00
Gregory Nutt
2aabf76815 Run nxstyle against modified files in PR 2020-04-13 02:09:34 +08:00
Gregory Nutt
62c1389825 Fix warnings noted in PR build checks:
net/telnet.c:1317:40: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
                      if (priv->td_pending < CONFIG_TELNET_RXBUFFER_SIZE)
                          ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    time/lib_localtime.c:569:32: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [33]' [-Wsizeof-array-decay]
              sizeof(lsp->fullname - 1) <= strlen(p) + strlen(name))
                     ~~~~~~~~~~~~~ ^
2020-04-13 02:09:34 +08:00
ligd
cbf31bca5c global change: fix tools/checkpatch.sh warnnings
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
ligd
231ad202ee global change: repace sched_xfree() to kxmm_free()
Changes:
sched_xfree() => kxmm_free()
remove garbage related APIs
remove ARCH_HAVE_GARBAGE

Cause garbage feature move to mm_heap, then don't need
garbage anymore.

Change-Id: If310790a3208155ca8ab319e8d038cb6ff92c518
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
hartmannathan
bfc153ca27
Fix typos in comments and documentation (#750)
* Fix typos in comments and documentation
2020-04-08 06:45:35 -06:00
Nakamura, Yuuichi
9029e4daee Fix nxstyle issues 2020-04-07 06:23:15 -06:00
Nakamura, Yuuichi
776e469b02 Remove type casting to wdentry_t (drivers/) 2020-04-07 06:23:15 -06:00
Gregory Nutt
a6e69a82ad SDIO: Make interface field names conform to standard.
The SDIO interface structure includes fields with names like recvR1 and others.  These cause "Mixed case identifier" errors from nxstyle in all places they are uses.
This change performs a mass substition of recvR with recv_r to correct this coding standard violation.
2020-04-04 18:15:25 +01:00
Ouss4
f438220555 drivers/1wire/1wire.c: Fix a typo that caused a build failure. 2020-04-02 19:42:07 -06:00
Gregory Nutt
9ff1795760 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for rwbuffer.c and those files under drivers/serial, drivers/timers, and drivers/usbdev.

This commit completes that step for all of the files under drivers/.  Still remaining:  All of the files under arch/.
2020-04-01 14:20:04 -03:00
Pelle Windestam
f26dda88d1 drivers/i2c: fixed nxstyle warnings 2020-04-01 08:03:50 +02:00
Pelle Windestam
2b9bdc04cc drivers/can: fixed nxstyle warnings 2020-04-01 08:03:50 +02:00
Gregory Nutt
92eae74340 drivers/rwbuffer.c: Back out unfinished changes
This file is a work in progress and was accidentally committed with some other files.  This PR backs out those changes until I can better verify the changes.
2020-03-31 22:52:39 +01:00
Ouss4
997d4fabb0 Check return from nxsem_wait_uninterruptible
This commit is only for those files under drivers/1wire, drivers/bch,
drivers/can and drivers/mmcsd.
2020-03-31 14:58:09 -06:00
Gregory Nutt
986e594563 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under drivers/pipes and drivers/wireless.
2020-03-31 21:52:50 +01:00