Commit graph

4114 commits

Author SHA1 Message Date
yangjiukui
eafc254e14 Fix: Sensor: Fix the use of ioexpander and delete redundant member of opt3006.
N/A

Add pull up when using SETDIRECTION; Using transformation replace pinset;
Delete i2c point in opt3006 device struct.

Signed-off-by: yangjiukui <yangjiukui@xiaomi.com>
Change-Id: I7e46d0cde878fbca325f89be47c57ff9b9456ff0
2021-07-12 15:30:37 +08:00
Jiuzhu Dong
4c867f3b6d syslog: optimize init logic for early buffer initialize
N/A

Change-Id: I3295803977fa51e8ed8dedf7f0966b9604f8204d
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-08 14:16:21 +08:00
Jiuzhu Dong
e63fe68980 ramlog: init head and tail when buffer is empty on boot
N/A

Change-Id: I6963ef6256c3a93ac7a63115c303033ceafa321f
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-08 14:05:13 +08:00
Jiuzhu Dong
c5e6c0a99f Revert "fix(ramlog): fix initial ramlog buffer pointer overflow"
This reverts commit 76242c5ee1.
2021-07-08 11:43:23 +08:00
chenwei23
76242c5ee1 fix(ramlog): fix initial ramlog buffer pointer overflow
description: modify function ramlog_initbuf in
drvers/syslog/ramlog.c to fix initial ramlog buffer
pointer overflow

Signed-off-by: chenwei23 <chenwei23@xiaomi.com>
Change-Id: I38e2d5c726e3af11c4b47245197fec5cbe4af1f6
2021-07-07 14:33:19 +08:00
xiatian6
cf9baa0178 feature(nuttx sensor driver): add ak09919c mag sensor dirver.
Add ak09919c mag sensor dirver.

Change-Id: Ie90149689a50dc4f68aa1802d00bb818092ed795
Signed-off-by: xiatian6 <xiatian6@xiaomi.com>
2021-07-05 09:22:04 +08:00
ligd
772044bbdf serial: add ioctl TIOCNOTTY
Change-Id: I14ab1304d6330578423e0775f42faa8e19886fef
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-01 18:26:20 +08:00
ligd
23f948aa7f syslog: add CPU id to system when open CONFIG_SMP
Change-Id: Ie8aaf44583ff4146b79b1392d1410b31806a81e8
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-01 18:26:20 +08:00
丁欣童
cf3d397dd7 sensor/fakesenor: fix set_interval fail sometime.
N/A

When fakesensor was activated, csv file is not opened timely, so
the sensor->interval that set_interval() seted will be coverd by
interval form csv file.

Signed-off-by: 丁欣童 <dingxintong@xiaomi.com>
Change-Id: I611587f886c4d2eb6ddb6c28e575e0a0d2ac9cec
2021-06-30 15:00:10 +08:00
Jiuzhu Dong
d78b1ff5b3 ramlog: fix compile break
Change-Id: I03afb41790dbba1d3290c566b099fe511771de3c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-29 16:56:35 +08:00
Jiuzhu Dong
6d883bbb5d driver/sensor: fix crash casued by closing the handle during the reading.
N/A

Change-Id: I0632f3f81192b3924302f9b363497822b1117032
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-28 19:53:40 +08:00
Xiang Xiao
d37d8e00a5 mtd: Add MTDIOC_FLUSH IOCTL like MTDIOC_XIPBASE
since the old design reuse BIOC_FLUSH for
MTD device which make some confusion

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-28 18:06:52 +08:00
yangjiukui
b112e70f8b L61: Sensor: Add driver for OPT3006 light sensor.
N/A

Add light sensor.

