From af7942186c7d0567466c25209dcfccb9642d8ed2 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 6 May 2018 22:23:22 +0200 Subject: Fix uart device static_assert, add backspace support other changes: replace strip() with STL functions --- hal/uart.tpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hal') diff --git a/hal/uart.tpp b/hal/uart.tpp index 359722e..21d7479 100644 --- a/hal/uart.tpp +++ b/hal/uart.tpp @@ -29,28 +29,28 @@ namespace uart template inline std::queue& rx_buffer() { - static_assert(dev <= devices_count, "invalid device number"); + static_assert(dev != 0 && dev <= devices_count, "invalid device number"); return uart::_rx_buffer[dev -1]; } template inline std::queue& tx_buffer() { - static_assert(dev <= devices_count, "invalid device number"); + static_assert(dev != 0 && dev <= devices_count, "invalid device number"); return uart::_tx_buffer[dev -1]; } template inline bool echo(bool enabled) { - static_assert(dev <= devices_count, "invalid device number"); + static_assert(dev != 0 && dev <= devices_count, "invalid device number"); _echo[dev -1] = enabled; } template inline bool echo_enabled() { - static_assert(dev <= devices_count, "invalid device number"); + static_assert(dev != 0 && dev <= devices_count, "invalid device number"); return _echo[dev -1]; } -- cgit v1.2.1