summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-11-18 15:34:28 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2019-11-18 15:34:28 +0100
commit35db4a64783b3399de713c2b87b5ed753e7cae15 (patch)
treed0ae3e25f416c9e9834f268861c54c6d4f941831
parent87e60ac8c3e646bbaee54d0699a8d46278ab5711 (diff)
ptalog barcode generation: decrease module size, increase quiet zone
-rw-r--r--include/object/ptalog.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/object/ptalog.h b/include/object/ptalog.h
index bdd0a33..9d30a40 100644
--- a/include/object/ptalog.h
+++ b/include/object/ptalog.h
@@ -97,18 +97,18 @@ class PTALog {
#ifdef PTALOG_GPIO_BAR
void startTransition(char const *code, uint8_t code_length)
{
- // TODO increase sleep duration: quiet zone must be at least 10x long
- // (100ms for 10ms per bar, oder 50ms for 5ms per bar)
- arch.sleep_ms(20);
+ // Quiet zone (must last at least 10x longer than a module)
+ arch.sleep_ms(60);
for (uint8_t byte = 0; byte < code_length; byte++) {
for (uint16_t mask = 0x01; mask <= 0x80; mask <<= 1) {
+ // a single module, which is part of a bar
gpio.write(sync_pin, code[byte] & mask ? 1 : 0);
- arch.sleep_ms(10);
+ arch.sleep_ms(5);
}
}
gpio.write(sync_pin, 0);
- // TODO increase sleep duration (see above)
- arch.sleep_ms(20);
+ // Quiet zone
+ arch.sleep_ms(60);
}
#else
inline void startTransition()