Skip to content

Commit c8437e6

Browse files
committed
Added type hints to rgbmatrix
1 parent 93d2007 commit c8437e6

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

shared-bindings/rgbmatrix/RGBMatrix.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_
128128
}
129129
}
130130

131-
//| def __init__(self, *, width: Any, bit_depth: Any, rgb_pins: Any, addr_pins: Any, clock_pin: Any, latch_pin: Any, output_enable_pin: Any, doublebuffer: Any = True, framebuffer: Any = None, height: Any = 0):
131+
//| def __init__(self, *, width: int, bit_depth: List[digitalio.DigitalInOut], rgb_pins: List[digitalio.DigitalInOut], addr_pins: List[digitalio.DigitalInOut], clock_pin: digitalio.DigitalInOut, latch_pin: digitalio.DigitalInOut, output_enable_pin: digitalio.DigitalInOut, doublebuffer: bool = True, framebuffer: WriteableBuffer = None, height: int = 0):
132132
//| """Create a RGBMatrix object with the given attributes. The height of
133133
//| the display is determined by the number of rgb and address pins:
134134
//| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4
@@ -237,7 +237,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n
237237
return MP_OBJ_FROM_PTR(self);
238238
}
239239

240-
//| def deinit(self) -> Any:
240+
//| def deinit(self) -> None:
241241
//| """Free the resources (pins, timers, etc.) associated with this
242242
//| rgbmatrix instance. After deinitialization, no further operations
243243
//| may be performed."""
@@ -257,7 +257,7 @@ static void check_for_deinit(rgbmatrix_rgbmatrix_obj_t *self) {
257257
}
258258
}
259259

260-
//| brightness: Any = ...
260+
//| brightness: Optional[float] = ...
261261
//| """In the current implementation, 0.0 turns the display off entirely
262262
//| and any other value up to 1.0 turns the display on fully."""
263263
//|
@@ -288,9 +288,10 @@ const mp_obj_property_t rgbmatrix_rgbmatrix_brightness_obj = {
288288
(mp_obj_t)&mp_const_none_obj},
289289
};
290290

291-
//| def refresh(self) -> Any: ...
292-
//| """Transmits the color data in the buffer to the pixels so that
293-
//| they are shown."""
291+
//| def refresh(self) -> None:
292+
//| """Transmits the color data in the buffer to the pixels so that
293+
//| they are shown."""
294+
//| ...
294295
//|
295296
STATIC mp_obj_t rgbmatrix_rgbmatrix_refresh(mp_obj_t self_in) {
296297
rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in;

0 commit comments

Comments
 (0)