summaryrefslogtreecommitdiffstats
path: root/hal/uart.tpp
diff options
context:
space:
mode:
Diffstat (limited to 'hal/uart.tpp')
-rw-r--r--hal/uart.tpp8
1 files changed, 4 insertions, 4 deletions
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<unsigned dev>
inline std::queue<uint8_t>& 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<unsigned dev>
inline std::queue<uint8_t>& 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<unsigned dev>
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<unsigned dev>
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];
}