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

Leandro Lanzieri notifications at github.com
Tue May 11 11:38:08 CEST 2021


@leandrolanzieri 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)

Should a check `ENCODER_VERSION <= qrcodegen_VERSION_MAX` be added?

-- 
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#pullrequestreview-656495724
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210511/148ab814/attachment.htm>


More information about the notifications mailing list