Created
July 13, 2019 14:56
-
-
Save via/5601df999e08953ab65d597db4cb792f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub const Console = struct { | |
buf: [1024]u8, | |
_buf: []u8, | |
outstream: std.io.SliceOutStream, | |
pub fn init() Console { | |
var ret : Console = undefined; | |
ret._buf = ret.buf[0..]; | |
ret.outstream = std.io.SliceOutStream.init(ret._buf); | |
return ret; | |
} | |
pub fn process(self: *Console) void { | |
self.outstream.reset(); | |
self.outstream.stream.print("rpm: {}\n", c_tfi.config.decoder.rpm) catch unreachable; | |
self.outstream.stream.print("fueling_us: {}\n", c_tfi.calculated_values.fueling_us) catch unreachable; | |
const output = self.outstream.getWritten(); | |
std.debug.warn("{}", output); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment