[riot-notifications] [RIOT-OS/RIOT] tests/pkg_qr-code-generator: improve display speed in test application (#16466)

Alexandre Abadie notifications at github.com
Tue May 11 13:45:55 CEST 2021


@aabadie commented on this pull request.



> @@ -33,8 +33,11 @@
 #define MESSAGE_TO_ENCODE   "unknown"
 #endif
 
-static uint8_t qr0[qrcodegen_BUFFER_LEN_FOR_VERSION(2)];
-static uint8_t buffer[qrcodegen_BUFFER_LEN_FOR_VERSION(2)];
+/* Compute buffer sizes based on the message to encode len to avoid a
+ * failed assertion in qrcodegen */
+#define ENCODER_VERSION     (sizeof(MESSAGE_TO_ENCODE) >> 3)

Added an assert. I wanted to do it using a preprocessor macro but `sizeof` is not yet resolved at that step.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16466#discussion_r630091707
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210511/7125c901/attachment.htm>


More information about the notifications mailing list