Skip to content

Commit 614bd48

Browse files
committed
Merge branch 'master' into dialogs-and-more-emf-porting
2 parents f21ba90 + 2d891c7 commit 614bd48

File tree

7 files changed

+34
-2
lines changed

7 files changed

+34
-2
lines changed

esp32/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ SRC_C = \
143143
machine_rtc.c \
144144
machine_hw_spi.c \
145145
mpthreadport.c \
146+
badge_base.c \
146147
badge_eink.c \
147148
badge_i2c.c \
148149
badge_leds.c \

esp32/badge_base.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../components/badge/badge_base.c

esp32/badge_base.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../components/badge/badge_base.h

esp32/modbadge.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ STATIC mp_obj_t badge_display_picture_(mp_obj_t picture_id,
7373
STATIC MP_DEFINE_CONST_FUN_OBJ_2(badge_display_picture_obj,
7474
badge_display_picture_);
7575

76+
STATIC mp_obj_t badge_eink_busy_() {
77+
return mp_obj_new_bool(badge_eink_dev_is_busy());
78+
}
79+
STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_busy_obj, badge_eink_busy_);
80+
81+
STATIC mp_obj_t badge_eink_busy_wait_() {
82+
badge_eink_dev_busy_wait();
83+
return mp_const_none;
84+
}
85+
STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_busy_wait_obj, badge_eink_busy_wait_);
86+
7687
// Power
7788

7889
STATIC mp_obj_t badge_power_init_() {
@@ -196,6 +207,9 @@ STATIC const mp_rom_map_elem_t badge_module_globals_table[] = {
196207
{MP_OBJ_NEW_QSTR(MP_QSTR_vibrator_activate), (mp_obj_t)&badge_vibrator_activate_obj},
197208
#endif
198209

210+
{MP_ROM_QSTR(MP_QSTR_eink_busy), MP_ROM_PTR(&badge_eink_busy_obj)},
211+
{MP_ROM_QSTR(MP_QSTR_eink_busy_wait), MP_ROM_PTR(&badge_eink_busy_wait_obj)},
212+
199213
{MP_ROM_QSTR(MP_QSTR_display_picture),
200214
MP_ROM_PTR(&badge_display_picture_obj)},
201215

esp32/modbadge.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "badge.h"
77
#include "badge_pins.h"
88
#include "badge_eink.h"
9+
#include "badge_eink_dev.h"
910
#include "badge_power.h"
1011
#include "badge_leds.h"
1112
#include "badge_vibrator.h"

esp32/modules/launcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def run_it(pushed):
4444
ugfx.input_attach(ugfx.BTN_A, run_it)
4545
ugfx.input_attach(ugfx.BTN_B, run_it)
4646

47-
ugfx.input_attach(ugfx.JOY_UP, lambda x: ugfx.flush())
48-
ugfx.input_attach(ugfx.JOY_DOWN, lambda x: ugfx.flush())
47+
ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0)
48+
ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0)
4949

5050
ugfx.flush()
5151
time.sleep(0.2)

unix/modbadge.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(badge_display_picture_obj,
6969
badge_display_picture_);
7070
*/
7171

72+
STATIC mp_obj_t badge_eink_busy_() {
73+
return mp_obj_new_bool(false);
74+
}
75+
STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_busy_obj, badge_eink_busy_);
76+
77+
STATIC mp_obj_t badge_eink_busy_wait_() {
78+
// badge_eink_dev_busy_wait();
79+
return mp_const_none;
80+
}
81+
STATIC MP_DEFINE_CONST_FUN_OBJ_0(badge_eink_busy_wait_obj, badge_eink_busy_wait_);
82+
7283
// Power
7384

7485
STATIC mp_obj_t badge_power_init_() {
@@ -203,6 +214,9 @@ STATIC const mp_rom_map_elem_t mock_badge_module_globals_table[] = {
203214
{MP_OBJ_NEW_QSTR(MP_QSTR_vibrator_init), (mp_obj_t)&badge_vibrator_init_obj},
204215
{MP_OBJ_NEW_QSTR(MP_QSTR_vibrator_activate), (mp_obj_t)&badge_vibrator_activate_obj},
205216

217+
{MP_ROM_QSTR(MP_QSTR_eink_busy), MP_ROM_PTR(&badge_eink_busy_obj)},
218+
{MP_ROM_QSTR(MP_QSTR_eink_busy_wait), MP_ROM_PTR(&badge_eink_busy_wait_obj)},
219+
206220
// {MP_ROM_QSTR(MP_QSTR_display_picture),
207221
// MP_ROM_PTR(&badge_display_picture_obj)},
208222

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy