Skip to content

Commit b4e29e9

Browse files
authored
Merge pull request #8456 from tannewt/remove_deprecated_apis
Remove deprecated apis
2 parents f914e0e + 7938c6c commit b4e29e9

File tree

14 files changed

+15
-115
lines changed

14 files changed

+15
-115
lines changed

docs/redirects.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ shared-bindings/frequencyio/__init__.rst shared-bindings/frequencyio/
8484
shared-bindings/gnss/__init__.rst shared-bindings/gnss/
8585
shared-bindings/i2cperipheral/__init__.rst shared-bindings/i2cperipheral/
8686
shared-bindings/i2csecondary/__init__.rst shared-bindings/i2csecondary/
87-
shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheral
88-
shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheralRequest
87+
shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cperipheral/#i2ctarget.Target
88+
shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cperipheral/#i2ctarget.I2CTargetRequest
89+
shared-bindings/i2cperipheral/I2CPeripheral.rst shared-bindings/i2ctarget/#i2ctarget.I2CTarget
90+
shared-bindings/i2cperipheral/I2CPeripheralRequest.rst shared-bindings/i2ctarget/#i2ctarget.I2CTargetRequest
8991
shared-bindings/math/__init__.rst shared-bindings/math/
9092
shared-bindings/microcontroller/Pin.rst shared-bindings/microcontroller/#microcontroller.Pin
9193
shared-bindings/microcontroller/Processor.rst shared-bindings/microcontroller/#microcontroller.Processor

shared-bindings/displayio/Display.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -239,33 +239,6 @@ static displayio_display_obj_t *native_display(mp_obj_t display_obj) {
239239
return MP_OBJ_TO_PTR(native_display);
240240
}
241241

242-
//| def show(self, group: Group) -> None:
243-
//| """
244-
//| .. note:: `show()` is deprecated and will be removed in CircuitPython 9.0.0.
245-
//| Use ``.root_group = group`` instead.
246-
//|
247-
//| Switches to displaying the given group of layers. When group is None, the default
248-
//| CircuitPython terminal will be shown.
249-
//|
250-
//| :param Group group: The group to show.
251-
//|
252-
//| """
253-
//| ...
254-
STATIC mp_obj_t displayio_display_obj_show(mp_obj_t self_in, mp_obj_t group_in) {
255-
displayio_display_obj_t *self = native_display(self_in);
256-
displayio_group_t *group = NULL;
257-
if (group_in != mp_const_none) {
258-
group = MP_OBJ_TO_PTR(native_group(group_in));
259-
}
260-
261-
bool ok = common_hal_displayio_display_show(self, group);
262-
if (!ok) {
263-
mp_raise_ValueError(translate("Group already used"));
264-
}
265-
return mp_const_none;
266-
}
267-
MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show);
268-
269242
//| def refresh(
270243
//| self,
271244
//| *,
@@ -512,7 +485,6 @@ STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *po
512485
MP_DEFINE_CONST_FUN_OBJ_KW(displayio_display_fill_row_obj, 1, displayio_display_obj_fill_row);
513486

514487
STATIC const mp_rom_map_elem_t displayio_display_locals_dict_table[] = {
515-
{ MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&displayio_display_show_obj) },
516488
{ MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&displayio_display_refresh_obj) },
517489
{ MP_ROM_QSTR(MP_QSTR_fill_row), MP_ROM_PTR(&displayio_display_fill_row_obj) },
518490

shared-bindings/displayio/Display.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self,
4646
bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second,
4747
bool backlight_on_high, bool SH1107_addressing, uint16_t backlight_pwm_frequency);
4848

49-
bool common_hal_displayio_display_show(displayio_display_obj_t *self,
50-
displayio_group_t *root_group);
51-
5249
bool common_hal_displayio_display_refresh(displayio_display_obj_t *self, uint32_t target_ms_per_frame, uint32_t maximum_ms_per_real_frame);
5350

5451
bool common_hal_displayio_display_get_auto_refresh(displayio_display_obj_t *self);

shared-bindings/displayio/EPaperDisplay.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -245,31 +245,6 @@ static displayio_epaperdisplay_obj_t *native_display(mp_obj_t display_obj) {
245245
return MP_OBJ_TO_PTR(native_display);
246246
}
247247

248-
//| def show(self, group: Group) -> None:
249-
//| """
250-
//| .. note:: `show()` is deprecated and will be removed in CircuitPython 9.0.0.
251-
//| Use ``.root_group = group`` instead.
252-
//|
253-
//| Switches to displaying the given group of layers. When group is None, the default
254-
//| CircuitPython terminal will be shown.
255-
//|
256-
//| :param Group group: The group to show."""
257-
//| ...
258-
STATIC mp_obj_t displayio_epaperdisplay_obj_show(mp_obj_t self_in, mp_obj_t group_in) {
259-
displayio_epaperdisplay_obj_t *self = native_display(self_in);
260-
displayio_group_t *group = NULL;
261-
if (group_in != mp_const_none) {
262-
group = MP_OBJ_TO_PTR(native_group(group_in));
263-
}
264-
265-
bool ok = common_hal_displayio_epaperdisplay_show(self, group);
266-
if (!ok) {
267-
mp_raise_ValueError(translate("Group already used"));
268-
}
269-
return mp_const_none;
270-
}
271-
MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_show_obj, displayio_epaperdisplay_obj_show);
272-
273248
//| def update_refresh_mode(
274249
//| self, start_sequence: ReadableBuffer, seconds_per_frame: float = 180
275250
//| ) -> None:
@@ -415,7 +390,6 @@ MP_PROPERTY_GETSET(displayio_epaperdisplay_root_group_obj,
415390
(mp_obj_t)&displayio_epaperdisplay_set_root_group_obj);
416391

417392
STATIC const mp_rom_map_elem_t displayio_epaperdisplay_locals_dict_table[] = {
418-
{ MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&displayio_epaperdisplay_show_obj) },
419393
{ MP_ROM_QSTR(MP_QSTR_update_refresh_mode), MP_ROM_PTR(&displayio_epaperdisplay_update_refresh_mode_obj) },
420394
{ MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&displayio_epaperdisplay_refresh_obj) },
421395

shared-bindings/displayio/EPaperDisplay.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t
5252

5353
bool common_hal_displayio_epaperdisplay_refresh(displayio_epaperdisplay_obj_t *self);
5454

55-
bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t *self, displayio_group_t *root_group);
56-
5755
mp_obj_t common_hal_displayio_epaperdisplay_get_root_group(displayio_epaperdisplay_obj_t *self);
5856
bool common_hal_displayio_epaperdisplay_set_root_group(displayio_epaperdisplay_obj_t *self, displayio_group_t *root_group);
5957

shared-bindings/displayio/OnDiskBitmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
//|
5151
//| board.DISPLAY.brightness = 0
5252
//| splash = displayio.Group()
53-
//| board.DISPLAY.show(splash)
53+
//| board.DISPLAY.root_group = splash
5454
//|
5555
//| odb = displayio.OnDiskBitmap('/sample.bmp')
5656
//| face = displayio.TileGrid(odb, pixel_shader=odb.pixel_shader)

shared-bindings/framebufferio/FramebufferDisplay.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -99,27 +99,6 @@ static framebufferio_framebufferdisplay_obj_t *native_display(mp_obj_t display_o
9999
return MP_OBJ_TO_PTR(native_display);
100100
}
101101

