From 35db4a64783b3399de713c2b87b5ed753e7cae15 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 18 Nov 2019 15:34:28 +0100 Subject: ptalog barcode generation: decrease module size, increase quiet zone --- include/object/ptalog.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') 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() -- cgit v1.2.3