mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
1v88 release
Had to remove 'dump()' on devices with very little flash memory (Olimexino/Micro:bit)
This commit is contained in:
parent
a114bc4037
commit
dd2007392a
@ -49,6 +49,7 @@
|
||||
Simplified process.env on devices with little memory
|
||||
nRF5x: fixed serial number reporting
|
||||
Move button state setup to jshResetDevices
|
||||
Had to remove 'dump()' and SW I2C on devices with very little flash memory (Olimexino/Micro:bit)
|
||||
|
||||
1v87 : Add support for compiling with float-abi=hard (even if it doesn't give us real-world benefits)
|
||||
Add shortcut for quick execution of common call types
|
||||
|
||||
3
Makefile
3
Makefile
@ -164,7 +164,6 @@ DEFINES+=-DESPRUINO_1V3
|
||||
USE_NET=1
|
||||
USE_GRAPHICS=1
|
||||
USE_FILESYSTEM=1
|
||||
USE_TV=1
|
||||
USE_HASHLIB=1
|
||||
BOARD=ESPRUINOBOARD
|
||||
STLIB=STM32F10X_XL
|
||||
@ -709,7 +708,7 @@ endif
|
||||
# Get info out of BOARDNAME.py
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
PROJ_NAME=$(shell python scripts/get_board_info.py $(BOARD) "common.get_board_binary_name(board)" | sed -e "s/.bin$$//")
|
||||
PROJ_NAME=$(shell python scripts/get_board_info.py $(BOARD) "common.get_board_binary_name(board)" | sed -e "s/.bin$$//" | sed -e "s/.hex$$//")
|
||||
ifeq ($(PROJ_NAME),)
|
||||
$(error Unable to work out binary name (PROJ_NAME))
|
||||
endif
|
||||
|
||||
@ -24,7 +24,7 @@ info = {
|
||||
'default_console_rx' : "H1", # pin 25
|
||||
'default_console_baudrate' : "9600",
|
||||
'variables' : 100,
|
||||
'binary_name' : 'espruino_%v_microbit.bin',
|
||||
'binary_name' : 'espruino_%v_microbit.hex',
|
||||
'build' : {
|
||||
'defines' : [
|
||||
'USE_GRAPHICS',
|
||||
|
||||
@ -25,7 +25,7 @@ info = {
|
||||
# Number of variables can be WAY higher on this board
|
||||
'variables' : 2000, # How many variables are allocated for Espruino to use. RAM will be overflowed if this number is too high and code won't compile.
|
||||
'bootloader' : 1,
|
||||
'binary_name' : 'espruino_%v_puckjs.bin',
|
||||
'binary_name' : 'espruino_%v_puckjs.hex',
|
||||
'build' : {
|
||||
'defines' : [
|
||||
'USE_BLUETOOTH'
|
||||
|
||||
@ -15,18 +15,26 @@ types of Microcontroller:
|
||||
|
||||
espruino_#v##_pico_1r3_cc3000.bin
|
||||
espruino_#v##_pico_1r3_wiznet.bin
|
||||
- The firmware image for the latest Espruino Pico Boards.
|
||||
- The firmware image for Espruino Pico Boards.
|
||||
We'd strongly suggest that you use the Web IDE to flash this.
|
||||
Each image is for a different type of networking device.
|
||||
If you don't want a network device, it doesn't matter which you choose.
|
||||
|
||||
espruino_#v##_espruino_1r3.bin
|
||||
espruino_#v##_espruino_1r3_wiznet.bin
|
||||
- The firmware image for the latest Espruino Boards (rev 1v3 and 1v4)
|
||||
- The firmware image for Original Espruino Boards
|
||||
We'd strongly suggest that you use the Web IDE to flash this.
|
||||
Each image is for a different type of networking device.
|
||||
If you don't want a network device, it doesn't matter which you choose.
|
||||
|
||||
espruino_#v##_wifi.bin
|
||||
- The firmware image for Espruino WiFi Boards
|
||||
We'd strongly suggest that you use the Web IDE to flash this.
|
||||
|
||||
espruino_#v##_puckjs.zip
|
||||
- The firmware image for Espruino Puck.js Devices
|
||||
Use the nRF Control Panel app to flash this firmware
|
||||
|
||||
espruino_#v##_hystm32_24_ve.bin
|
||||
- 'HY'STM32F103VET6 ARM with 2.4" LCD display
|
||||
This is available from eBay
|
||||
|
||||
@ -214,7 +214,7 @@ def get_jsondata(is_for_document, parseArgs = True, board = False):
|
||||
"filename" : "BOARD.py",
|
||||
"include" : "platform_config.h"
|
||||
})
|
||||
if "LED1" in board.devices:
|
||||
if "BTN" in board.devices:
|
||||
jsondatas.append({
|
||||
"type" : "variable",
|
||||
"name" : "BTN",
|
||||
|
||||
38
scripts/create_puckjs_image.sh
Executable file
38
scripts/create_puckjs_image.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
|
||||
#
|
||||
# Copyright (C) 2016 Gordon Williams <gw@pur3.co.uk>
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
# ----------------------------------------------------------------------------------------
|
||||
# Creates a binary file containing both Espruino and the bootloader
|
||||
# ----------------------------------------------------------------------------------------
|
||||
|
||||
cd `dirname $0` # scripts
|
||||
cd .. # main dir
|
||||
BASEDIR=`pwd`
|
||||
|
||||
BOARDNAME=PUCKJS
|
||||
ESPRUINOFILE=`python scripts/get_board_info.py $BOARDNAME "common.get_board_binary_name(board)"`
|
||||
|
||||
rm -f $ESPRUINOFILE
|
||||
|
||||
export PUCKJS=1
|
||||
export RELEASE=1
|
||||
|
||||
BOOTLOADER=1 make clean
|
||||
BOOTLOADER=1 make || { echo 'Build failed' ; exit 1; }
|
||||
|
||||
make clean
|
||||
make || { echo 'Build failed' ; exit 1; }
|
||||
|
||||
echo ---------------------
|
||||
echo Finished! Written to $ESPRUINOFILE
|
||||
echo nrfjprog --family NRF52 --clockspeed 50000 --program $ESPRUINOFILE --chiperase --reset
|
||||
echo ---------------------
|
||||
|
||||
|
||||
@ -25,14 +25,14 @@ mkdir $ZIPDIR
|
||||
|
||||
|
||||
# ESP8266
|
||||
export ESP8266_SDK_ROOT=$DIR/esp_iot_sdk_v1.5.0
|
||||
export ESP8266_SDK_ROOT=$DIR/esp_iot_sdk_v2.0.0.p1
|
||||
export PATH=$PATH:$DIR/xtensa-lx106-elf/bin/
|
||||
|
||||
echo ------------------------------------------------------
|
||||
echo Building Version $VERSION
|
||||
echo ------------------------------------------------------
|
||||
|
||||
for BOARDNAME in PICO_1V3_CC3000 PICO_1V3_WIZ ESPRUINO_1V3 ESPRUINO_1V3_WIZ ESPRUINOWIFI NUCLEOF401RE NUCLEOF411RE STM32VLDISCOVERY STM32F3DISCOVERY STM32F4DISCOVERY OLIMEXINO_STM32 HYSTM32_24 HYSTM32_28 HYSTM32_32 RASPBERRYPI MICROBIT ESP8266_BOARD
|
||||
for BOARDNAME in PICO_1V3_CC3000 PICO_1V3_WIZ ESPRUINO_1V3 ESPRUINO_1V3_WIZ ESPRUINOWIFI PUCKJS NUCLEOF401RE NUCLEOF411RE STM32VLDISCOVERY STM32F3DISCOVERY STM32F4DISCOVERY OLIMEXINO_STM32 HYSTM32_24 HYSTM32_28 HYSTM32_32 RASPBERRYPI MICROBIT ESP8266_BOARD
|
||||
do
|
||||
echo ------------------------------
|
||||
echo $BOARDNAME
|
||||
@ -59,8 +59,9 @@ do
|
||||
fi
|
||||
# actually build
|
||||
ESP_BINARY_NAME=`python scripts/get_board_info.py $BOARDNAMEX "common.get_board_binary_name(board)"`
|
||||
if [ "$BOARDNAME" == "MICROBIT" ]; then
|
||||
ESP_BINARY_NAME=`basename $ESP_BINARY_NAME .bin`.hex
|
||||
if [ "$BOARDNAME" == "PUCKJS" ]; then
|
||||
ESP_BINARY_NAME=`basename $ESP_BINARY_NAME .hex`.zip
|
||||
EXTRADEFS=DFU_UPDATE_BUILD=1
|
||||
fi
|
||||
echo "Building $ESP_BINARY_NAME"
|
||||
echo
|
||||
|
||||
@ -10,4 +10,4 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
grep "^00...... [^<]" $1 | sort --key=4
|
||||
grep "^0[08]...... [^<]" $1 | sort --key=4
|
||||
|
||||
@ -38,6 +38,8 @@ bool jsi2cPopulateI2CInfo(
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef SAVE_ON_FLASH
|
||||
|
||||
// -------------------------------------------------------- I2C Implementation
|
||||
|
||||
const int I2C_TIMEOUT = 100000;
|
||||
@ -166,3 +168,5 @@ void jsi2cRead(JshI2CInfo *inf, unsigned char address, int nBytes, unsigned char
|
||||
if (sendStop) i2c_stop(&d);
|
||||
inf->started = d.started;
|
||||
}
|
||||
|
||||
#endif // SAVE_ON_FLASH
|
||||
|
||||
@ -26,9 +26,9 @@
|
||||
#include <math.h>
|
||||
|
||||
#ifndef BUILDNUMBER
|
||||
#define JS_VERSION "1v87"
|
||||
#define JS_VERSION "1v88"
|
||||
#else
|
||||
#define JS_VERSION "1v87." BUILDNUMBER
|
||||
#define JS_VERSION "1v88." BUILDNUMBER
|
||||
#endif
|
||||
/*
|
||||
In code:
|
||||
|
||||
@ -115,13 +115,11 @@ void jswrap_interface_trace(JsVar *root) {
|
||||
}
|
||||
}
|
||||
|
||||
/*XXX{ "type":"function", "name" : "dotty",
|
||||
"description" : "Output dotty-format graph of debugging information",
|
||||
"generate" : "jsvDottyOutput"
|
||||
}*/
|
||||
|
||||
/*JSON{
|
||||
"type" : "function",
|
||||
"name" : "dump",
|
||||
"ifndef" : "SAVE_ON_FLASH",
|
||||
"generate_full" : "jsiDumpState((vcbprintf_callback)jsiConsolePrintString, 0)"
|
||||
}
|
||||
Output current interpreter state in a text form such that it can be copied to a new device
|
||||
|
||||
@ -540,6 +540,7 @@ void jswrap_i2c_setup(JsVar *parent, JsVar *options) {
|
||||
if (DEVICE_IS_I2C(device)) {
|
||||
jshI2CSetup(device, &inf);
|
||||
} else if (device == EV_NONE) {
|
||||
#ifndef SAVE_ON_FLASH
|
||||
// software mode - at least configure pins properly
|
||||
if (inf.pinSCL != PIN_UNDEFINED) {
|
||||
jshPinSetValue(inf.pinSCL, 1);
|
||||
@ -549,6 +550,7 @@ void jswrap_i2c_setup(JsVar *parent, JsVar *options) {
|
||||
jshPinSetValue(inf.pinSDA, 1);
|
||||
jshPinSetState(inf.pinSDA, JSHPINSTATE_GPIO_OUT_OPENDRAIN_PULLUP);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// Set up options, so we can initialise it on startup
|
||||
if (options)
|
||||
@ -595,6 +597,7 @@ void jswrap_i2c_writeTo(JsVar *parent, JsVar *addressVar, JsVar *args) {
|
||||
if (DEVICE_IS_I2C(device)) {
|
||||
jshI2CWrite(device, (unsigned char)address, (int)dataLen, (unsigned char*)dataPtr, sendStop);
|
||||
} else if (device == EV_NONE) {
|
||||
#ifndef SAVE_ON_FLASH
|
||||
// software
|
||||
JshI2CInfo inf;
|
||||
JsVar *options = jsvObjectGetChild(parent, DEVICE_OPTIONS_NAME, 0);
|
||||
@ -603,6 +606,7 @@ void jswrap_i2c_writeTo(JsVar *parent, JsVar *addressVar, JsVar *args) {
|
||||
jsi2cWrite(&inf, (unsigned char)address, (int)dataLen, (unsigned char*)dataPtr, sendStop);
|
||||
}
|
||||
jsvUnLock2(jsvObjectSetChild(parent, "started", jsvNewFromBool(inf.started)), options);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -638,6 +642,7 @@ JsVar *jswrap_i2c_readFrom(JsVar *parent, JsVar *addressVar, int nBytes) {
|
||||
if (DEVICE_IS_I2C(device)) {
|
||||
jshI2CRead(device, (unsigned char)address, nBytes, buf, sendStop);
|
||||
} else if (device == EV_NONE) {
|
||||
#ifndef SAVE_ON_FLASH
|
||||
// software
|
||||
JshI2CInfo inf;
|
||||
JsVar *options = jsvObjectGetChild(parent, DEVICE_OPTIONS_NAME, 0);
|
||||
@ -646,6 +651,7 @@ JsVar *jswrap_i2c_readFrom(JsVar *parent, JsVar *addressVar, int nBytes) {
|
||||
jsi2cRead(&inf, (unsigned char)address, nBytes, buf, sendStop);
|
||||
}
|
||||
jsvUnLock2(jsvObjectSetChild(parent, "started", jsvNewFromBool(inf.started)), options);
|
||||
#endif
|
||||
} else return 0;
|
||||
|
||||
JsVar *array = jsvNewTypedArray(ARRAYBUFFERVIEW_UINT8, nBytes);
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
#define SCAN_INTERVAL MSEC_TO_UNITS(100, UNIT_0_625_MS) /**< Scan interval in units of 0.625 millisecond - 100 msec */
|
||||
#define SCAN_WINDOW MSEC_TO_UNITS(100, UNIT_0_625_MS) /**< Scan window in units of 0.625 millisecond - 100 msec */
|
||||
|
||||
#define ADVERTISING_INTERVAL MSEC_TO_UNITS(750, UNIT_0_625_MS) /**< The advertising interval (in units of 0.625 ms). */
|
||||
#define APP_ADV_TIMEOUT_IN_SECONDS 180 /**< The advertising timeout (in units of seconds). */
|
||||
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS) /**< Minimum acceptable connection interval (7.5 ms), Connection interval uses 1.25 ms units. */
|
||||
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) /**< Maximum acceptable connection interval (20 ms (was 75)), Connection interval uses 1.25 ms units. */
|
||||
@ -90,7 +91,7 @@ uint16_t m_central_conn_handle = BLE_CONN_HANDLE_INVALID
|
||||
bool nfcEnabled = false;
|
||||
#endif
|
||||
|
||||
uint16_t bleAdvertisingInterval = MSEC_TO_UNITS(375, UNIT_0_625_MS); /**< The advertising interval (in units of 0.625 ms). */
|
||||
uint16_t bleAdvertisingInterval = ADVERTISING_INTERVAL;
|
||||
|
||||
volatile BLEStatus bleStatus = 0;
|
||||
ble_uuid_t bleUUIDFilter;
|
||||
@ -1017,19 +1018,21 @@ void jsble_kill() {
|
||||
/** Reset BLE to power-on defaults (ish) */
|
||||
void jsble_reset() {
|
||||
// if we were scanning, make sure we stop at reset!
|
||||
if (bleStatus & BLE_IS_SCANNING) {
|
||||
jswrap_nrf_bluetooth_setScan(0);
|
||||
}
|
||||
jswrap_nrf_bluetooth_setRSSIHandler(0);
|
||||
if (bleStatus & BLE_IS_SCANNING) {
|
||||
jswrap_nrf_bluetooth_setScan(0);
|
||||
}
|
||||
jswrap_nrf_bluetooth_setRSSIHandler(0);
|
||||
|
||||
#if CENTRAL_LINK_COUNT>0
|
||||
// if we were connected to something, disconnect
|
||||
if (jsble_has_central_connection()) {
|
||||
sd_ble_gap_disconnect(m_central_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
|
||||
}
|
||||
#endif
|
||||
// make sure we remove any existing services *AND* HID/UART changes
|
||||
jswrap_nrf_bluetooth_setServices(0, 0);
|
||||
#if CENTRAL_LINK_COUNT>0
|
||||
// if we were connected to something, disconnect
|
||||
if (jsble_has_central_connection()) {
|
||||
sd_ble_gap_disconnect(m_central_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
|
||||
}
|
||||
#endif
|
||||
// make sure we remove any existing services *AND* HID/UART changes
|
||||
jswrap_nrf_bluetooth_setServices(0, 0);
|
||||
// Set advertising interval back to default
|
||||
bleAdvertisingInterval = ADVERTISING_INTERVAL;
|
||||
}
|
||||
|
||||
/** Stop and restart the softdevice so that we can update the services in it -
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user