summaryrefslogtreecommitdiff
path: root/supervisor/shared/translate.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-12-07 15:34:43 -0500
committerGitHub <noreply@github.com>2018-12-07 15:34:43 -0500
commit2fbaceb2b15ff7d2c368a6cf4dfc10881f5979e7 (patch)
tree60210206b73c579e74288333a3ecc4e8f233dd1b /supervisor/shared/translate.c
parent481c4954afd161448aa37d353fa577d409d880c6 (diff)
parent89ef6eef575501e736ae528f13d9979e1302be63 (diff)
Merge pull request #1294 from tannewt/stack_check4.0.0-alpha.4
Add stack validity check and raise an error when it happens.
Diffstat (limited to 'supervisor/shared/translate.c')
-rw-r--r--supervisor/shared/translate.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c
index 1fa361c15..aa5e4517c 100644
--- a/supervisor/shared/translate.c
+++ b/supervisor/shared/translate.c
@@ -34,6 +34,14 @@
#include "genhdr/compression.generated.h"
#endif
+#include "supervisor/serial.h"
+
+void serial_write_compressed(const compressed_string_t* compressed) {
+ char decompressed[compressed->length];
+ decompress(compressed, decompressed);
+ serial_write(decompressed);
+}
+
char* decompress(const compressed_string_t* compressed, char* decompressed) {
uint8_t this_byte = 0;
uint8_t this_bit = 7;