Skip to content

Commit

Permalink
Increase delay in Segger RTT debugging (fix #1697).
Browse files Browse the repository at this point in the history
BUG=none
TEST=make

(cherry picked from commit c17fa3b)
Change-Id: I11769236fdf5cdfbe853c09f953ff59bb1ecf0df
  • Loading branch information
gendx authored and vsukhoml committed Apr 30, 2021
1 parent 8af8f58 commit f9ed5ba
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions capsules/src/segger_rtt.rs
Expand Up @@ -233,9 +233,14 @@ impl<'a, A: hil::time::Alarm<'a>> uart::Transmit<'a> for SeggerRtt<'a, A> {
// Save the client buffer so we can pass it back with the callback.
self.client_buffer.replace(tx_data);

// Start a short timer so that we get a callback and
// can issue the callback to the client.
let interval = (100 as u32) * <A::Frequency>::frequency() / 1000000;
// Start a short timer so that we get a callback and can issue the callback to
// the client.
//
// This heuristic interval was tested with the console capsule on a nRF52840-DK
// board, passing buffers up to 1500 bytes from userspace. 100 micro-seconds
// was to short, even for buffers as small as 128 bytes. 1 milli-second seems to
// be reliable.
let interval = (1000 as u32) * <A::Frequency>::frequency() / 1000000;
let tics = self.alarm.now().wrapping_add(interval);
self.alarm.set_alarm(tics);
})
Expand Down

0 comments on commit f9ed5ba

Please sign in to comment.