85 Commits

Author SHA1 Message Date
Gordon Williams
478b28d080 nRF5x: Allow 'high speed' watches via 'hispeed' argument to setWatch. Higher power consumption but detects fast (<25us) pulses. 2022-05-05 12:01:19 +01:00
Gordon Williams
8861b27954 Util Timer now runs independently of system time. More accurate on nRF52 (fix #2125)
Also remove (mostly) duplicated jshPinPulse
2022-03-03 16:43:00 +00:00
Gordon Williams
95a97e5f38 Merge branch 'master' of github.com:espruino/Espruino 2020-10-09 15:52:31 +01:00
Gordon Williams
ad34e66d88 Revert "Fix build issues, remove duplication"
This reverts commit 3007686199ec02d3e727ce918a551c0e9e8a3b75.
2020-10-09 15:45:58 +01:00
MaBecker
17ff204c56 fix #1941 2020-10-09 13:21:39 +02:00
Gordon Williams
3007686199 Fix build issues, remove duplication 2020-10-07 17:08:06 +01:00
MaBecker
89426ec7da fix #1930 2020-09-24 11:47:09 +02:00
MaBecker
bbc372620c esp32_improvements
- add FLASH_BAUD
- fix erase_flash
- switch jsWarn()  to jsDevInfo()
- keep jsWarn()/ jsError() for not implemented functions
- switch jsError() to jsExceptionHere() if helpfull
2020-07-13 17:52:38 +02:00
MaBecker
be30513914 add section storage as flash area 2020-03-18 10:47:55 +01:00
MaBecker
fb5005a3f3 fix addFlashArea() 2020-03-18 10:16:54 +01:00
Gordon Williams
624d6f2c70 Fix ESPxx build issues 2020-01-17 15:15:23 +00:00
jbgagnon
9de4b65bb6 * update micro-seconds also when update time 2018-10-25 16:07:01 +02:00
Gordon Williams
fb2c99c97d Merge branch 'master' into ESP32-v3.0 2018-06-01 14:36:10 +01:00
jumjum123
0054b39c00 ESP32.py
- added variables_mode in config.
build_platform_config.py
- added define for variables_mode
jsvar.h
- added jsVarsSize;  //size of jsVars for option malloc
- added support of malloc jsVars in jsvInit
jsvar.c
- added definition jsVars for variables_mode_malloc
jshardwareESP32.h
- new file with functions to set/get enable status of BLE and Wifi
jshardwareESP32.c
- new file with functions to set/get enable status of BLE and Wifi
ESP32.make
- added jshardware.c to SOURCES
main.c
- added handling for Wifi enabled
- added calculation for jsVars
- initialise jsVars based on calculation
jshardware.c
- used new API call to get Serial Number, even if Wifi is not enabled
- initialises BLE, if BLE is enabled (in NVS storage)
bluetooth.c
- check if BLE is enabled before initialising
jswrap_esp32.h
- defines functions to enable BLE and/or Wifi
jswrap_esp32.c
- wrapper for functions to enable BLE/Wifi, remove code from Flash, to avoid overflow in jsVars
- added status for BLE/Wifi to ESP32.getStatus
esp32_gap_func.c
- get mac adress even if Wifi is not enabled

 Changes to be committed:
	modified:   boards/ESP32.py
	modified:   make/family/ESP32.make
	modified:   scripts/build_platform_config.py
	modified:   src/jsvar.c
	modified:   src/jsvar.h
	modified:   targets/esp32/BLE/esp32_gap_func.c
	modified:   targets/esp32/bluetooth.c
	modified:   targets/esp32/jshardware.c
	new file:   targets/esp32/jshardwareESP32.c
	new file:   targets/esp32/jshardwareESP32.h
	modified:   targets/esp32/jswrap_esp32.c
	modified:   targets/esp32/jswrap_esp32.h
	modified:   targets/esp32/main.c
2018-06-01 12:23:00 +02:00
Gordon Williams
8c97aeee68 Added E.reboot() to allow hard reboots from software (fix #1429) 2018-05-22 09:01:46 +01:00
wilberforce
883000cf81 update esp-idf to v3.0. BLE support - thanks to @jumjum. 2500 vars. Erase flash before flashing 2018-05-13 13:54:02 +12:00
wilberforce
c5921bd803 update require("Flash").getFree(); addresses 2018-05-12 09:51:43 +12:00
Rhys Williams
cfc7233590 check build with debug off in esp-idf libs 2018-05-06 21:05:54 +12:00
Rhys Williams
eb1f01e981 update constant to #define 2018-05-06 17:16:00 +12:00
wilberforce
c362e78da5
ESP32: Fix jshFlashGetMemMapAddress offset
The romdata_jscode point is mapped by the MMU to the real address of the jscode partition. The offset from the start of flash for the code areas is 0x100000 so this has be removed in the direct access of memory case.
2018-02-15 12:43:30 +13:00
Gordon Williams
71d19a91cc try and memory map full flash memory on ESP32 2018-02-14 10:02:19 +00:00
Gordon Williams
3e08b0138e Added to allow remapping of addresses for ESP8266/ESP32 without loads of code duplication 2018-02-13 10:04:35 +00:00
Gordon Williams
a5269f2a5e http://forum.espruino.com/conversations/314330/#comment14003516 2017-12-12 11:38:58 +00:00
wilberforce
b060c5f9ff
ESP32 jshGetSystemTime() make interrupt tolerant
Pull @jumjum changes from ESP32 branch into master
2017-12-09 09:26:12 +13:00
jumjum123
1b3f15a195 Move util timer from its own task into espruino task
The first idea was to move util timer task to 2nd cpu later, but it turned out taskhandling slows down a lot
Therefore it had to be moved
Move init of timer into main loop
Add a bitfield for usage of pins for soft pwm
Add handling of soft pwm pins to jshPinSetState
Add handling of soft PWM to jshPinAnalogOutput if soft:true is set in options
Set time for util timer to a min of 30 usecs
2017-08-09 16:02:11 +02:00
jumjum123
1f0f4fd7b4 upated to actual Espruino
changes in make to get compiled with actual esp-idf
switched from esp-idf specific pulse to Espruino driven (util timer)
2017-07-25 16:19:29 +02:00
Gordon Williams
bc5039794d Do not garbage collect inside an IRQ, fix copy & paste bug 2017-07-24 13:20:17 +01:00
Gordon Williams
fc474da390 Improvements in handling errors in code running in IRQs
- if writing to disconnected Bluetooth device, throw data away immediately
             - Drop chars if output buffer is full while waiting in an IRQ
             - Handle out of memory errors in jsvCreateNewChild
2017-07-24 13:11:53 +01:00
wilberforce
10711c91da whitespace 2017-07-23 13:34:30 +12:00
wilberforce
41830f3659 fix ESP32 'Not connected to the internet' 2017-07-23 13:32:40 +12:00
Gordon Williams
f5e1e82ae2 Add 'errors' option when using to enable error handling (and turn it off by default as it can fill the input queue) 2017-06-19 12:24:39 +01:00
Gordon Williams
c09739f663 Remove duplicate JSON code and WiFi functions in reference, fix #1155 2017-04-29 19:02:51 +01:00
wilberforce
1ebaa2afba PWM fix 2017-04-26 15:39:21 +12:00
wilberforce
0fb9ed1e21 suppress warnings, FatFS docs, suppress logging 2017-04-22 11:17:45 +12:00
wilberforce
821afc6210 remove ESP_LOG calls 2017-04-04 18:39:24 +12:00
jumjum123
d116b3b02b Added i2c reset in jshardware(jshReset)
Set/reset device initialised
Reset i2c channel in setup, if already initialized before
2017-04-02 12:55:45 +12:00
jumjum123
1f197e61b5 Set pin to be GPIO (not rmt or something else) before value is set in jshardware.c (jshPinSetValue)
Set pin to be rmt (not GPIO or something else) before rmt pulse is written in jshardarePulse.c (sendPulse)
2017-04-02 12:55:44 +12:00
jumjum123
1973a776a9 Added reset function to jshreset for
- SPI
- ADC
- UART
- PULSE
2017-03-03 11:59:35 +01:00
jumjum123
e03d345cde Renamed targets/esp32/spi.* to jshardwareSpi.*
renamed targets/esp32/i2c.* to jshardwareI2c.*

Renamed includes for spi.h/i2c.h in jshardware.c, main.c, jshardwareSpi.c. jshardwareI2c.c
2017-02-25 15:46:42 +01:00
Rhys.Williams
70c96f9fc8 Get Onewire working, support pin.toggle() 2017-02-23 18:58:15 +13:00
Rhys.Williams
6bcdb05e4b Get Onewire working, support pin.toggle() 2017-02-23 18:55:45 +13:00
Rhys.Williams
663010e25e update tabs to spaces 2017-02-22 00:38:58 +13:00
Rhys.Williams
6e52c6b30b Set valid pins to 'input' on start up, Add telnet debugging - yay telnet working! 2017-02-22 00:32:12 +13:00
jumjum123
99222ee989 Tested version for SPI (with ILI9341)
Extended to support both SPI channel (HSPI and VSPI)
Todo:
More testing with other SPI based hardware
Testing with two or more devices on same SPI channel (using seperate CE pins)
Input from SPI device
Find a faster solution. Each byte has a lot of overhead in Espruino.
2017-02-13 22:52:51 +01:00
Rhys.Williams
d7d36fd794 jshreset, re-organise hardware start up 2017-02-12 20:21:37 +13:00
jumjum123
94c4e1a2cf Commented esp_restart in jshReset,
WebIDE does not like restart of ESP32 because of strange behaviour compared to Espruino boards.
ESP32 sends to much lines and takes too long to be recognized as started.
Will have to find a better solution.
2017-02-08 08:56:23 +01:00
jumjum123
b390d34d85 Added include for rom/ets_sys.h
Removed ifdef of RTOS in jshardware.c
Errortext in watchdog functions changed
jshDelayMicroseconds now calls ets_delay_us,
  former used taskDelay only works for milliseconds
calling esp_restart in jshReset
2017-02-02 19:50:31 +01:00
jumjum123
52c6136c3c Added support for Serial2 and Serial3
Setup is supported for Serial2 and Serial3 only
Flowcontrol is UART_HW_FLOWCTRL_DISABLE only
2017-01-31 11:33:11 +01:00
jumjum123
83265e45b5 Removed ESP_LOG commands and replaced helpful ESP_LOG by jsError
Done to be more compatible to standard Espruino messages
2017-01-20 16:29:15 +01:00
jumjum123
59f2155135 Added functions to support digitalPulse.
Not tested yet, waiting for an oscilloscope......
2017-01-20 16:12:46 +01:00