mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
merged changes from upstream espruino
This commit is contained in:
commit
c3d2ce3833
@ -9,6 +9,7 @@
|
||||
Now escape characters >=127 as well (fix #780)
|
||||
Add decodeURIComponent (fix #779)
|
||||
Allow reset();save() on one line
|
||||
Fix potential issue parsing HTTP headers when more data is sent after the header (fix #783)
|
||||
|
||||
1v84 : Fix device initialisation flags not working when the device number is above 32 (fix #751, #748)
|
||||
- this fixes broken SPI when not on standard pins
|
||||
|
||||
@ -269,47 +269,46 @@ static void on_ble_evt(ble_evt_t * p_ble_evt)
|
||||
{
|
||||
uint32_t err_code;
|
||||
|
||||
switch (p_ble_evt->header.evt_id)
|
||||
{
|
||||
case BLE_GAP_EVT_TIMEOUT:
|
||||
// the timeout for sd_ble_gap_adv_start expired - kick it off again
|
||||
jswrap_nrf_bluetooth_startAdvertise();
|
||||
break;
|
||||
switch (p_ble_evt->header.evt_id) {
|
||||
case BLE_GAP_EVT_TIMEOUT:
|
||||
// the timeout for sd_ble_gap_adv_start expired - kick it off again
|
||||
jswrap_nrf_bluetooth_startAdvertise();
|
||||
break;
|
||||
|
||||
case BLE_GAP_EVT_CONNECTED:
|
||||
m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
|
||||
ble_is_sending = false; // reset state - just in case
|
||||
jsiSetConsoleDevice( EV_BLUETOOTH );
|
||||
break;
|
||||
|
||||
case BLE_GAP_EVT_DISCONNECTED:
|
||||
m_conn_handle = BLE_CONN_HANDLE_INVALID;
|
||||
jsiSetConsoleDevice( DEFAULT_CONSOLE_DEVICE );
|
||||
// restart advertising after disconnection
|
||||
jswrap_nrf_bluetooth_startAdvertise();
|
||||
break;
|
||||
case BLE_GAP_EVT_CONNECTED:
|
||||
m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
|
||||
ble_is_sending = false; // reset state - just in case
|
||||
jsiSetConsoleDevice( EV_BLUETOOTH );
|
||||
break;
|
||||
|
||||
case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
|
||||
// Pairing not supported
|
||||
err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
|
||||
APP_ERROR_CHECK(err_code);
|
||||
break;
|
||||
case BLE_GAP_EVT_DISCONNECTED:
|
||||
m_conn_handle = BLE_CONN_HANDLE_INVALID;
|
||||
jsiSetConsoleDevice( DEFAULT_CONSOLE_DEVICE );
|
||||
// restart advertising after disconnection
|
||||
jswrap_nrf_bluetooth_startAdvertise();
|
||||
break;
|
||||
|
||||
case BLE_GATTS_EVT_SYS_ATTR_MISSING:
|
||||
// No system attributes have been stored.
|
||||
err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
|
||||
APP_ERROR_CHECK(err_code);
|
||||
break;
|
||||
case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
|
||||
// Pairing not supported
|
||||
err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
|
||||
APP_ERROR_CHECK(err_code);
|
||||
break;
|
||||
|
||||
case BLE_EVT_TX_COMPLETE:
|
||||
// UART Transmit finished - we can try and send more data
|
||||
ble_is_sending = false;
|
||||
jswrap_nrf_transmit_string();
|
||||
break;
|
||||
case BLE_GATTS_EVT_SYS_ATTR_MISSING:
|
||||
// No system attributes have been stored.
|
||||
err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
|
||||
APP_ERROR_CHECK(err_code);
|
||||
break;
|
||||
|
||||
default:
|
||||
// No implementation needed.
|
||||
break;
|
||||
case BLE_EVT_TX_COMPLETE:
|
||||
// UART Transmit finished - we can try and send more data
|
||||
ble_is_sending = false;
|
||||
jswrap_nrf_transmit_string();
|
||||
break;
|
||||
|
||||
default:
|
||||
// No implementation needed.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -92,6 +92,7 @@ bool httpParseHeaders(JsVar **receiveData, JsVar *objectForData, bool isServer)
|
||||
if (newlineIdx==1) newlineIdx=2;
|
||||
else if (newlineIdx==3) {
|
||||
headerEnd = strIdx+1;
|
||||
break;
|
||||
}
|
||||
} else newlineIdx=0;
|
||||
jsvStringIteratorNext(&it);
|
||||
|
||||
@ -757,7 +757,7 @@ void jsiSemiInit(bool autoLoad) {
|
||||
"| __|_ -| . | _| | | | | . |\n"
|
||||
"|_____|___| _|_| |___|_|_|_|___|\n"
|
||||
" |_| http://espruino.com\n"
|
||||
" "JS_VERSION" Copyright 2015 G.Williams\n");
|
||||
" "JS_VERSION" Copyright 2016 G.Williams\n");
|
||||
#ifdef ESP8266
|
||||
jshPrintBanner();
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user