Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pc-ble-driver-sd_api_v6
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Donald Chen
pc-ble-driver-sd_api_v6
Commits
b85eda30
Commit
b85eda30
authored
Feb 05, 2019
by
Donald Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h5 timing, remove segger baud workaround, 115200 baud.
parent
91f73f21
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
7 deletions
+15
-7
examples/heart_rate_collector/main.c
examples/heart_rate_collector/main.c
+1
-1
examples/heart_rate_monitor/main.c
examples/heart_rate_monitor/main.c
+2
-2
src/common/transport/h5_transport.cpp
src/common/transport/h5_transport.cpp
+5
-2
src/common/transport/uart_boost.cpp
src/common/transport/uart_boost.cpp
+7
-2
No files found.
examples/heart_rate_collector/main.c
View file @
b85eda30
...
...
@@ -74,7 +74,7 @@
#endif
#ifdef __linux__
#define DEFAULT_UART_PORT_NAME "/dev/ttyACM0"
#define DEFAULT_BAUD_RATE 1
0000
00
#define DEFAULT_BAUD_RATE 1
152
00
#endif
enum
...
...
examples/heart_rate_monitor/main.c
View file @
b85eda30
...
...
@@ -87,7 +87,7 @@
#endif
#ifdef __linux__
#define DEFAULT_UART_PORT_NAME "/dev/ttyACM0"
#define DEFAULT_BAUD_RATE 1
0000
00
#define DEFAULT_BAUD_RATE 1
152
00
#endif
#define ADVERTISING_INTERVAL_40_MS 64
/**< 0.625 ms = 40 ms */
...
...
@@ -777,7 +777,7 @@ int main(int argc, char * argv[])
fflush
(
stdout
);
m_adapter
=
adapter_init
(
serial_port
,
baud_rate
);
sd_rpc_log_handler_severity_filter_set
(
m_adapter
,
SD_RPC_LOG_
TRACE
);
sd_rpc_log_handler_severity_filter_set
(
m_adapter
,
SD_RPC_LOG_
INFO
);
error_code
=
sd_rpc_open
(
m_adapter
,
status_handler
,
ble_evt_dispatch
,
log_handler
);
if
(
error_code
!=
NRF_SUCCESS
)
...
...
src/common/transport/h5_transport.cpp
View file @
b85eda30
...
...
@@ -74,9 +74,9 @@ const uint8_t PACKET_RETRANSMISSIONS =
// Other constants
// Duration to wait for state ACTIVE after open is called
const
auto
OPEN_WAIT_TIMEOUT
=
std
::
chrono
::
milliseconds
(
2
000
);
const
auto
OPEN_WAIT_TIMEOUT
=
std
::
chrono
::
milliseconds
(
5
000
);
// Duration to wait before continuing UART communication after reset is sent to target
const
auto
RESET_WAIT_DURATION
=
std
::
chrono
::
milliseconds
(
3
00
);
const
auto
RESET_WAIT_DURATION
=
std
::
chrono
::
milliseconds
(
5
00
);
#pragma region Public methods
H5Transport
::
H5Transport
(
Transport
*
_nextTransportLayer
,
const
uint32_t
retransmission_interval
)
...
...
@@ -177,6 +177,9 @@ uint32_t H5Transport::open(const status_cb_t &status_callback, const data_cb_t &
if
(
waitForState
(
STATE_ACTIVE
,
OPEN_WAIT_TIMEOUT
))
{
std
::
stringstream
ss
;
ss
<<
"h5_transport got STATE_ACTIVE"
;
log
(
SD_RPC_LOG_WARNING
,
ss
.
str
());
return
NRF_SUCCESS
;
}
else
...
...
src/common/transport/uart_boost.cpp
View file @
b85eda30
...
...
@@ -149,6 +149,7 @@ uint32_t UartBoost::open(const status_cb_t &status_callback, const data_cb_t &da
serialPort
->
set_option
(
parity
);
serialPort
->
set_option
(
characterSize
);
#ifdef SEGGER_WORKAROUND
// SEGGER J-LINK-OB VCOM has an issue when auto-detecting UART flow control
// The VCOM implementation keeps the detected flow-control state if the baud rate
// is the same as the previous open of UART (MDK-1005).
...
...
@@ -164,14 +165,18 @@ uint32_t UartBoost::open(const status_cb_t &status_callback, const data_cb_t &da
return
NRF_ERROR_SD_RPC_SERIAL_PORT
;
}
#endif
#if !defined(__APPLE__)
#ifdef SEGGER_WORKAROUND
// Set dummy baud rate
auto
baudRate
=
asio
::
serial_port
::
baud_rate
(
DUMMY_BAUD_RATE
);
serialPort
->
set_option
(
baudRate
);
#else
auto
baudRate
=
uartSettingsBoost
.
getBoostBaudRate
();
#endif
// Set requested baud rate
baudRate
=
uartSettingsBoost
.
getBoostBaudRate
();
serialPort
->
set_option
(
baudRate
);
#else
// Workaround for setting non-standard baudrate on macOS
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment