1
0
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:
Francisco Molina 2020-06-15 16:47:10 +02:00
parent 0b8adb2d27
commit f7d124e141
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8
2 changed files with 14 additions and 0 deletions

View File

@ -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();

View File

@ -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))