Skip to content

Commit 138452f

Browse files
committed
Merging Dickens-specific changes into master
1 parent 61effca commit 138452f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+5344
-196
lines changed

benchmark/benchmark.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22

33
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
44
#

benchmark/sendcommand.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22

33
import time
44
import serial

boards/DICKENS.py

+31-10
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# D42(btn) GND
3636

3737
# unfitted big flash-ish chip
38-
# o D14 NC?
38+
# o D14 VCC
3939
# D15 D17
4040
# D2 D19
4141
# GND D18
@@ -61,22 +61,35 @@
6161
'espruino_page_link' : '',
6262
'default_console' : "EV_BLUETOOTH",
6363
'variables' : 5000, # How many variables are allocated for Espruino to use. RAM will be overflowed if this number is too high and code won't compile.
64-
'io_buffer_size' : 512, # How big is the input buffer (in 4 byte words). Default on nRF52 is 256
64+
'io_buffer_size' : 512,
6565
'bootloader' : 1,
6666
'binary_name' : 'espruino_%v_dickens.hex',
6767
'build' : {
6868
'optimizeflags' : '-Os',
6969
'libraries' : [
7070
'BLUETOOTH',
7171
'GRAPHICS',
72-
'LCD_SPI'
72+
'LCD_SPI',
73+
'JIT'
7374
],
7475
'makefile' : [
7576
# 'DEFINES += -DNRF_LOG_ENABLED=1 -DNRF_LOG_FILTERS_ENABLED=0',
76-
'DEFINES += -DCONFIG_NFCT_PINS_AS_GPIOS', # Allow the reset pin to work
77+
'DEFINES += -DCONFIG_NFCT_PINS_AS_GPIOS', # Allow us to use NFC pins as GPIO
78+
'DEFINES += -DESPR_LSE_ENABLE=1', # Ensure low speed external osc enabled
79+
'DEFINES += -DNRF_SDH_BLE_GATT_MAX_MTU_SIZE=131', # 23+x*27 rule as per https://devzone.nordicsemi.com/f/nordic-q-a/44825/ios-mtu-size-why-only-185-bytes
80+
'LDFLAGS += -Xlinker --defsym=LD_APP_RAM_BASE=0x2ec0', # set RAM base to match MTU
81+
# 'DEFINES += -DESPR_REGOUT0_1_8V=1', # Leave REGOUT0 as 1.8v (not 3.3v) - seems to be what original watch firmware did
82+
'DEFINES += -DESPR_DCDC_ENABLE=1', # Use DC/DC converter
83+
'ESPR_BLUETOOTH_ANCS=1', # Enable ANCS (Apple notifications) support
84+
'DEFINES += -DSPIFLASH_SLEEP_CMD', # SPI flash needs to be explicitly slept and woken up
85+
'DEFINES += -DSPIFLASH_READ2X', # Read SPI flash at 2x speed using MISO and MOSI for IO
86+
'DEFINES += -DESPR_USE_SPI3=1', # Use SPI3 (even though it has errata 195) as it's much faster
87+
'DEFINES += -DESPR_BACKLIGHT_FADE=1', # Smoothly fade backlight on and off
7788
'DEFINES += -DNRF_BL_DFU_ENTER_METHOD_BUTTON=1 -DNRF_BL_DFU_ENTER_METHOD_BUTTON_PIN=29',
89+
'DEFINES += -DNRF_BOOTLOADER_NO_WRITE_PROTECT=1', # By default the bootloader protects flash. Avoid this (a patch for NRF_BOOTLOADER_NO_WRITE_PROTECT must be applied first)
7890
'DEFINES += -DBUTTONPRESS_TO_REBOOT_BOOTLOADER',
7991
'DEFINES += -DESPR_BOOTLOADER_SPIFLASH', # Allow bootloader to flash direct from SPI flash
92+
'DEFINES += -DAPP_TIMER_OP_QUEUE_SIZE=6', # Bangle.js accelerometer poll handler needs something else in queue size
8093

8194
'BOOTLOADER_SETTINGS_FAMILY = NRF52840',
8295
'DFU_PRIVATE_KEY=targets/nrf5x_dfu/dfu_private_key.pem',
@@ -85,16 +98,24 @@
8598
'DEFINES+=-DBLUETOOTH_NAME_PREFIX=\'"Dickens"\'',
8699
'DEFINES+=-DCUSTOM_GETBATTERY=jswrap_banglejs_getBattery',
87100
'DEFINES+=-DDUMP_IGNORE_VARIABLES=\'"g\\0"\'',
101+
'DEFINES+=-DESPR_GRAPHICS_INTERNAL=1',
88102
'DEFINES+=-DUSE_FONT_6X8 -DGRAPHICS_PALETTED_IMAGES -DESPR_GRAPHICS_12BIT -DGRAPHICS_ANTIALIAS',
89103
'DEFINES+=-DNO_DUMP_HARDWARE_INITIALISATION', # don't dump hardware init - not used and saves 1k of flash
90-
'INCLUDE += -I$(ROOT)/libs/banglejs -I$(ROOT)/libs/misc',
104+
'INCLUDE += -I$(ROOT)/libs/banglejs -I$(ROOT)/libs/dickens -I$(ROOT)/libs/misc',
91105
'WRAPPERSOURCES += libs/banglejs/jswrap_bangle.c',
106+
'WRAPPERSOURCES += libs/dickens/jswrap_dickens.c',
92107
'WRAPPERSOURCES += libs/graphics/jswrap_font_architekt10.c',
108+
'WRAPPERSOURCES += libs/graphics/jswrap_font_architekt12.c',
93109
'WRAPPERSOURCES += libs/graphics/jswrap_font_architekt15.c',
94110
'WRAPPERSOURCES += libs/graphics/jswrap_font_architekt35.c',
95111
'WRAPPERSOURCES += libs/graphics/jswrap_font_grotesk14.c',
112+
'WRAPPERSOURCES += libs/graphics/jswrap_font_grotesk16.c',
113+
'WRAPPERSOURCES += libs/graphics/jswrap_font_grotesk20.c',
114+
'SOURCES += libs/graphics/line_font.c',
115+
'SOURCES += libs/misc/stepcount.c',
96116
'JSMODULESOURCES += libs/js/banglejs/locale.min.js',
97117
'DEFINES += -DBANGLEJS',
118+
'DEFINES += -DESPR_NO_LOADING_SCREEN', # disable 'loading...' message when switching apps
98119

99120
'NRF_SDK15=1'
100121
]
@@ -115,10 +136,10 @@
115136
'adc' : 1,
116137
'dac' : 0,
117138
'saved_code' : {
118-
# 'address' : ((246 - 10) * 4096), # Bootloader takes pages 248-255, FS takes 246-247
119-
# 'page_size' : 4096,
120-
# 'pages' : 10,
121-
# 'flash_available' : 1024 - ((31 + 8 + 2 + 10)*4) # Softdevice uses 31 pages of flash, bootloader 8, FS 2, code 10. Each page is 4 kb.
139+
# 'address' : ((246 - 10) * 4096), # Bootloader takes pages 248-255, FS takes 246-247
140+
# 'page_size' : 4096,
141+
# 'pages' : 10,
142+
# 'flash_available' : 1024 - ((31 + 8 + 2 + 10)*4) # Softdevice uses 31 pages of flash, bootloader 8, FS 2, code 10. Each page is 4 kb.
122143
'address' : 0x60000000, # put this in external spiflash (see below)
123144
'page_size' : 4096,
124145
'pages' : 768, # 3MB of 4MB flash
@@ -143,7 +164,7 @@
143164
'pin_mosi' : 'D5',
144165
'pin_miso' : 'D27',
145166
'pin_en' : 'D43',
146-
'pin_bl' : 'D33', # TESTED!
167+
'pin_bl' : 'D33', # Also enables the power supply for the vibration motor
147168
'bitrate' : 32000000
148169
},
149170
'BAT' : {

0 commit comments

Comments
 (0)