102-
//| def show(self, group: displayio.Group) -> None:
103-
//| """Switches to displaying the given group of layers. When group is None, the default
104-
//| CircuitPython terminal will be shown.
105-
//|
106-
//| :param Group group: The group to show."""
107-
//| ...
108-
STATIC mp_obj_t framebufferio_framebufferdisplay_obj_show(mp_obj_t self_in, mp_obj_t group_in) {
109-
framebufferio_framebufferdisplay_obj_t *self = native_display(self_in);
110-
displayio_group_t *group = NULL;
111-
if (group_in != mp_const_none) {
112-
group = MP_OBJ_TO_PTR(native_group(group_in));
113-
}
114-
115-
bool ok = common_hal_framebufferio_framebufferdisplay_show(self, group);
116-
if (!ok) {
117-
mp_raise_ValueError(translate("Group already used"));
118-
}
119-
return mp_const_none;
120-
}
121-
MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_show_obj, framebufferio_framebufferdisplay_obj_show);
122-
123102
//| def refresh(
124103
//| self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1
125104
//| ) -> bool:
@@ -354,7 +333,6 @@ MP_PROPERTY_GETSET(framebufferio_framebufferdisplay_root_group_obj,
354333
(mp_obj_t)&framebufferio_framebufferdisplay_set_root_group_obj);
355334

356335
STATIC const mp_rom_map_elem_t framebufferio_framebufferdisplay_locals_dict_table[] = {
357-
{ MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&framebufferio_framebufferdisplay_show_obj) },
358336
{ MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&framebufferio_framebufferdisplay_refresh_obj) },
359337
{ MP_ROM_QSTR(MP_QSTR_fill_row), MP_ROM_PTR(&framebufferio_framebufferdisplay_fill_row_obj) },
360338

shared-bindings/framebufferio/FramebufferDisplay.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu
4242
uint16_t rotation,
4343
bool auto_refresh);
4444

45-
bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t *self,
46-
displayio_group_t *root_group);
47-
4845
bool common_hal_framebufferio_framebufferdisplay_refresh(framebufferio_framebufferdisplay_obj_t *self, uint32_t target_ms_per_frame, uint32_t maximum_ms_per_real_frame);
4946

5047
bool common_hal_framebufferio_framebufferdisplay_get_auto_refresh(framebufferio_framebufferdisplay_obj_t *self);

shared-bindings/i2ctarget/__init__.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "py/runtime.h"
3131

3232
#include "shared-bindings/microcontroller/Pin.h"
33-
// #include "shared-bindings/i2ctarget/__init__.h"
3433
#include "shared-bindings/i2ctarget/I2CTarget.h"
3534

3635
#include "py/runtime.h"
@@ -95,8 +94,6 @@
9594
STATIC const mp_rom_map_elem_t i2ctarget_module_globals_table[] = {
9695
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2ctarget) },
9796
{ MP_ROM_QSTR(MP_QSTR_I2CTarget), MP_ROM_PTR(&i2ctarget_i2c_target_type) },
98-
// TODO: Remove for CircuitPython 9.0.0
99-
{ MP_ROM_QSTR(MP_QSTR_I2CPeripheral), MP_ROM_PTR(&i2ctarget_i2c_target_type) },
10097
};
10198

10299
STATIC MP_DEFINE_CONST_DICT(i2ctarget_module_globals, i2ctarget_module_globals_table);

shared-module/displayio/Display.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,6 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self,
140140
common_hal_displayio_display_set_auto_refresh(self, auto_refresh);
141141
}
142142

143-
bool common_hal_displayio_display_show(displayio_display_obj_t *self, displayio_group_t *root_group) {
144-
if (root_group == NULL) {
145-
root_group = &circuitpython_splash;
146-
}
147-
return displayio_display_core_set_root_group(&self->core, root_group);
148-
}
149-
150143
uint16_t common_hal_displayio_display_get_width(displayio_display_obj_t *self) {
151144
return displayio_display_core_get_width(&self->core);
152145
}

shared-module/displayio/EPaperDisplay.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t
116116

