summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2018-01-09 20:16:41 -0500
committerSolomon Peachy <pizza@shaftnet.org>2018-01-09 20:28:21 -0500
commit0a51740e2ed26e38b876aae9289fabf36bd5c3bc (patch)
treecf05e29fac9fb4f029b1f5f9a78086b9130a1f23
parentca47a6a20df1c187c9044ed305626fdb8d9d52b0 (diff)
downloadselphy_print-0a51740e2ed26e38b876aae9289fabf36bd5c3bc.tar.gz
selphy_print-0a51740e2ed26e38b876aae9289fabf36bd5c3bc.tar.bz2
selphy_print-0a51740e2ed26e38b876aae9289fabf36bd5c3bc.zip
s1245: Fix 'set user string' and marker-level reporting.
-rw-r--r--backend_shinkos1245.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/backend_shinkos1245.c b/backend_shinkos1245.c
index 9b6b04b..64375da 100644
--- a/backend_shinkos1245.c
+++ b/backend_shinkos1245.c
@@ -570,7 +570,7 @@ static int shinkos1245_set_printerid(struct shinkos1245_ctx *ctx,
for (i = 0 ; i < (int)sizeof(cmd.data) ; i++) {
if (*id)
- cmd.data[i] = (uint8_t) *id;
+ cmd.data[i] = (uint8_t) *id++;
else
cmd.data[i] = ' ';
}
@@ -1456,10 +1456,11 @@ top:
/* Work out the remaining media percentage */
{
- int remain = ctx->media_8x12 ? 230 : 280;
+ int total = ctx->media_8x12 ? 230 : 280;
+ int remain = total - be32_to_cpu(status1.counters.media);
- remain = (remain - be32_to_cpu(status1.counters.media)) * 100 / remain;
- ATTR("marker-levels=%d\n", remain);
+ ATTR("marker-levels=%d\n", remain * 100 / total);
+ ATTR("marker-message=\"%d prints remaining on ribbon\"\n", remain);
}
last_state = state;
@@ -1642,7 +1643,7 @@ static int shinkos1245_query_serno(struct libusb_device_handle *dev, uint8_t end
struct dyesub_backend shinkos1245_backend = {
.name = "Shinko/Sinfonia CHC-S1245",
- .version = "0.16WIP",
+ .version = "0.17WIP",
.uri_prefix = "shinkos1245",
.cmdline_usage = shinkos1245_cmdline,
.cmdline_arg = shinkos1245_cmdline_arg,