mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/periph_uart_nonblocking: test print with disabled irq
This commit is contained in:
parent
0b8adb2d27
commit
f7d124e141
@ -30,8 +30,21 @@ static inline uint32_t puts_delay(const char* str)
|
||||
return LINE_DELAY_MS * 1000;
|
||||
}
|
||||
|
||||
static void _irq_disabled_print(void)
|
||||
{
|
||||
unsigned state = irq_disable();
|
||||
/* fill the transmit buffer */
|
||||
for (uint8_t i = 0; i < UART_TXBUF_SIZE; i++) {
|
||||
printf(" ");
|
||||
}
|
||||
puts("\nputs with disabled interrupts and a full transmit buffer");
|
||||
irq_restore(state);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
_irq_disabled_print();
|
||||
|
||||
uint32_t total_us = 0;
|
||||
xtimer_ticks32_t counter = xtimer_now();
|
||||
|
||||
|
@ -14,6 +14,7 @@ PRECISION = 1.002
|
||||
|
||||
|
||||
def testfunc(child):
|
||||
child.expect_exact("puts with disabled interrupts and a full transmit buffer")
|
||||
child.expect(r'== printed in (\d+)/(\d+) µs ==')
|
||||
time_actual = int(child.match.group(1))
|
||||
time_expect = int(child.match.group(2))
|
||||
|
Loading…
Reference in New Issue
Block a user