diff options
author | Nao Pross <naopross@thearcway.org> | 2018-05-06 22:23:22 +0200 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-05-06 22:23:22 +0200 |
commit | af7942186c7d0567466c25209dcfccb9642d8ed2 (patch) | |
tree | 247e7674af38cac7f0c8646d59e0d7788438130c /hal | |
parent | Fix comments (diff) | |
download | SAMLiquidSmoke-af7942186c7d0567466c25209dcfccb9642d8ed2.tar.gz SAMLiquidSmoke-af7942186c7d0567466c25209dcfccb9642d8ed2.zip |
Fix uart device static_assert, add backspace support
other changes:
replace strip() with STL functions
Diffstat (limited to 'hal')
-rw-r--r-- | hal/uart.tpp | 8 |
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]; } |