summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-01-30 10:59:21 -0800
committerScott Shawcroft <scott@tannewt.org>2020-01-30 10:59:21 -0800
commit55eb1730b89797c9b2b2115b3bec509acb490cb0 (patch)
tree127714b653d8570fcb0c8e499eea266688e3c3b0 /shared-bindings
parent2cc20e8816c6c1571b7488e83e3b13af79d50d65 (diff)
parentd22e95eedaccf24ffa91fda1dc101f6f05b1039f (diff)
Merge remote-tracking branch 'adafruit/master' into tweak_pixelbuf
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/_bleio/Characteristic.c2
-rw-r--r--shared-bindings/_bleio/PacketBuffer.c4
-rw-r--r--shared-bindings/_stage/__init__.c11
3 files changed, 11 insertions, 6 deletions
diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c
index 2b1dc1f78..e55191f7c 100644
--- a/shared-bindings/_bleio/Characteristic.c
+++ b/shared-bindings/_bleio/Characteristic.c
@@ -49,7 +49,7 @@
//| as part of remote Services.
//|
-//| .. method:: add_to_service(service, uuid, *, properties=0, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, initial_value=None)
+//| .. method:: add_to_service(service, uuid, *, properties=0, read_perm=Attribute.OPEN, write_perm=Attribute.OPEN, max_length=20, fixed_length=False, initial_value=None)
//|
//| Create a new Characteristic object, and add it to this Service.
//|
diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c
index f9f171870..3ed295f01 100644
--- a/shared-bindings/_bleio/PacketBuffer.c
+++ b/shared-bindings/_bleio/PacketBuffer.c
@@ -163,13 +163,13 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_bu
//| .. attribute:: packet_size
//|
-//| Maximum size of each packet in bytes. This is the minimum of the Characterstic length and
+//| Maximum size of each packet in bytes. This is the minimum of the Characteristic length and
//| the negotiated Maximum Transfer Unit (MTU).
//|
STATIC mp_obj_t bleio_packet_buffer_get_packet_size(mp_obj_t self_in) {
bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in);
- return mp_obj_new_bool(common_hal_bleio_packet_buffer_get_packet_size(self));
+ return MP_OBJ_NEW_SMALL_INT(common_hal_bleio_packet_buffer_get_packet_size(self));
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_packet_size_obj, bleio_packet_buffer_get_packet_size);
diff --git a/shared-bindings/_stage/__init__.c b/shared-bindings/_stage/__init__.c
index 1154bbbf1..4bac280bf 100644
--- a/shared-bindings/_stage/__init__.c
+++ b/shared-bindings/_stage/__init__.c
@@ -51,7 +51,7 @@
//| Layer
//| Text
//|
-//| .. function:: render(x0, y0, x1, y1, layers, buffer, display[, scale])
+//| .. function:: render(x0, y0, x1, y1, layers, buffer, display[, scale[, background]])
//|
//| Render and send to the display a fragment of the screen.
//|
@@ -63,6 +63,7 @@
//| :param bytearray buffer: A buffer to use for rendering.
//| :param ~displayio.Display display: The display to use.
//| :param int scale: How many times should the image be scaled up.
+//| :param int background: What color to display when nothing is there.
//|
//| There are also no sanity checks, outside of the basic overflow
//| checking. The caller is responsible for making the passed parameters
@@ -92,12 +93,16 @@ STATIC mp_obj_t stage_render(size_t n_args, const mp_obj_t *args) {
}
displayio_display_obj_t *display = MP_OBJ_TO_PTR(native_display);
uint8_t scale = 1;
- if (n_args >= 8) {
+ if (n_args > 7) {
scale = mp_obj_get_int(args[7]);
}
+ uint16_t background = 0;
+ if (n_args > 8) {
+ background = mp_obj_get_int(args[8]);
+ }
render_stage(x0, y0, x1, y1, layers, layers_size, buffer, buffer_size,
- display, scale);
+ display, scale, background);
return mp_const_none;
}