summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorJames Bowman <jamesb@excamera.com>2020-02-05 18:17:58 -0800
committerJames Bowman <jamesb@excamera.com>2020-02-05 18:17:58 -0800
commitacef93a25391594111c1ded0614c440e04e23d26 (patch)
tree3ef515359d433337fdd9f89ce906b75c0e73a0d9 /shared-bindings
parenta9b34f45dc821ad14c24aec7df6be74138fe4196 (diff)
Rename eveL to _eve, EVEL to _EVE
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/_eve/__init__.c (renamed from shared-bindings/eveL/__init__.c)92
-rw-r--r--shared-bindings/_eve/mod_eve-gen.h (renamed from shared-bindings/eveL/modeveL-gen.h)0
2 files changed, 46 insertions, 46 deletions
diff --git a/shared-bindings/eveL/__init__.c b/shared-bindings/_eve/__init__.c
index fa4439cbe..5263fe127 100644
--- a/shared-bindings/eveL/__init__.c
+++ b/shared-bindings/_eve/__init__.c
@@ -31,72 +31,72 @@
#include "py/runtime.h"
#include "py/binary.h"
-//| :mod:`eveL` --- low-level BridgeTek EVE bindings
+//| :mod:`_eve` --- low-level BridgeTek EVE bindings
//| ================================================
//|
-//| .. module:: eveL
+//| .. module:: _eve
//| :synopsis: low-level BridgeTek EVE bindings
//| :platform: SAMD21/SAMD51
//|
-//| The `eveL` module provides a class EVEL which
+//| The `_eve` module provides a class _EVE which
//| contains methods for constructing EVE command
//| buffers and appending basic graphics commands.
//|
-typedef struct _mp_obj_EVEL_t {
+typedef struct _mp_obj__EVE_t {
mp_obj_base_t base;
mp_obj_t dest[3];
size_t n;
uint8_t buf[512];
-} mp_obj_EVEL_t;
+} mp_obj__EVE_t;
-STATIC const mp_obj_type_t EVEL_type;
+STATIC const mp_obj_type_t _EVE_type;
-STATIC void _write(mp_obj_EVEL_t *EVEL, mp_obj_t b) {
- EVEL->dest[2] = b;
- mp_call_method_n_kw(1, 0, EVEL->dest);
+STATIC void _write(mp_obj__EVE_t *_EVE, mp_obj_t b) {
+ _EVE->dest[2] = b;
+ mp_call_method_n_kw(1, 0, _EVE->dest);
}
STATIC mp_obj_t _register(mp_obj_t self, mp_obj_t o) {
- mp_obj_EVEL_t *EVEL = mp_instance_cast_to_native_base(self, &EVEL_type);
- EVEL->n = 0;
- mp_load_method(o, MP_QSTR_write, EVEL->dest);
+ mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
+ _EVE->n = 0;
+ mp_load_method(o, MP_QSTR_write, _EVE->dest);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(register_obj, _register);
STATIC mp_obj_t _flush(mp_obj_t self) {
- mp_obj_EVEL_t *EVEL = mp_instance_cast_to_native_base(self, &EVEL_type);
- if (EVEL->n != 0) {
- _write(EVEL, mp_obj_new_bytearray_by_ref(EVEL->n, EVEL->buf));
- EVEL->n = 0;
+ mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
+ if (_EVE->n != 0) {
+ _write(_EVE, mp_obj_new_bytearray_by_ref(_EVE->n, _EVE->buf));
+ _EVE->n = 0;
}
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(flush_obj, _flush);
STATIC void *append(mp_obj_t self, size_t m) {
- mp_obj_EVEL_t *EVEL = mp_instance_cast_to_native_base(self, &EVEL_type);
- if ((EVEL->n + m) > sizeof(EVEL->buf))
- _flush((mp_obj_t)EVEL);
- uint8_t *r = EVEL->buf + EVEL->n;
- EVEL->n += m;
+ mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
+ if ((_EVE->n + m) > sizeof(_EVE->buf))
+ _flush((mp_obj_t)_EVE);
+ uint8_t *r = _EVE->buf + _EVE->n;
+ _EVE->n += m;
return (void*)r;
}
STATIC mp_obj_t _cc(mp_obj_t self, mp_obj_t b) {
- mp_obj_EVEL_t *EVEL = mp_instance_cast_to_native_base(self, &EVEL_type);
+ mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
mp_buffer_info_t buffer_info;
mp_get_buffer_raise(b, &buffer_info, MP_BUFFER_READ);
- if (buffer_info.len <= sizeof(EVEL->buf)) {
- uint8_t *p = (uint8_t*)append(EVEL, buffer_info.len);
+ if (buffer_info.len <= sizeof(_EVE->buf)) {
+ uint8_t *p = (uint8_t*)append(_EVE, buffer_info.len);
// memcpy(p, buffer_info.buf, buffer_info.len);
uint8_t *s = buffer_info.buf;
for (size_t i = 0; i < buffer_info.len; i++)
*p++ = *s++;
} else {
_flush(self);
- _write(EVEL, b);
+ _write(_EVE, b);
}
return mp_const_none;
@@ -105,7 +105,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(cc_obj, _cc);
#define C4(self, u) (*(uint32_t*)append((self), sizeof(uint32_t)) = (u))
-#include "modeveL-gen.h"
+#include "mod_eve-gen.h"
// Hand-written functions {
@@ -175,7 +175,7 @@ STATIC mp_obj_t _cmd(size_t n_args, const mp_obj_t *args) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(cmd_obj, 4, 4, _cmd);
-STATIC const mp_rom_map_elem_t EVEL_locals_dict_table[] = {
+STATIC const mp_rom_map_elem_t _EVE_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_register), MP_ROM_PTR(&register_obj) },
{ MP_ROM_QSTR(MP_QSTR_cc), MP_ROM_PTR(&cc_obj) },
{ MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&flush_obj) },
@@ -184,40 +184,40 @@ STATIC const mp_rom_map_elem_t EVEL_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_cmd0), MP_ROM_PTR(&cmd0_obj) },
ROM_DECLS
};
-STATIC MP_DEFINE_CONST_DICT(EVEL_locals_dict, EVEL_locals_dict_table);
+STATIC MP_DEFINE_CONST_DICT(_EVE_locals_dict, _EVE_locals_dict_table);
-STATIC void EVEL_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
+STATIC void _EVE_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
(void)self_in;
(void)kind;
- mp_printf(print, "<EVEL>");
+ mp_printf(print, "<_EVE>");
}
-STATIC mp_obj_t EVEL_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
+STATIC mp_obj_t _EVE_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
// mp_arg_check_num(n_args, kw_args, 1, 1, false);
- mp_obj_EVEL_t *o = m_new_obj(mp_obj_EVEL_t);
- mp_printf(&mp_plat_print, "EVEL %p make_new\n", o);
- o->base.type = &EVEL_type;
+ mp_obj__EVE_t *o = m_new_obj(mp_obj__EVE_t);
+ mp_printf(&mp_plat_print, "_EVE %p make_new\n", o);
+ o->base.type = &_EVE_type;
return MP_OBJ_FROM_PTR(o);
}
-STATIC const mp_obj_type_t EVEL_type = {
+STATIC const mp_obj_type_t _EVE_type = {
{ &mp_type_type },
// Save on qstr's, reuse same as for module
- .name = MP_QSTR_EVEL,
- .print = EVEL_print,
- .make_new = EVEL_make_new,
- // .attr = EVEL_attr,
- .locals_dict = (void*)&EVEL_locals_dict,
+ .name = MP_QSTR__EVE,
+ .print = _EVE_print,
+ .make_new = _EVE_make_new,
+ // .attr = _EVE_attr,
+ .locals_dict = (void*)&_EVE_locals_dict,
};
-STATIC const mp_rom_map_elem_t mp_module_eveL_globals_table[] = {
- { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_eveL) },
- { MP_ROM_QSTR(MP_QSTR_EVEL), MP_OBJ_FROM_PTR(&EVEL_type) },
+STATIC const mp_rom_map_elem_t mp_module__eve_globals_table[] = {
+ { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__eve) },
+ { MP_ROM_QSTR(MP_QSTR__EVE), MP_OBJ_FROM_PTR(&_EVE_type) },
};
-STATIC MP_DEFINE_CONST_DICT(mp_module_eveL_globals, mp_module_eveL_globals_table);
+STATIC MP_DEFINE_CONST_DICT(mp_module__eve_globals, mp_module__eve_globals_table);
-const mp_obj_module_t eveL_module = {
+const mp_obj_module_t _eve_module = {
.base = { &mp_type_module },
- .globals = (mp_obj_dict_t*)&mp_module_eveL_globals,
+ .globals = (mp_obj_dict_t*)&mp_module__eve_globals,
};
diff --git a/shared-bindings/eveL/modeveL-gen.h b/shared-bindings/_eve/mod_eve-gen.h
index 1c8d5ae12..1c8d5ae12 100644
--- a/shared-bindings/eveL/modeveL-gen.h
+++ b/shared-bindings/_eve/mod_eve-gen.h