Signed-off-by: yangjiukui <yangjiukui@xiaomi.com>
Change-Id: If0695aaec21476e68d739c420db732b184c178bb
2021-06-25 17:47:55 +08:00
Xiang Xiao
800754a9be Replace mktime with timegm in rtc and fs driver
since kernel component should use UTC instead local time

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icf939e1ab0af8e577105f539d2553bc67b3b3d10
2021-06-24 20:53:53 +08:00
Jiuzhu Dong
05d9dc5682 syslog: fix crash when print localtime by syslog
N/A

Enable
CONFIG_LIBC_LOCATIME=y
CONFIG_SYSLOG_TIMESTAMP_FORMATTED=y
CONFIG_SYSLOG_TIMESTAMP_LOCALTIME=y
CONFIG_SYSLOG_TIMESTAMP_REALTIME=y

Change-Id: I322830e0818237a7eb65a158a6a0dea8f9da9b6c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
(cherry picked from commit 95f97277caf827e145275a1a3b6d82a4535c8c4d)
2021-06-23 10:28:35 +08:00
chao.an
96f5a5f2c0 drivers/rptun: replace the notification mech from signal to semaphore
Change-Id: Ic06b945effa876f5aff2f8ddc1fe5775c75f77b1
Signed-off-by: chao.an <anchao@xiaomi.com>
(cherry picked from commit 8df58e5675cab032da16e371c4686929a19ee897)
2021-06-18 20:37:47 +08:00
Jiuzhu Dong
2e6932316e syslog/ramlog_channel: fix log confusion when multi task writing together
N/A

Change-Id: I2a17a81028862ccdd3936862e2548f93c4837ae1
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
(cherry picked from commit a96a9ef5279f50f7fb7fb262cb2b1cd5285f2d8b)
2021-06-17 22:02:39 +08:00
Jiuzhu Dong
90abae1b91 syslog/default_channel: fix log confusion when multi task writing together
N/A

Change-Id: I3ef830c437bd9631272a300e309b88c84fdaa275
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
(cherry picked from commit 74d9cb80b38109392029206f66f6b8af63229bbc)
2021-06-17 22:01:41 +08:00
Xiang Xiao
8b26671c40 syslog/ramlog: Remove the duplication of \n->\r\n conversion
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5497f3ab40a55c5c08ba893e1186b93915cef03a
2021-06-17 21:52:54 +08:00
Xiang Xiao
4d66266a8e sched: Don't include nuttx/sched.h inside sched.h
But let nuttx/sched.h include sched.h instead to
avoid expose nuttx kernel API to userspace.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6fe673364be9eb1259381e6575d4c1a9fea58097
2021-06-13 00:25:26 -07:00
Xiang Xiao
e4143c66d9 serial/pty: Initialize the terminal setting as a console
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie80a22b7a074d048435524d86f0ca7fc7a20e756
2021-06-11 06:28:55 -07:00
Xiang Xiao
ae28e03f1f serial/pty: Don't return -NOSYS if pollfd::events equals 0
since the caller is free not to monitor any event

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib957be1b1b5a686faea0196bc9069e0908a492eb
2021-06-11 05:05:27 -07:00
Jiuzhu Dong
f0ba04eb2b syslog/ramlog: write zero for the overwrite area
N/A

Change-Id: I8f8d8c53e77ee9d916cb97ea7cd3e988fbbe9ad2
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
(cherry picked from commit 4d8124a28048ea7ba7717d999553028e5384d631)
2021-06-07 10:09:52 +08:00
Jiuzhu Dong
47f09e2a18 syslog/intbuf: output log when syslog interrupt buffer is full
N/A
instead of adding overrun memssage:"[truncated]\n" to the end.

Change-Id: Ie27cdf0ca902d9ba203619a95162f01222e371c5
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-04 13:46:45 +08:00
Xiang Xiao
3c33d253b4 drivers/syslog: Remove emergstream implementation and caller
since emergstream always call syslog_force, but syslog_force is designed
for the interrupt context, and then doesn't mean any emergency thing.
On the other hand, emergstream has other bad side effect:
1.Can't output to file or dev channel
2.Can't work well with the interrupt buffer

