<!-- description --> @brief Outputs a character to the serial port. <!-- inputs/outputs --> @param mut_ring the debug ring to output to @param c the character to output
| 43 | /// @param c the character to output |
| 44 | /// |
| 45 | constexpr void |
| 46 | debug_ring_write(loader::debug_ring_t &mut_ring, bsl::char_type const c) noexcept |
| 47 | { |
| 48 | bsl::uintmx mut_epos{mut_ring.epos}; |
| 49 | bsl::uintmx mut_spos{mut_ring.spos}; |
| 50 | |
| 51 | *mut_ring.buf.at_if(mut_epos) = c; |
| 52 | ++mut_epos; |
| 53 | |
| 54 | if (mut_epos >= mut_ring.buf.size()) { |
| 55 | mut_epos = {}; |
| 56 | } |
| 57 | else { |
| 58 | bsl::touch(); |
| 59 | } |
| 60 | |
| 61 | if (mut_epos == mut_spos) { |
| 62 | ++mut_spos; |
| 63 | |
| 64 | if (mut_spos >= mut_ring.buf.size()) { |
| 65 | mut_spos = {}; |
| 66 | } |
| 67 | else { |
| 68 | bsl::touch(); |
| 69 | } |
| 70 | } |
| 71 | else { |
| 72 | bsl::touch(); |
| 73 | } |
| 74 | |
| 75 | mut_ring.epos = mut_epos; |
| 76 | mut_ring.spos = mut_spos; |
| 77 | } |
| 78 | |
| 79 | /// <!-- description --> |
| 80 | /// @brief Outputs a string to the serial port. |
no test coverage detected