summaryrefslogtreecommitdiffstats
path: root/r503.c
diff options
context:
space:
mode:
Diffstat (limited to 'r503.c')
-rw-r--r--r503.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/r503.c b/r503.c
index e970c59..434e3fe 100644
--- a/r503.c
+++ b/r503.c
@@ -182,3 +182,21 @@ uint8_t fpm_clear_db(void)
recv(buf, &n);
return buf[0] == OK;
}
+
+uint16_t fpm_get_count(void)
+{
+ uint16_t n, count;
+ uint8_t buf[MAXPDLEN];
+
+ buf[0] = 0x1D;
+ send(0x01, buf, 1);
+ recv(buf, &n);
+
+ count = 0;
+ if (buf[0] == OK && n >= 2) {
+ count = buf[1];
+ count <<= 8;
+ count |= buf[2];
+ }
+ return count;
+}