Removed set_backlight from PicoExplorer, as the board does not have backlight control

This commit is contained in:
ZodiusInfuser 2021-02-11 16:51:53 +00:00
parent 85906b1059
commit 9c65df1540
6 changed files with 0 additions and 24 deletions

View File

@ -57,10 +57,6 @@ namespace pimoroni {
screen.update();
}
void PicoExplorer::set_backlight(uint8_t brightness) {
screen.set_backlight(brightness);
}
bool PicoExplorer::is_pressed(uint8_t button) {
return !gpio_get(button);
}

View File

@ -44,7 +44,6 @@ namespace pimoroni {
void init();
void update();
void set_backlight(uint8_t brightness);
bool is_pressed(uint8_t button);
float get_adc(uint8_t channel);

View File

@ -7,7 +7,6 @@ height = explorer.get_height()
display_buffer = bytearray(width * height * 2) # 2-bytes per pixel (RGB565)
explorer.init(display_buffer)
explorer.set_backlight(1.0)
explorer.set_audio_pin(0)
i = 1

View File

@ -50,7 +50,6 @@ enum gps
STATIC MP_DEFINE_CONST_FUN_OBJ_1(picoexplorer_init_obj, picoexplorer_init);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(picoexplorer_get_width_obj, picoexplorer_get_width);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(picoexplorer_get_height_obj, picoexplorer_get_height);
STATIC MP_DEFINE_CONST_FUN_OBJ_1(picoexplorer_set_backlight_obj, picoexplorer_set_backlight);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(picoexplorer_update_obj, picoexplorer_update);
STATIC MP_DEFINE_CONST_FUN_OBJ_1(picoexplorer_is_pressed_obj, picoexplorer_is_pressed);
STATIC MP_DEFINE_CONST_FUN_OBJ_1(picoexplorer_get_adc_obj, picoexplorer_get_adc);
@ -78,7 +77,6 @@ STATIC const mp_map_elem_t picoexplorer_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&picoexplorer_init_obj) },
{ MP_ROM_QSTR(MP_QSTR_get_width), MP_ROM_PTR(&picoexplorer_get_width_obj) },
{ MP_ROM_QSTR(MP_QSTR_get_height), MP_ROM_PTR(&picoexplorer_get_height_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_backlight), MP_ROM_PTR(&picoexplorer_set_backlight_obj) },
{ MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&picoexplorer_update_obj) },
{ MP_ROM_QSTR(MP_QSTR_is_pressed), MP_ROM_PTR(&picoexplorer_is_pressed_obj) },
{ MP_ROM_QSTR(MP_QSTR_get_adc), MP_ROM_PTR(&picoexplorer_get_adc_obj) },

View File

@ -43,21 +43,6 @@ mp_obj_t picoexplorer_update() {
return mp_const_none;
}
mp_obj_t picoexplorer_set_backlight(mp_obj_t brightness_obj) {
if(explorer != nullptr) {
float brightness = mp_obj_get_float(brightness_obj);
if(brightness < 0 || brightness > 1.0f)
mp_raise_ValueError("brightness out of range. Expected 0.0 to 1.0");
else
explorer->set_backlight((uint8_t)(brightness * 255.0f));
}
else
mp_raise_msg(&mp_type_RuntimeError, NOT_INITIALISED_MSG);
return mp_const_none;
}
mp_obj_t picoexplorer_is_pressed(mp_obj_t button_obj) {
bool buttonPressed = false;

View File

@ -6,7 +6,6 @@
extern mp_obj_t picoexplorer_init(mp_obj_t buf_obj);
extern mp_obj_t picoexplorer_get_width();
extern mp_obj_t picoexplorer_get_height();
extern mp_obj_t picoexplorer_set_backlight(mp_obj_t brightness_obj);
extern mp_obj_t picoexplorer_update();
extern mp_obj_t picoexplorer_is_pressed(mp_obj_t button_obj);
extern mp_obj_t picoexplorer_get_adc(mp_obj_t channel_obj);