Change-Id: I1c7af74f82da93ffa4ebe0e6ac25634aeb73a890
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-04 13:46:41 +08:00
chao.an
e223790148 serial/uart/h4: add bt h4 uart serial driver
Change-Id: I456622ce097006447cc8b050e4a44ee96865ddfe
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:33:20 +08:00
chao.an
8f0cc709d4 wireless/bluetooth: decoupling bt_driver_s and bt_buf_s
Change-Id: I12879c364cf8ca63898da94621e94d8fc23a4f6f
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:33:14 +08:00
chao.an
df71da9450 bluetooth/filter: add more OGF into ble blacklist
Change-Id: I4f1b98dc63ab2d9eeb523b8040aae88ea285bb9a
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-31 21:00:01 +08:00
chao.an
438774a560 bluetooth: fix exclusive deadlock on high priority thread
Change-Id: I0653374507b4372dce1ec1274b38da72f3ac6f03
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-31 21:00:01 +08:00
Jiuzhu Dong
78f4220106 syslog: set default value for SYSLOG_DEFAULT based on the usage of other syslog channels.
N/A

Change-Id: I702a7e3d4fee2f17419a8b7e184b2646b871b64a
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-25 15:22:10 +08:00
Jiuzhu Dong
418923540d syslog/ramlog: initialize g_sysdev based on the current ramlog buffer
N/A
by ramlog_initbuf();
Algorithm: Scan the entire ramlog buffer, the position of the head
is the first byte is not empty and second byte is empty. The position
of the tail is the first byte is empty and second byte is not empty.

Change-Id: Ieb9161bd670481cd335e9a901287cd5e589f0849
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-20 22:28:11 +08:00
Jiuzhu Dong
e318b040f8 syslog/syslog_channel: fix compile warning
N/A

syslog/syslog_channel.c: In function ‘syslog_default_putc’:
syslog/syslog_channel.c:139:10: warning: implicit declaration of function ‘up_putc’ [-Wimplicit-function-declaration]
  139 |   return up_putc(ch);
      |          ^~~~~~~

Change-Id: I30f607c000fefc6a1189397e6ae2320c562a67ec
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-20 22:04:25 +08:00
Jiuzhu Dong
bd10e5716d syslog/ramlog: save ramlog to fixed section
N/A

we can reload ramlog after hot reboot.

Change-Id: Iee7c105a2358075302121d6bf0047bc54d07e9a6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-20 20:06:38 +08:00
Jiuzhu Dong
d2e9d1bf02 syslog: fix bug for support multi syslog channel
N/A

Change-Id: I6d8b5bce8071f11b1903fe1fa0fe8dbc34bf3a09
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-20 20:03:37 +08:00
Jiuzhu Dong
36a0dae82a syslog: support ramlog, up_putc, rpmsg_syslog coexist
N/A

Change-Id: Ia58c7e195da7ad48f3018a131a78b2f01f94e741
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-20 11:04:39 +08:00
Xiang Xiao
874e564c89 drivers/serial: Change the default value of SERIAL_NPOLLWAITERS to 4
since the console is normally opened three time as stdin, stdout and
stderr and remove the dependence on STANDARD_SERIAL because other type
of serial drivers also support the poll through the same codebase.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie68322c4647cc838b295491329969869d6ba310b
2021-05-17 19:55:40 +08:00
Jiuzhu Dong
639c2c5cb2 syslog/Kconfig: support config multi syslog channel
N/A

delete choice for select syslog log device

Change-Id: Ifc02e687526506afac46febec375062949869356
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
(cherry picked from commit 795f2d56dad1f30fd23ae1868226ee8379fd4f93)
2021-05-12 13:08:40 +08:00
Jiuzhu Dong
9a956df67b sim_addrenv: support add addrenv dynamically multiple times.
N/A

