1// Copyright © 2021 Sören Tempel2//3// This program is free software: you can redistribute it and/or modify4// it under the terms of the GNU Affero General Public License as5// published by the Free Software Foundation, either version 3 of the6// License, or (at your option) any later version.7//8// This program is distributed in the hope that it will be useful, but9// WITHOUT ANY WARRANTY; without even the implied warranty of10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU11// Affero General Public License for more details.12//13// You should have received a copy of the GNU Affero General Public License14// along with this program. If not, see <https://www.gnu.org/licenses/>.1516const periph = @import("periph.zig");17const slipmux = @import("slipmux.zig");1819pub fn getStdDbg() slipmux.Frame {20 const ftype = slipmux.FrameType.diagnostic;21 return periph.slipmux.newFrame(ftype);22}2324// Write a Slipmux diagnostic message, unbuffered, to the UART.25pub fn print(comptime fmt: []const u8, args: anytype) void {26 var stddbg = getStdDbg();27 defer stddbg.close();2829 const w = stddbg.writer();30 nosuspend w.print(fmt, args) catch return;31}