Skip to content

Commit 8cf2e4e

Browse files
authored
Merge pull request SHA2017-badge#1 from SHA2017-badge/master
Ignore this...
2 parents 0f78dfe + 9170311 commit 8cf2e4e

File tree

4 files changed

+72
-17
lines changed

4 files changed

+72
-17
lines changed

esp32/Makefile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py
3131
BADGE = $(IDF_PATH)/..
3232

3333
# verify the ESP IDF version
34-
ESPIDF_SUPHASH := c9c8840c88f966e4c25e29051936abb46fac8bb3
34+
ESPIDF_SUPHASH := 4c62fb9c3f52bd3e753aed06208d14aef4d48a0b
3535
ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H')
3636
ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH))
3737
$(info ** WARNING **)
@@ -96,6 +96,8 @@ INC += -I$(ESPCOMP)/freertos/include/freertos
9696
INC += -I$(ESPCOMP)/app_update/include
9797
INC += -I$(ESPCOMP)/bootloader_support/include_priv
9898
INC += -I$(ESPCOMP)/sdmmc/include
99+
INC += -I$(ESPCOMP)/heap/include
100+
INC += -I$(ESPCOMP)/soc/include
99101

100102
CFLAGS = -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM $(INC)
101103
CFLAGS += -DIDF_VER=\"$(IDF_VER)\"
@@ -252,7 +254,6 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\
252254
gdbstub.o \
253255
crosscore_int.o \
254256
deep_sleep.o \
255-
heap_alloc_caps.o \
256257
ipc.o \
257258
int_wdt.o \
258259
event_loop.o \
@@ -265,16 +266,23 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\
265266
phy_init.o \
266267
intr_alloc.o \
267268
dport_access.o \
269+
brownout.o \
270+
)
271+
272+
ESPIDF_HEAP_O = $(addprefix $(ESPCOMP)/heap/,\
273+
heap_caps.o \
274+
heap_caps_init.o \
275+
multi_heap.o \
268276
)
269277

270278
ESPIDF_SOC_O = $(addprefix $(ESPCOMP)/soc/,\
271-
esp32/brownout.o \
272279
esp32/cpu_util.o \
273280
esp32/rtc_clk.o \
274281
esp32/rtc_init.o \
275282
esp32/rtc_pm.o \
276283
esp32/rtc_sleep.o \
277284
esp32/rtc_time.o \
285+
esp32/soc_memory_layout.o \
278286
)
279287

280288
ESPIDF_CXX_O = $(addprefix $(ESPCOMP)/cxx/,\
@@ -324,8 +332,6 @@ ESPIDF_FREERTOS_O = $(addprefix $(ESPCOMP)/freertos/,\
324332
croutine.o \
325333
event_groups.o \
326334
FreeRTOS-openocd.o \
327-
heap_regions_debug.o \
328-
heap_regions.o \
329335
list.o \
330336
portasm.o \
331337
port.o \
@@ -621,6 +627,7 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_WPA_SUPPLICANT_O))
621627
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_APP_UPDATE_O))
622628
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_BOOTLOADER_O))
623629
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SDMMC_O))
630+
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_HEAP_O))
624631

625632
####################
626633
# Badge magic

esp32/modules/dialogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
### Description: Some basic UGFX powered dialogs
44
### License: MIT
55

6-
import ugfx, badge, utime as time
6+
import ugfx, utime as time
77

88
wait_for_interrupt = True
99
button_pushed = ''

esp32/modules/inisetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def setup():
4646
print("wake from sleep")
4747
load_me = esp.rtcmem_read_string()
4848
if load_me != "":
49-
print("starting %s", load_me)
49+
print("starting %s" % load_me)
5050
esp.rtcmem_write_string("")
5151
__import__(load_me)
5252
else:

esp32/modules/launcher.py

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,23 @@
1818
ugfx.string(170,75,"Anyway","Roboto_BlackItalic24",ugfx.BLACK)
1919
ugfx.string(155,105,"MOTD: NVS","Roboto_Regular18",ugfx.BLACK)
2020

21-
options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height())
21+
options = None
22+
install_path = None
2223

23-
try:
24-
apps = os.listdir('lib')
25-
except OSError:
26-
apps = []
24+
def populate_it():
25+
global options
26+
options = ugfx.List(0,0,int(ugfx.width()/2),ugfx.height())
2727

28-
options.add_item('installer')
29-
options.add_item('ota_update')
28+
try:
29+
apps = os.listdir('lib')
30+
except OSError:
31+
apps = []
3032

31-
for app in apps:
32-
options.add_item(app)
33+
options.add_item('installer')
34+
options.add_item('ota_update')
35+
36+
for app in apps:
37+
options.add_item(app)
3338

3439
def run_it(pushed):
3540
if (pushed):
@@ -43,8 +48,51 @@ def run_it(pushed):
4348
badge.eink_busy_wait()
4449
appglue.start_app(selected)
4550

51+
def expandhome(s):
52+
if "~/" in s:
53+
h = os.getenv("HOME")
54+
s = s.replace("~/", h + "/")
55+
return s
56+
57+
def get_install_path():
58+
global install_path
59+
if install_path is None:
60+
# sys.path[0] is current module's path
61+
install_path = sys.path[1]
62+
install_path = expandhome(install_path)
63+
return install_path
64+
65+
66+
def uninstall_it(pushed):
67+
if (pushed):
68+
selected = options.selected_text()
69+
if selected == 'installer':
70+
return
71+
if selected == 'ota_update':
72+
return
73+
options.destroy()
74+
import dialogs
75+
print(selected)
76+
uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected)
77+
print(uninstall)
78+
if uninstall:
79+
ugfx.clear(ugfx.BLACK)
80+
ugfx.string(40,25,"Uninstalling:","Roboto_BlackItalic24",ugfx.WHITE)
81+
ugfx.string(100,75, selected,"PermanentMarker22",ugfx.WHITE)
82+
ugfx.flush()
83+
install_path = get_install_path()
84+
for rm_file in os.listdir("%s/%s" % (install_path, selected)):
85+
os.remove("%s/%s/%s" % (install_path, selected, rm_file))
86+
os.rmdir("%s/%s" % (install_path, selected))
87+
badge.eink_busy_wait()
88+
esp.rtcmem_write_string('launcher')
89+
esp.start_sleeping(1)
90+
91+
92+
populate_it()
93+
4694
ugfx.input_attach(ugfx.BTN_A, run_it)
47-
ugfx.input_attach(ugfx.BTN_B, run_it)
95+
ugfx.input_attach(ugfx.BTN_B, uninstall_it)
4896

4997
ugfx.input_attach(ugfx.JOY_UP, lambda pushed: ugfx.flush() if pushed else 0)
5098
ugfx.input_attach(ugfx.JOY_DOWN, lambda pushed: ugfx.flush() if pushed else 0)

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