diff options
| author | Dan Halbert <halbert@halwitz.org> | 2019-07-31 00:30:24 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2019-07-31 00:30:24 -0400 |
| commit | 91d791afd091ba38bb61689e88a7fc03b9679e00 (patch) | |
| tree | 5b6a29ed76964894432a011a202203425b0afe4e /py | |
| parent | 83129b8c63e58596add0d111360701aab51ce62b (diff) | |
cleanup adapter.address; add uniquish suffix to BLE device name
Diffstat (limited to 'py')
| -rw-r--r-- | py/objstr.c | 6 | ||||
| -rw-r--r-- | py/objstr.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/py/objstr.c b/py/objstr.c index ebd11d5cc..afe11f00f 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -41,6 +41,12 @@ STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_ STATIC mp_obj_t mp_obj_new_bytes_iterator(mp_obj_t str, mp_obj_iter_buf_t *iter_buf); STATIC NORETURN void bad_implicit_conversion(mp_obj_t self_in); +const char nibble_to_hex_upper[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'A', 'B', 'C', 'D', 'E', 'F'}; + +const char nibble_to_hex_lower[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'a', 'b', 'c', 'd', 'e', 'f'}; + /******************************************************************************/ /* str */ diff --git a/py/objstr.h b/py/objstr.h index 0efe62a80..61a11d0bd 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -77,6 +77,9 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s mp_obj_t index, bool is_slice); const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle, size_t nlen, int direction); +const char nibble_to_hex_upper[16]; +const char nibble_to_hex_lower[16]; + MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_encode_obj); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_find_obj); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_rfind_obj); |
