From de5a9d72dcdaacdd5048195cd5bab007f4b2baef Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 15 Aug 2018 18:32:37 -0700 Subject: Compress all translated strings with Huffman coding. This saves code space in builds which use link-time optimization. The optimization drops the untranslated strings and replaces them with a compressed_string_t struct. It can then be decompressed to a c string. Builds without LTO work as well but include both untranslated strings and compressed strings. This work could be expanded to include QSTRs and loaded strings if a compress method is added to C. Its tracked in #531. --- shared-bindings/audiobusio/PDMIn.c | 2 +- shared-bindings/os/__init__.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'shared-bindings') diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 831baea90..8bfa4c15b 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -196,7 +196,7 @@ STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destinat mp_buffer_info_t bufinfo; if (MP_OBJ_IS_TYPE(destination, &mp_type_fileio)) { - mp_raise_NotImplementedError(""); + mp_raise_NotImplementedError(translate("Cannot record to a file")); } else if (mp_get_buffer(destination, &bufinfo, MP_BUFFER_WRITE)) { if (bufinfo.len / mp_binary_get_size('@', bufinfo.typecode, NULL) < length) { mp_raise_ValueError(translate("Destination capacity is smaller than destination_length.")); diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 1b8831afa..55ebd6f59 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -197,7 +197,7 @@ STATIC mp_obj_t os_urandom(mp_obj_t size_in) { mp_int_t size = mp_obj_get_int(size_in); uint8_t tmp[size]; if (!common_hal_os_urandom(tmp, size)) { - mp_raise_NotImplementedError(""); + mp_raise_NotImplementedError(translate("No hardware random available")); } return mp_obj_new_bytes(tmp, size); } -- cgit v1.2.3