summaryrefslogtreecommitdiffstats
path: root/src/codes.rs
diff options
context:
space:
mode:
authorAgathe Porte <microjoe@microjoe.org>2020-02-23 10:30:17 +0100
committerAgathe Porte <microjoe@microjoe.org>2020-02-23 10:30:17 +0100
commitbc0e5a406a0179fdbc7a5e298d108e966bcb3ed0 (patch)
tree2f30328a685409b87d9007229f7617ba70c5eff5 /src/codes.rs
parentada08aa7c620070c4aeab23b678ef8bb5b696667 (diff)
downloadcharlcd-bc0e5a406a0179fdbc7a5e298d108e966bcb3ed0.tar.gz
charlcd-bc0e5a406a0179fdbc7a5e298d108e966bcb3ed0.zip
add goto functions
Diffstat (limited to 'src/codes.rs')
-rw-r--r--src/codes.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/codes.rs b/src/codes.rs
index 2111df7..e397df8 100644
--- a/src/codes.rs
+++ b/src/codes.rs
@@ -46,6 +46,7 @@ pub enum SpecialCode {
GotoXY(Option<u32>, Option<u32>),
}
+/// Write a X or Y goto symbol, as required
fn write_goto_xy_sym<T: Write>(writer: &mut T, sym: char, value: Option<u32>) -> Result<usize> {
let mut total = 0;
if let Some(value) = value {
@@ -55,6 +56,7 @@ fn write_goto_xy_sym<T: Write>(writer: &mut T, sym: char, value: Option<u32>) ->
Ok(total)
}
+/// Write both X and/or Y goto symbol, as required
fn write_goto_xy<T: Write>(writer: &mut T, x: Option<u32>, y: Option<u32>) -> Result<usize> {
let mut total = 0;
total += write_goto_xy_sym(writer, 'x', x)?;