Change-Id: Ie34f6c59bc16fb147c7103978253dbe9403990d3
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:26:39 +08:00
Jiuzhu Dong
788e409cb7 driver/syslog: add config SYSLOG_RPMSG_SERVER_NAME to
N/A

specified the name of remote proc(rpmsg server)

Change-Id: Ie270d651071e87a40a80ab489597ae18db9814f0
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:22:28 +08:00
Jiuzhu Dong
a099f22123 driver/rtc: add config CONFIG_RTC_RPMSG_SERVER to
N/A
select rtc rpmsg role.

Change-Id: I7f9053b070593573caa5d988c6a2e13593da6bc5
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:19:07 +08:00
Jiuzhu Dong
436180b6ad driver/rtc: add config RTC_RPMSG_SERVER_NAME to
N/A

specified the name of remote proc(rpmsg server)

Change-Id: I0086bb43727a2bbb5e68f88907b5e4608182ef9c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:16:09 +08:00
chao.an
dcc2db8d40 make/archive: replace the dependency to preprequisite list
Change-Id: Id63f3cd32906461a54cb016ef8078d4d922845e2
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-07 21:34:45 +08:00
liuhaitao
dc639b2b59 Merge remote-tracking branch 'mirtos/master' into dev-upmerge-nuttx-10.1-0507
Change-Id: I4bb3a61356be2b4a77ccfe45390b15e68a376dd6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2021-05-07 20:46:07 +08:00
liuhaitao
e3166ecac0 Revert "make/archive: replace the dependency to preprequisite list"
This reverts commit 9c946e2af6.

Change-Id: Ia8b7726d036c861d5eda51765d330e894e0d214a
2021-05-07 16:38:39 +08:00
ligd
4a219c2889 serial: add ctrl+@ to force crash system for debugging
Change-Id: Iee65ac6c94ff298cfadf4429936b3744c16b8698
Signed-off-by: ligd <liguiding1@xiaomi.com>
(cherry picked from commit 659679bbb0d7b405e19eb00b13c5b8b388eaf68d)
2021-05-06 22:05:07 +08:00
Jiuzhu Dong
6b78e90fc1 syslog/ramlog: get ramlog size by ioctl
N/A

Change-Id: I092334f3247c6c13f3be35169f192bd0777435ef
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-04-25 14:22:05 +08:00
Masayuki Ishikawa
97e6d35c3a drivers: wireless: Fix AT command response handling in gs2200m.c
Summary:
- When sending an AT command during receiving a bulk packet,
  the bulk packet might be put in the AT command response.
- To handle such the case, gs2200m_send_cmd2() is newly
  introduced instead of using gs2200m_send_cmd(dev, cmd, NULL)

Impact:
- All use cases that send an AT command in gs2200m.c

Testing:
- Tested with renew and nxplayer with spresense:wifi

Reported-by: Masatoshi Ueno <Masatoshi.Ueno@sony.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-04-15 21:28:25 -05:00
Marco Krahl
05b889457e 1wire: Removes duplicate device information
Removes the family identifier from the device configuration, since the device
family is already part of the rom code and the underlying logic does know how
to extract this information.

include/nuttx/1wire drivers/sensors

stm32f103-minimim

Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
2021-04-15 02:28:42 -05:00
Marco Krahl
9f9d266f68 drivers/sensors: Adds new driver for ds18b20 sensore module
Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
2021-04-14 02:49:28 -05:00
Marco Krahl
624a60f456 drivers/1wire: Adds some improvents
The following changes where added.
- Removes dependency to slave structure. Selecting a device on the bus only
  requires the unique romcode.

- Make search operation mutual exclusive on the bus. This is necessary to
  prevent another driver instance from making a transition on the bus at
  the same time.

- Skip also rom when only 1 slave is expected on the bus. Physical
  connected devuce should be indicated by the maxslave paramter during
  initializing, not the reigstered slaves.

- Fixes some compiler warnings in existing ds28e17 driver.

Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
2021-04-14 02:49:28 -05:00