117117
// Set the group after initialization otherwise we may send pixels while we delay in
118118
// initialization.
119-
common_hal_displayio_epaperdisplay_show(self, &circuitpython_splash);
120-
}
121-
122-
bool common_hal_displayio_epaperdisplay_show(displayio_epaperdisplay_obj_t *self, displayio_group_t *root_group) {
123-
if (root_group == NULL) {
124-
root_group = &circuitpython_splash;
125-
}
126-
return displayio_display_core_set_root_group(&self->core, root_group);
119+
common_hal_displayio_epaperdisplay_set_root_group(self, &circuitpython_splash);
127120
}
128121

129122
bool common_hal_displayio_epaperdisplay_set_root_group(displayio_epaperdisplay_obj_t *self, displayio_group_t *root_group) {
@@ -503,6 +496,11 @@ void release_epaperdisplay(displayio_epaperdisplay_obj_t *self) {
503496
}
504497
}
505498

499+
void displayio_epaperdisplay_reset(displayio_epaperdisplay_obj_t *self) {
500+
displayio_display_core_set_root_group(&self->core, &circuitpython_splash);
501+
self->core.full_refresh = true;
502+
}
503+
506504
void displayio_epaperdisplay_collect_ptrs(displayio_epaperdisplay_obj_t *self) {
507505
displayio_display_core_collect_ptrs(&self->core);
508506
gc_collect_ptr((void *)self->start_sequence);

shared-module/displayio/EPaperDisplay.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ typedef struct {
6262
void displayio_epaperdisplay_change_refresh_mode_parameters(displayio_epaperdisplay_obj_t *self,
6363
mp_buffer_info_t *start_sequence, float seconds_per_frame);
6464
void displayio_epaperdisplay_background(displayio_epaperdisplay_obj_t *self);
65+
void displayio_epaperdisplay_reset(displayio_epaperdisplay_obj_t *self);
6566
void release_epaperdisplay(displayio_epaperdisplay_obj_t *self);
6667
size_t maybe_refresh_epaperdisplay(void);
6768

shared-module/displayio/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ void reset_displays(void) {
302302
reset_display(&displays[i].display);
303303
} else if (display_type == &displayio_epaperdisplay_type) {
304304
displayio_epaperdisplay_obj_t *display = &displays[i].epaper_display;
305-
common_hal_displayio_epaperdisplay_show(display, NULL);
305+
displayio_epaperdisplay_reset(display);
306306
#if CIRCUITPY_FRAMEBUFFERIO
307307
} else if (display_type == &framebufferio_framebufferdisplay_type) {
308308
framebufferio_framebufferdisplay_reset(&displays[i].framebuffer_display);

shared-module/framebufferio/FramebufferDisplay.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,10 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu
100100

101101
// Set the group after initialization otherwise we may send pixels while we delay in
102102
// initialization.
103-
common_hal_framebufferio_framebufferdisplay_show(self, &circuitpython_splash);
103+
displayio_display_core_set_root_group(&self->core, &circuitpython_splash);
104104
common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, auto_refresh);
105105
}
106106

107-
bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t *self, displayio_group_t *root_group) {
108-
if (root_group == NULL) {
109-
root_group = &circuitpython_splash;
110-
}
111-
return displayio_display_core_set_root_group(&self->core, root_group);
112-
}
113-
114107
uint16_t common_hal_framebufferio_framebufferdisplay_get_width(framebufferio_framebufferdisplay_obj_t *self) {
115108
return displayio_display_core_get_width(&self->core);
116109
}
@@ -360,7 +353,7 @@ void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj
360353
const mp_obj_type_t *fb_type = mp_obj_get_type(self->framebuffer);
361354
if (fb_type != NULL && fb_type != &mp_type_NoneType) {
362355
common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, true);
363-
common_hal_framebufferio_framebufferdisplay_show(self, NULL);
356+
displayio_display_core_set_root_group(&self->core, &circuitpython_splash);
364357
self->core.full_refresh = true;
365358
} else {
366359
release_framebufferdisplay(self);

0 commit comments

Comments
 (0)